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

Side by Side Diff: headless/lib/browser/headless_browser_impl.cc

Issue 2133083002: Remove all remaining traces of MessageLoopProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "headless/lib/browser/headless_browser_impl.h" 5 #include "headless/lib/browser/headless_browser_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 const GURL& initial_url, 80 const GURL& initial_url,
81 const gfx::Size& size) { 81 const gfx::Size& size) {
82 return CreateWebContentsBuilder() 82 return CreateWebContentsBuilder()
83 .SetInitialURL(initial_url) 83 .SetInitialURL(initial_url)
84 .SetWindowSize(size) 84 .SetWindowSize(size)
85 .Build(); 85 .Build();
86 } 86 }
87 87
88 scoped_refptr<base::SingleThreadTaskRunner> 88 scoped_refptr<base::SingleThreadTaskRunner>
89 HeadlessBrowserImpl::BrowserMainThread() const { 89 HeadlessBrowserImpl::BrowserMainThread() const {
90 return content::BrowserThread::GetMessageLoopProxyForThread( 90 return content::BrowserThread::GetTaskRunnerForThread(
91 content::BrowserThread::UI); 91 content::BrowserThread::UI);
92 } 92 }
93 93
94 scoped_refptr<base::SingleThreadTaskRunner> 94 scoped_refptr<base::SingleThreadTaskRunner>
95 HeadlessBrowserImpl::BrowserFileThread() const { 95 HeadlessBrowserImpl::BrowserFileThread() const {
96 return content::BrowserThread::GetMessageLoopProxyForThread( 96 return content::BrowserThread::GetTaskRunnerForThread(
97 content::BrowserThread::FILE); 97 content::BrowserThread::FILE);
98 } 98 }
99 99
100 void HeadlessBrowserImpl::Shutdown() { 100 void HeadlessBrowserImpl::Shutdown() {
101 DCHECK(BrowserMainThread()->BelongsToCurrentThread()); 101 DCHECK(BrowserMainThread()->BelongsToCurrentThread());
102 BrowserMainThread()->PostTask(FROM_HERE, 102 BrowserMainThread()->PostTask(FROM_HERE,
103 base::MessageLoop::QuitWhenIdleClosure()); 103 base::MessageLoop::QuitWhenIdleClosure());
104 } 104 }
105 105
106 std::vector<HeadlessWebContents*> HeadlessBrowserImpl::GetAllWebContents() { 106 std::vector<HeadlessWebContents*> HeadlessBrowserImpl::GetAllWebContents() {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 // Child processes should not end up here. 194 // Child processes should not end up here.
195 base::CommandLine command_line(options.argc, options.argv); 195 base::CommandLine command_line(options.argc, options.argv);
196 DCHECK(!command_line.HasSwitch(switches::kProcessType)); 196 DCHECK(!command_line.HasSwitch(switches::kProcessType));
197 #endif 197 #endif
198 return RunContentMain(std::move(options), 198 return RunContentMain(std::move(options),
199 std::move(on_browser_start_callback)); 199 std::move(on_browser_start_callback));
200 } 200 }
201 201
202 } // namespace headless 202 } // namespace headless
OLDNEW
« no previous file with comments | « headless/lib/browser/headless_browser_context_impl.cc ('k') | headless/lib/browser/headless_url_request_context_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698