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

Side by Side Diff: extensions/browser/api/cast_channel/cast_channel_api.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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/cast_channel/cast_channel_api.h" 5 #include "extensions/browser/api/cast_channel/cast_channel_api.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 124
125 void CastChannelAPI::SendEvent(const std::string& extension_id, 125 void CastChannelAPI::SendEvent(const std::string& extension_id,
126 std::unique_ptr<Event> event) { 126 std::unique_ptr<Event> event) {
127 DCHECK_CURRENTLY_ON(BrowserThread::UI); 127 DCHECK_CURRENTLY_ON(BrowserThread::UI);
128 EventRouter* event_router = EventRouter::Get(GetBrowserContext()); 128 EventRouter* event_router = EventRouter::Get(GetBrowserContext());
129 if (event_router) { 129 if (event_router) {
130 event_router->DispatchEventToExtension(extension_id, std::move(event)); 130 event_router->DispatchEventToExtension(extension_id, std::move(event));
131 } 131 }
132 } 132 }
133 133
134 static base::LazyInstance<BrowserContextKeyedAPIFactory<CastChannelAPI> > 134 static base::LazyInstance<
135 g_factory = LAZY_INSTANCE_INITIALIZER; 135 BrowserContextKeyedAPIFactory<CastChannelAPI>>::DestructorAtExit g_factory =
136 LAZY_INSTANCE_INITIALIZER;
136 137
137 // static 138 // static
138 BrowserContextKeyedAPIFactory<CastChannelAPI>* 139 BrowserContextKeyedAPIFactory<CastChannelAPI>*
139 CastChannelAPI::GetFactoryInstance() { 140 CastChannelAPI::GetFactoryInstance() {
140 return g_factory.Pointer(); 141 return g_factory.Pointer();
141 } 142 }
142 143
143 void CastChannelAPI::SetSocketForTest( 144 void CastChannelAPI::SetSocketForTest(
144 std::unique_ptr<CastSocket> socket_for_test) { 145 std::unique_ptr<CastSocket> socket_for_test) {
145 socket_for_test_ = std::move(socket_for_test); 146 socket_for_test_ = std::move(socket_for_test);
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 BrowserThread::PostTask( 519 BrowserThread::PostTask(
519 BrowserThread::UI, FROM_HERE, 520 BrowserThread::UI, FROM_HERE,
520 base::Bind(ui_dispatch_cb_, socket_->owner_extension_id(), 521 base::Bind(ui_dispatch_cb_, socket_->owner_extension_id(),
521 base::Passed(std::move(event)))); 522 base::Passed(std::move(event))));
522 } 523 }
523 524
524 void CastChannelOpenFunction::CastMessageHandler::Start() { 525 void CastChannelOpenFunction::CastMessageHandler::Start() {
525 } 526 }
526 527
527 } // namespace extensions 528 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698