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

Side by Side Diff: chrome/browser/extensions/chrome_extension_host_delegate.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 "chrome/browser/extensions/chrome_extension_host_delegate.h" 5 #include "chrome/browser/extensions/chrome_extension_host_delegate.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 15 matching lines...) Expand all
26 namespace { 26 namespace {
27 27
28 // Singleton for GetExtensionHostQueue(). 28 // Singleton for GetExtensionHostQueue().
29 struct QueueWrapper { 29 struct QueueWrapper {
30 QueueWrapper() { 30 QueueWrapper() {
31 queue.reset(new LoadMonitoringExtensionHostQueue( 31 queue.reset(new LoadMonitoringExtensionHostQueue(
32 std::unique_ptr<ExtensionHostQueue>(new SerialExtensionHostQueue()))); 32 std::unique_ptr<ExtensionHostQueue>(new SerialExtensionHostQueue())));
33 } 33 }
34 std::unique_ptr<ExtensionHostQueue> queue; 34 std::unique_ptr<ExtensionHostQueue> queue;
35 }; 35 };
36 base::LazyInstance<QueueWrapper> g_queue = LAZY_INSTANCE_INITIALIZER; 36 base::LazyInstance<QueueWrapper>::DestructorAtExit g_queue =
37 LAZY_INSTANCE_INITIALIZER;
37 38
38 } // namespace 39 } // namespace
39 40
40 ChromeExtensionHostDelegate::ChromeExtensionHostDelegate() {} 41 ChromeExtensionHostDelegate::ChromeExtensionHostDelegate() {}
41 42
42 ChromeExtensionHostDelegate::~ChromeExtensionHostDelegate() {} 43 ChromeExtensionHostDelegate::~ChromeExtensionHostDelegate() {}
43 44
44 void ChromeExtensionHostDelegate::OnExtensionHostCreated( 45 void ChromeExtensionHostDelegate::OnExtensionHostCreated(
45 content::WebContents* web_contents) { 46 content::WebContents* web_contents) {
46 ChromeExtensionWebContentsObserver::CreateForWebContents(web_contents); 47 ChromeExtensionWebContentsObserver::CreateForWebContents(web_contents);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 return MediaCaptureDevicesDispatcher::GetInstance() 95 return MediaCaptureDevicesDispatcher::GetInstance()
95 ->CheckMediaAccessPermission( 96 ->CheckMediaAccessPermission(
96 web_contents, security_origin, type, extension); 97 web_contents, security_origin, type, extension);
97 } 98 }
98 99
99 ExtensionHostQueue* ChromeExtensionHostDelegate::GetExtensionHostQueue() const { 100 ExtensionHostQueue* ChromeExtensionHostDelegate::GetExtensionHostQueue() const {
100 return g_queue.Get().queue.get(); 101 return g_queue.Get().queue.get();
101 } 102 }
102 103
103 } // namespace extensions 104 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/blacklist.cc ('k') | chrome/browser/extensions/chrome_extensions_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698