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

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: rebase again Created 7 years, 6 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_function_test_utils.cc ('k') | chrome/browser/extensions/extension_icon_image_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698