OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |