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

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

Issue 2118903002: scheduler: Move the Blink scheduler into Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Really fixed the test failure this time Created 4 years, 4 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 (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"
11 #include "base/guid.h" 11 #include "base/guid.h"
12 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
13 #include "base/location.h" 13 #include "base/location.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/memory/ptr_util.h" 15 #include "base/memory/ptr_util.h"
16 #include "base/memory/shared_memory.h" 16 #include "base/memory/shared_memory.h"
17 #include "base/metrics/histogram.h" 17 #include "base/metrics/histogram.h"
18 #include "base/numerics/safe_conversions.h" 18 #include "base/numerics/safe_conversions.h"
19 #include "base/single_thread_task_runner.h" 19 #include "base/single_thread_task_runner.h"
20 #include "base/strings/string_number_conversions.h" 20 #include "base/strings/string_number_conversions.h"
21 #include "base/strings/utf_string_conversions.h" 21 #include "base/strings/utf_string_conversions.h"
22 #include "base/threading/thread_task_runner_handle.h" 22 #include "base/threading/thread_task_runner_handle.h"
23 #include "build/build_config.h" 23 #include "build/build_config.h"
24 #include "components/scheduler/child/web_scheduler_impl.h"
25 #include "components/scheduler/child/web_task_runner_impl.h"
26 #include "components/scheduler/renderer/renderer_scheduler.h"
27 #include "components/scheduler/renderer/webthread_impl_for_renderer_scheduler.h"
28 #include "components/url_formatter/url_formatter.h" 24 #include "components/url_formatter/url_formatter.h"
29 #include "content/child/blob_storage/webblobregistry_impl.h" 25 #include "content/child/blob_storage/webblobregistry_impl.h"
30 #include "content/child/database_util.h" 26 #include "content/child/database_util.h"
31 #include "content/child/file_info_util.h" 27 #include "content/child/file_info_util.h"
32 #include "content/child/fileapi/webfilesystem_impl.h" 28 #include "content/child/fileapi/webfilesystem_impl.h"
33 #include "content/child/indexed_db/webidbfactory_impl.h" 29 #include "content/child/indexed_db/webidbfactory_impl.h"
34 #include "content/child/quota_dispatcher.h" 30 #include "content/child/quota_dispatcher.h"
35 #include "content/child/quota_message_filter.h" 31 #include "content/child/quota_message_filter.h"
36 #include "content/child/simple_webmimeregistry_impl.h" 32 #include "content/child/simple_webmimeregistry_impl.h"
37 #include "content/child/storage_util.h" 33 #include "content/child/storage_util.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 #include "third_party/WebKit/public/platform/WebGamepads.h" 93 #include "third_party/WebKit/public/platform/WebGamepads.h"
98 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" 94 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h"
99 #include "third_party/WebKit/public/platform/WebMediaStreamCenterClient.h" 95 #include "third_party/WebKit/public/platform/WebMediaStreamCenterClient.h"
100 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" 96 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h"
101 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" 97 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h"
102 #include "third_party/WebKit/public/platform/WebURL.h" 98 #include "third_party/WebKit/public/platform/WebURL.h"
103 #include "third_party/WebKit/public/platform/WebVector.h" 99 #include "third_party/WebKit/public/platform/WebVector.h"
104 #include "third_party/WebKit/public/platform/mime_registry.mojom.h" 100 #include "third_party/WebKit/public/platform/mime_registry.mojom.h"
105 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic eMotionListener.h" 101 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic eMotionListener.h"
106 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic eOrientationListener.h" 102 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic eOrientationListener.h"
103 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul er.h"
107 #include "third_party/WebKit/public/web/WebLocalFrame.h" 104 #include "third_party/WebKit/public/web/WebLocalFrame.h"
108 #include "url/gurl.h" 105 #include "url/gurl.h"
109 106
110 #if defined(OS_MACOSX) 107 #if defined(OS_MACOSX)
111 #include "content/common/mac/font_descriptor.h" 108 #include "content/common/mac/font_descriptor.h"
112 #include "content/common/mac/font_loader.h" 109 #include "content/common/mac/font_loader.h"
113 #include "content/renderer/webscrollbarbehavior_impl_mac.h" 110 #include "content/renderer/webscrollbarbehavior_impl_mac.h"
114 #include "third_party/WebKit/public/platform/mac/WebSandboxSupport.h" 111 #include "third_party/WebKit/public/platform/mac/WebSandboxSupport.h"
115 #endif 112 #endif
116 113
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 // here. 243 // here.
247 base::Lock unicode_font_families_mutex_; 244 base::Lock unicode_font_families_mutex_;
248 std::map<int32_t, blink::WebFallbackFont> unicode_font_families_; 245 std::map<int32_t, blink::WebFallbackFont> unicode_font_families_;
249 #endif 246 #endif
250 }; 247 };
251 #endif // !defined(OS_ANDROID) && !defined(OS_WIN) 248 #endif // !defined(OS_ANDROID) && !defined(OS_WIN)
252 249
253 //------------------------------------------------------------------------------ 250 //------------------------------------------------------------------------------
254 251
255 RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( 252 RendererBlinkPlatformImpl::RendererBlinkPlatformImpl(
256 scheduler::RendererScheduler* renderer_scheduler, 253 blink::scheduler::RendererScheduler* renderer_scheduler,
257 base::WeakPtr<shell::InterfaceProvider> remote_interfaces) 254 base::WeakPtr<shell::InterfaceProvider> remote_interfaces)
258 : BlinkPlatformImpl(renderer_scheduler->DefaultTaskRunner()), 255 : BlinkPlatformImpl(renderer_scheduler->DefaultTaskRunner()),
259 main_thread_(renderer_scheduler->CreateMainThread()), 256 main_thread_(renderer_scheduler->CreateMainThread()),
260 clipboard_delegate_(new RendererClipboardDelegate), 257 clipboard_delegate_(new RendererClipboardDelegate),
261 clipboard_(new WebClipboardImpl(clipboard_delegate_.get())), 258 clipboard_(new WebClipboardImpl(clipboard_delegate_.get())),
262 mime_registry_(new RendererBlinkPlatformImpl::MimeRegistry), 259 mime_registry_(new RendererBlinkPlatformImpl::MimeRegistry),
263 sudden_termination_disables_(0), 260 sudden_termination_disables_(0),
264 plugin_refresh_allowed_(true), 261 plugin_refresh_allowed_(true),
265 default_task_runner_(renderer_scheduler->DefaultTaskRunner()), 262 default_task_runner_(renderer_scheduler->DefaultTaskRunner()),
266 loading_task_runner_(renderer_scheduler->LoadingTaskRunner()), 263 loading_task_runner_(renderer_scheduler->LoadingTaskRunner()),
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 #endif 304 #endif
308 } 305 }
309 306
310 //------------------------------------------------------------------------------ 307 //------------------------------------------------------------------------------
311 308
312 blink::WebURLLoader* RendererBlinkPlatformImpl::createURLLoader() { 309 blink::WebURLLoader* RendererBlinkPlatformImpl::createURLLoader() {
313 ChildThreadImpl* child_thread = ChildThreadImpl::current(); 310 ChildThreadImpl* child_thread = ChildThreadImpl::current();
314 // There may be no child thread in RenderViewTests. These tests can still use 311 // There may be no child thread in RenderViewTests. These tests can still use
315 // data URLs to bypass the ResourceDispatcher. 312 // data URLs to bypass the ResourceDispatcher.
316 return new content::WebURLLoaderImpl( 313 return new content::WebURLLoaderImpl(
317 child_thread ? child_thread->resource_dispatcher() : NULL, 314 child_thread ? child_thread->resource_dispatcher() : NULL);
318 currentThread()->getWebTaskRunner()->clone());
319 } 315 }
320 316
321 blink::WebThread* RendererBlinkPlatformImpl::currentThread() { 317 blink::WebThread* RendererBlinkPlatformImpl::currentThread() {
322 if (main_thread_->isCurrentThread()) 318 if (main_thread_->isCurrentThread())
323 return main_thread_.get(); 319 return main_thread_.get();
324 return BlinkPlatformImpl::currentThread(); 320 return BlinkPlatformImpl::currentThread();
325 } 321 }
326 322
327 blink::BlameContext* RendererBlinkPlatformImpl::topLevelBlameContext() { 323 blink::BlameContext* RendererBlinkPlatformImpl::topLevelBlameContext() {
328 return &top_level_blame_context_; 324 return &top_level_blame_context_;
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 return &trial_token_validator_; 1312 return &trial_token_validator_;
1317 } 1313 }
1318 1314
1319 void RendererBlinkPlatformImpl::workerContextCreated( 1315 void RendererBlinkPlatformImpl::workerContextCreated(
1320 const v8::Local<v8::Context>& worker) { 1316 const v8::Local<v8::Context>& worker) {
1321 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( 1317 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread(
1322 worker); 1318 worker);
1323 } 1319 }
1324 1320
1325 } // namespace content 1321 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698