OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extension_host.h" | 5 #include "chrome/browser/extensions/extension_host.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 private: | 89 private: |
90 friend class Singleton<ProcessCreationQueue>; | 90 friend class Singleton<ProcessCreationQueue>; |
91 friend struct DefaultSingletonTraits<ProcessCreationQueue>; | 91 friend struct DefaultSingletonTraits<ProcessCreationQueue>; |
92 ProcessCreationQueue() | 92 ProcessCreationQueue() |
93 : pending_create_(false), | 93 : pending_create_(false), |
94 ptr_factory_(this) {} | 94 ptr_factory_(this) {} |
95 | 95 |
96 // Queue up a delayed task to process the next ExtensionHost in the queue. | 96 // Queue up a delayed task to process the next ExtensionHost in the queue. |
97 void PostTask() { | 97 void PostTask() { |
98 if (!pending_create_) { | 98 if (!pending_create_) { |
99 MessageLoop::current()->PostTask(FROM_HERE, | 99 base::MessageLoop::current()->PostTask(FROM_HERE, |
100 base::Bind(&ProcessCreationQueue::ProcessOneHost, | 100 base::Bind(&ProcessCreationQueue::ProcessOneHost, |
101 ptr_factory_.GetWeakPtr())); | 101 ptr_factory_.GetWeakPtr())); |
102 pending_create_ = true; | 102 pending_create_ = true; |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 // Create the RenderView for the next host in the queue. | 106 // Create the RenderView for the next host in the queue. |
107 void ProcessOneHost() { | 107 void ProcessOneHost() { |
108 pending_create_ = false; | 108 pending_create_ = false; |
109 if (queue_.empty()) | 109 if (queue_.empty()) |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 | 626 |
627 void ExtensionHost::RequestMediaAccessPermission( | 627 void ExtensionHost::RequestMediaAccessPermission( |
628 content::WebContents* web_contents, | 628 content::WebContents* web_contents, |
629 const content::MediaStreamRequest& request, | 629 const content::MediaStreamRequest& request, |
630 const content::MediaResponseCallback& callback) { | 630 const content::MediaResponseCallback& callback) { |
631 MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest( | 631 MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest( |
632 web_contents, request, callback, extension()); | 632 web_contents, request, callback, extension()); |
633 } | 633 } |
634 | 634 |
635 } // namespace extensions | 635 } // namespace extensions |
OLD | NEW |