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

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

Issue 238633009: cleanup: Use EventRouter instead of ExtensionSystem::Get->event_router() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile error for chromeos build. Created 6 years, 8 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
« no previous file with comments | « extensions/browser/api/sockets_tcp_server/tcp_server_socket_event_dispatcher.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "extensions/browser/api/socket/udp_socket.h" 7 #include "extensions/browser/api/socket/udp_socket.h"
8 #include "extensions/browser/event_router.h" 8 #include "extensions/browser/event_router.h"
9 #include "extensions/browser/extension_system.h"
10 #include "extensions/browser/extensions_browser_client.h" 9 #include "extensions/browser/extensions_browser_client.h"
11 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
12 11
13 namespace extensions { 12 namespace extensions {
14 namespace core_api { 13 namespace core_api {
15 14
16 using content::BrowserThread; 15 using content::BrowserThread;
17 16
18 static base::LazyInstance< 17 static base::LazyInstance<
19 BrowserContextKeyedAPIFactory<UDPSocketEventDispatcher> > g_factory = 18 BrowserContextKeyedAPIFactory<UDPSocketEventDispatcher> > g_factory =
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 /*static*/ 166 /*static*/
168 void UDPSocketEventDispatcher::DispatchEvent(void* browser_context_id, 167 void UDPSocketEventDispatcher::DispatchEvent(void* browser_context_id,
169 const std::string& extension_id, 168 const std::string& extension_id,
170 scoped_ptr<Event> event) { 169 scoped_ptr<Event> event) {
171 DCHECK_CURRENTLY_ON(BrowserThread::UI); 170 DCHECK_CURRENTLY_ON(BrowserThread::UI);
172 171
173 content::BrowserContext* context = 172 content::BrowserContext* context =
174 reinterpret_cast<content::BrowserContext*>(browser_context_id); 173 reinterpret_cast<content::BrowserContext*>(browser_context_id);
175 if (!extensions::ExtensionsBrowserClient::Get()->IsValidContext(context)) 174 if (!extensions::ExtensionsBrowserClient::Get()->IsValidContext(context))
176 return; 175 return;
177 EventRouter* router = ExtensionSystem::Get(context)->event_router(); 176 EventRouter* router = EventRouter::Get(context);
178 if (router) 177 if (router)
179 router->DispatchEventToExtension(extension_id, event.Pass()); 178 router->DispatchEventToExtension(extension_id, event.Pass());
180 } 179 }
181 180
182 } // namespace core_api 181 } // namespace core_api
183 } // namespace extensions 182 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/sockets_tcp_server/tcp_server_socket_event_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698