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

Side by Side Diff: chrome/browser/extensions/api/serial/serial_event_dispatcher.cc

Issue 140613002: Cleanup: Replace &LazyInstance::Get() with LazyInstance::Pointer(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/extensions/api/serial/serial_event_dispatcher.h" 5 #include "chrome/browser/extensions/api/serial/serial_event_dispatcher.h"
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/extensions/api/serial/serial_connection.h" 8 #include "chrome/browser/extensions/api/serial/serial_connection.h"
9 #include "chrome/browser/extensions/extension_system.h" 9 #include "chrome/browser/extensions/extension_system.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 13 matching lines...) Expand all
24 } 24 }
25 25
26 } // namespace 26 } // namespace
27 27
28 static base::LazyInstance<ProfileKeyedAPIFactory<SerialEventDispatcher> > 28 static base::LazyInstance<ProfileKeyedAPIFactory<SerialEventDispatcher> >
29 g_factory = LAZY_INSTANCE_INITIALIZER; 29 g_factory = LAZY_INSTANCE_INITIALIZER;
30 30
31 // static 31 // static
32 ProfileKeyedAPIFactory<SerialEventDispatcher>* 32 ProfileKeyedAPIFactory<SerialEventDispatcher>*
33 SerialEventDispatcher::GetFactoryInstance() { 33 SerialEventDispatcher::GetFactoryInstance() {
34 return &g_factory.Get(); 34 return g_factory.Pointer();
35 } 35 }
36 36
37 // static 37 // static
38 SerialEventDispatcher* SerialEventDispatcher::Get(Profile* profile) { 38 SerialEventDispatcher* SerialEventDispatcher::Get(Profile* profile) {
39 return ProfileKeyedAPIFactory<SerialEventDispatcher>::GetForProfile(profile); 39 return ProfileKeyedAPIFactory<SerialEventDispatcher>::GetForProfile(profile);
40 } 40 }
41 41
42 SerialEventDispatcher::SerialEventDispatcher(Profile* profile) 42 SerialEventDispatcher::SerialEventDispatcher(Profile* profile)
43 : thread_id_(SerialConnection::kThreadId), 43 : thread_id_(SerialConnection::kThreadId),
44 profile_(profile) { 44 profile_(profile) {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 return; 149 return;
150 150
151 EventRouter* router = ExtensionSystem::Get(profile)->event_router(); 151 EventRouter* router = ExtensionSystem::Get(profile)->event_router();
152 if (router) 152 if (router)
153 router->DispatchEventToExtension(extension_id, event.Pass()); 153 router->DispatchEventToExtension(extension_id, event.Pass());
154 } 154 }
155 155
156 } // namespace api 156 } // namespace api
157 157
158 } // namespace extensions 158 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/serial/serial_connection.cc ('k') | chrome/browser/extensions/api/sessions/sessions_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698