| OLD | NEW |
| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 #include "third_party/WebKit/public/platform/WebGamepads.h" | 92 #include "third_party/WebKit/public/platform/WebGamepads.h" |
| 97 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" | 93 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" |
| 98 #include "third_party/WebKit/public/platform/WebMediaStreamCenterClient.h" | 94 #include "third_party/WebKit/public/platform/WebMediaStreamCenterClient.h" |
| 99 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" | 95 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" |
| 100 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 96 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| 101 #include "third_party/WebKit/public/platform/WebURL.h" | 97 #include "third_party/WebKit/public/platform/WebURL.h" |
| 102 #include "third_party/WebKit/public/platform/WebVector.h" | 98 #include "third_party/WebKit/public/platform/WebVector.h" |
| 103 #include "third_party/WebKit/public/platform/mime_registry.mojom.h" | 99 #include "third_party/WebKit/public/platform/mime_registry.mojom.h" |
| 104 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionListener.h" | 100 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionListener.h" |
| 105 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationListener.h" | 101 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationListener.h" |
| 102 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" |
| 106 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 103 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 107 #include "url/gurl.h" | 104 #include "url/gurl.h" |
| 108 | 105 |
| 109 #if defined(OS_MACOSX) | 106 #if defined(OS_MACOSX) |
| 110 #include "content/common/mac/font_descriptor.h" | 107 #include "content/common/mac/font_descriptor.h" |
| 111 #include "content/common/mac/font_loader.h" | 108 #include "content/common/mac/font_loader.h" |
| 112 #include "content/renderer/webscrollbarbehavior_impl_mac.h" | 109 #include "content/renderer/webscrollbarbehavior_impl_mac.h" |
| 113 #include "third_party/WebKit/public/platform/mac/WebSandboxSupport.h" | 110 #include "third_party/WebKit/public/platform/mac/WebSandboxSupport.h" |
| 114 #endif | 111 #endif |
| 115 | 112 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 // here. | 242 // here. |
| 246 base::Lock unicode_font_families_mutex_; | 243 base::Lock unicode_font_families_mutex_; |
| 247 std::map<int32_t, blink::WebFallbackFont> unicode_font_families_; | 244 std::map<int32_t, blink::WebFallbackFont> unicode_font_families_; |
| 248 #endif | 245 #endif |
| 249 }; | 246 }; |
| 250 #endif // !defined(OS_ANDROID) && !defined(OS_WIN) | 247 #endif // !defined(OS_ANDROID) && !defined(OS_WIN) |
| 251 | 248 |
| 252 //------------------------------------------------------------------------------ | 249 //------------------------------------------------------------------------------ |
| 253 | 250 |
| 254 RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( | 251 RendererBlinkPlatformImpl::RendererBlinkPlatformImpl( |
| 255 scheduler::RendererScheduler* renderer_scheduler, | 252 blink::scheduler::RendererScheduler* renderer_scheduler, |
| 256 base::WeakPtr<shell::InterfaceProvider> remote_interfaces) | 253 base::WeakPtr<shell::InterfaceProvider> remote_interfaces) |
| 257 : BlinkPlatformImpl(renderer_scheduler->DefaultTaskRunner()), | 254 : BlinkPlatformImpl(renderer_scheduler->DefaultTaskRunner()), |
| 258 main_thread_(renderer_scheduler->CreateMainThread()), | 255 main_thread_(renderer_scheduler->CreateMainThread()), |
| 259 clipboard_delegate_(new RendererClipboardDelegate), | 256 clipboard_delegate_(new RendererClipboardDelegate), |
| 260 clipboard_(new WebClipboardImpl(clipboard_delegate_.get())), | 257 clipboard_(new WebClipboardImpl(clipboard_delegate_.get())), |
| 261 mime_registry_(new RendererBlinkPlatformImpl::MimeRegistry), | 258 mime_registry_(new RendererBlinkPlatformImpl::MimeRegistry), |
| 262 sudden_termination_disables_(0), | 259 sudden_termination_disables_(0), |
| 263 plugin_refresh_allowed_(true), | 260 plugin_refresh_allowed_(true), |
| 264 default_task_runner_(renderer_scheduler->DefaultTaskRunner()), | 261 default_task_runner_(renderer_scheduler->DefaultTaskRunner()), |
| 265 loading_task_runner_(renderer_scheduler->LoadingTaskRunner()), | 262 loading_task_runner_(renderer_scheduler->LoadingTaskRunner()), |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 #endif | 303 #endif |
| 307 } | 304 } |
| 308 | 305 |
| 309 //------------------------------------------------------------------------------ | 306 //------------------------------------------------------------------------------ |
| 310 | 307 |
| 311 blink::WebURLLoader* RendererBlinkPlatformImpl::createURLLoader() { | 308 blink::WebURLLoader* RendererBlinkPlatformImpl::createURLLoader() { |
| 312 ChildThreadImpl* child_thread = ChildThreadImpl::current(); | 309 ChildThreadImpl* child_thread = ChildThreadImpl::current(); |
| 313 // There may be no child thread in RenderViewTests. These tests can still use | 310 // There may be no child thread in RenderViewTests. These tests can still use |
| 314 // data URLs to bypass the ResourceDispatcher. | 311 // data URLs to bypass the ResourceDispatcher. |
| 315 return new content::WebURLLoaderImpl( | 312 return new content::WebURLLoaderImpl( |
| 316 child_thread ? child_thread->resource_dispatcher() : NULL, | 313 child_thread ? child_thread->resource_dispatcher() : NULL); |
| 317 currentThread()->getWebTaskRunner()->clone()); | |
| 318 } | 314 } |
| 319 | 315 |
| 320 blink::WebThread* RendererBlinkPlatformImpl::currentThread() { | 316 blink::WebThread* RendererBlinkPlatformImpl::currentThread() { |
| 321 if (main_thread_->isCurrentThread()) | 317 if (main_thread_->isCurrentThread()) |
| 322 return main_thread_.get(); | 318 return main_thread_.get(); |
| 323 return BlinkPlatformImpl::currentThread(); | 319 return BlinkPlatformImpl::currentThread(); |
| 324 } | 320 } |
| 325 | 321 |
| 326 blink::BlameContext* RendererBlinkPlatformImpl::topLevelBlameContext() { | 322 blink::BlameContext* RendererBlinkPlatformImpl::topLevelBlameContext() { |
| 327 return &top_level_blame_context_; | 323 return &top_level_blame_context_; |
| (...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1313 return &trial_token_validator_; | 1309 return &trial_token_validator_; |
| 1314 } | 1310 } |
| 1315 | 1311 |
| 1316 void RendererBlinkPlatformImpl::workerContextCreated( | 1312 void RendererBlinkPlatformImpl::workerContextCreated( |
| 1317 const v8::Local<v8::Context>& worker) { | 1313 const v8::Local<v8::Context>& worker) { |
| 1318 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( | 1314 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( |
| 1319 worker); | 1315 worker); |
| 1320 } | 1316 } |
| 1321 | 1317 |
| 1322 } // namespace content | 1318 } // namespace content |
| OLD | NEW |