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

Side by Side Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 1675633002: WebTaskRunnerImpl to take a TaskQueue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 10 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
« no previous file with comments | « content/child/web_url_loader_impl_unittest.cc ('k') | content/test/fake_renderer_scheduler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/renderer/renderer_blink_platform_impl.h" 5 #include "content/renderer/renderer_blink_platform_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 sandbox_support_.reset(); 285 sandbox_support_.reset();
286 #endif 286 #endif
287 } 287 }
288 288
289 //------------------------------------------------------------------------------ 289 //------------------------------------------------------------------------------
290 290
291 blink::WebURLLoader* RendererBlinkPlatformImpl::createURLLoader() { 291 blink::WebURLLoader* RendererBlinkPlatformImpl::createURLLoader() {
292 ChildThreadImpl* child_thread = ChildThreadImpl::current(); 292 ChildThreadImpl* child_thread = ChildThreadImpl::current();
293 // There may be no child thread in RenderViewTests. These tests can still use 293 // There may be no child thread in RenderViewTests. These tests can still use
294 // data URLs to bypass the ResourceDispatcher. 294 // data URLs to bypass the ResourceDispatcher.
295 scoped_ptr<scheduler::WebTaskRunnerImpl> task_runner(
296 new scheduler::WebTaskRunnerImpl(
297 loading_task_runner_->BelongsToCurrentThread()
298 ? loading_task_runner_ : base::ThreadTaskRunnerHandle::Get()));
299 return new content::WebURLLoaderImpl( 295 return new content::WebURLLoaderImpl(
300 child_thread ? child_thread->resource_dispatcher() : NULL, 296 child_thread ? child_thread->resource_dispatcher() : NULL,
301 std::move(task_runner)); 297 make_scoped_ptr(currentThread()->taskRunner()->clone()));
302 } 298 }
303 299
304 blink::WebThread* RendererBlinkPlatformImpl::currentThread() { 300 blink::WebThread* RendererBlinkPlatformImpl::currentThread() {
305 if (main_thread_->isCurrentThread()) 301 if (main_thread_->isCurrentThread())
306 return main_thread_.get(); 302 return main_thread_.get();
307 return BlinkPlatformImpl::currentThread(); 303 return BlinkPlatformImpl::currentThread();
308 } 304 }
309 305
310 blink::WebClipboard* RendererBlinkPlatformImpl::clipboard() { 306 blink::WebClipboard* RendererBlinkPlatformImpl::clipboard() {
311 blink::WebClipboard* clipboard = 307 blink::WebClipboard* clipboard =
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 //------------------------------------------------------------------------------ 1287 //------------------------------------------------------------------------------
1292 1288
1293 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( 1289 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting(
1294 const blink::WebBatteryStatus& status) { 1290 const blink::WebBatteryStatus& status) {
1295 if (!g_test_battery_status_listener) 1291 if (!g_test_battery_status_listener)
1296 return; 1292 return;
1297 g_test_battery_status_listener->updateBatteryStatus(status); 1293 g_test_battery_status_listener->updateBatteryStatus(status);
1298 } 1294 }
1299 1295
1300 } // namespace content 1296 } // namespace content
OLDNEW
« no previous file with comments | « content/child/web_url_loader_impl_unittest.cc ('k') | content/test/fake_renderer_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698