Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.cc

Issue 598173003: Run clang-modernize -use-nullptr over src/extensions/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.h" 5 #include "extensions/browser/api/sockets_udp/udp_socket_event_dispatcher.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "extensions/browser/api/socket/udp_socket.h" 8 #include "extensions/browser/api/socket/udp_socket.h"
9 #include "extensions/browser/event_router.h" 9 #include "extensions/browser/event_router.h"
10 #include "extensions/browser/extensions_browser_client.h" 10 #include "extensions/browser/extensions_browser_client.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 StartReceive(params); 71 StartReceive(params);
72 } 72 }
73 73
74 /* static */ 74 /* static */
75 void UDPSocketEventDispatcher::StartReceive(const ReceiveParams& params) { 75 void UDPSocketEventDispatcher::StartReceive(const ReceiveParams& params) {
76 DCHECK_CURRENTLY_ON(params.thread_id); 76 DCHECK_CURRENTLY_ON(params.thread_id);
77 77
78 ResumableUDPSocket* socket = 78 ResumableUDPSocket* socket =
79 params.sockets->Get(params.extension_id, params.socket_id); 79 params.sockets->Get(params.extension_id, params.socket_id);
80 if (socket == NULL) { 80 if (socket == nullptr) {
81 // This can happen if the socket is closed while our callback is active. 81 // This can happen if the socket is closed while our callback is active.
82 return; 82 return;
83 } 83 }
84 DCHECK(params.extension_id == socket->owner_extension_id()) 84 DCHECK(params.extension_id == socket->owner_extension_id())
85 << "Socket has wrong owner."; 85 << "Socket has wrong owner.";
86 86
87 // Don't start another read if the socket has been paused. 87 // Don't start another read if the socket has been paused.
88 if (socket->paused()) 88 if (socket->paused())
89 return; 89 return;
90 90
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 reinterpret_cast<content::BrowserContext*>(browser_context_id); 174 reinterpret_cast<content::BrowserContext*>(browser_context_id);
175 if (!extensions::ExtensionsBrowserClient::Get()->IsValidContext(context)) 175 if (!extensions::ExtensionsBrowserClient::Get()->IsValidContext(context))
176 return; 176 return;
177 EventRouter* router = EventRouter::Get(context); 177 EventRouter* router = EventRouter::Get(context);
178 if (router) 178 if (router)
179 router->DispatchEventToExtension(extension_id, event.Pass()); 179 router->DispatchEventToExtension(extension_id, event.Pass());
180 } 180 }
181 181
182 } // namespace core_api 182 } // namespace core_api
183 } // namespace extensions 183 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698