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

Side by Side Diff: chrome/browser/extensions/extension_host.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 (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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 private: 88 private:
89 friend class Singleton<ProcessCreationQueue>; 89 friend class Singleton<ProcessCreationQueue>;
90 friend struct DefaultSingletonTraits<ProcessCreationQueue>; 90 friend struct DefaultSingletonTraits<ProcessCreationQueue>;
91 ProcessCreationQueue() 91 ProcessCreationQueue()
92 : pending_create_(false), 92 : pending_create_(false),
93 ALLOW_THIS_IN_INITIALIZER_LIST(ptr_factory_(this)) { } 93 ALLOW_THIS_IN_INITIALIZER_LIST(ptr_factory_(this)) { }
94 94
95 // Queue up a delayed task to process the next ExtensionHost in the queue. 95 // Queue up a delayed task to process the next ExtensionHost in the queue.
96 void PostTask() { 96 void PostTask() {
97 if (!pending_create_) { 97 if (!pending_create_) {
98 MessageLoop::current()->PostTask(FROM_HERE, 98 base::MessageLoop::current()->PostTask(
99 FROM_HERE,
99 base::Bind(&ProcessCreationQueue::ProcessOneHost, 100 base::Bind(&ProcessCreationQueue::ProcessOneHost,
100 ptr_factory_.GetWeakPtr())); 101 ptr_factory_.GetWeakPtr()));
101 pending_create_ = true; 102 pending_create_ = true;
102 } 103 }
103 } 104 }
104 105
105 // Create the RenderView for the next host in the queue. 106 // Create the RenderView for the next host in the queue.
106 void ProcessOneHost() { 107 void ProcessOneHost() {
107 pending_create_ = false; 108 pending_create_ = false;
108 if (queue_.empty()) 109 if (queue_.empty())
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 622
622 void ExtensionHost::RequestMediaAccessPermission( 623 void ExtensionHost::RequestMediaAccessPermission(
623 content::WebContents* web_contents, 624 content::WebContents* web_contents,
624 const content::MediaStreamRequest& request, 625 const content::MediaStreamRequest& request,
625 const content::MediaResponseCallback& callback) { 626 const content::MediaResponseCallback& callback) {
626 MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest( 627 MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
627 web_contents, request, callback, extension()); 628 web_contents, request, callback, extension());
628 } 629 }
629 630
630 } // namespace extensions 631 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698