summaryrefslogtreecommitdiff
path: root/chromium/extensions/browser/api/sockets_udp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/extensions/browser/api/sockets_udp')
-rw-r--r--chromium/extensions/browser/api/sockets_udp/sockets_udp_api.cc10
-rw-r--r--chromium/extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.cc4
2 files changed, 7 insertions, 7 deletions
diff --git a/chromium/extensions/browser/api/sockets_udp/sockets_udp_api.cc b/chromium/extensions/browser/api/sockets_udp/sockets_udp_api.cc
index 2c17cbe5308..2c7ca4a6503 100644
--- a/chromium/extensions/browser/api/sockets_udp/sockets_udp_api.cc
+++ b/chromium/extensions/browser/api/sockets_udp/sockets_udp_api.cc
@@ -142,7 +142,7 @@ void SocketsUdpUpdateFunction::Work() {
}
SocketsUdpSetPausedFunction::SocketsUdpSetPausedFunction()
- : socket_event_dispatcher_(NULL) {}
+ : socket_event_dispatcher_(nullptr) {}
SocketsUdpSetPausedFunction::~SocketsUdpSetPausedFunction() {}
@@ -156,7 +156,7 @@ bool SocketsUdpSetPausedFunction::Prepare() {
"If this assertion is failing during a test, then it is likely that "
"TestExtensionSystem is failing to provide an instance of "
"UDPSocketEventDispatcher.";
- return socket_event_dispatcher_ != NULL;
+ return !!socket_event_dispatcher_;
}
void SocketsUdpSetPausedFunction::Work() {
@@ -178,7 +178,7 @@ void SocketsUdpSetPausedFunction::Work() {
}
SocketsUdpBindFunction::SocketsUdpBindFunction()
- : socket_event_dispatcher_(NULL) {}
+ : socket_event_dispatcher_(nullptr) {}
SocketsUdpBindFunction::~SocketsUdpBindFunction() {}
@@ -192,7 +192,7 @@ bool SocketsUdpBindFunction::Prepare() {
"If this assertion is failing during a test, then it is likely that "
"TestExtensionSystem is failing to provide an instance of "
"UDPSocketEventDispatcher.";
- return socket_event_dispatcher_ != NULL;
+ return !!socket_event_dispatcher_;
}
void SocketsUdpBindFunction::AsyncWorkStart() {
@@ -363,7 +363,7 @@ bool SocketsUdpGetSocketsFunction::Prepare() { return true; }
void SocketsUdpGetSocketsFunction::Work() {
std::vector<sockets_udp::SocketInfo> socket_infos;
std::unordered_set<int>* resource_ids = GetSocketIds();
- if (resource_ids != NULL) {
+ if (resource_ids) {
for (int socket_id : *resource_ids) {
ResumableUDPSocket* socket = GetUdpSocket(socket_id);
if (socket) {
diff --git a/chromium/extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.cc b/chromium/extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.cc
index 14774d2cf85..a1fd9f34e15 100644
--- a/chromium/extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.cc
+++ b/chromium/extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.cc
@@ -171,8 +171,8 @@ void UDPSocketEventDispatcher::PostEvent(const ReceiveParams& params,
std::unique_ptr<Event> event) {
DCHECK_CURRENTLY_ON(params.thread_id);
- base::PostTask(FROM_HERE, {BrowserThread::UI},
- base::BindOnce(&DispatchEvent, params.browser_context_id,
+ content::GetUIThreadTaskRunner({})->PostTask(
+ FROM_HERE, base::BindOnce(&DispatchEvent, params.browser_context_id,
params.extension_id, std::move(event)));
}