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/url_formatter/url_formatter.h" | 24 #include "components/url_formatter/url_formatter.h" |
25 #include "content/child/blob_storage/webblobregistry_impl.h" | 25 #include "content/child/blob_storage/webblobregistry_impl.h" |
26 #include "content/child/database_util.h" | 26 #include "content/child/database_util.h" |
27 #include "content/child/file_info_util.h" | 27 #include "content/child/file_info_util.h" |
28 #include "content/child/fileapi/webfilesystem_impl.h" | 28 #include "content/child/fileapi/webfilesystem_impl.h" |
29 #include "content/child/indexed_db/webidbfactory_impl.h" | |
30 #include "content/child/quota_dispatcher.h" | 29 #include "content/child/quota_dispatcher.h" |
31 #include "content/child/quota_message_filter.h" | 30 #include "content/child/quota_message_filter.h" |
32 #include "content/child/simple_webmimeregistry_impl.h" | 31 #include "content/child/simple_webmimeregistry_impl.h" |
33 #include "content/child/storage_util.h" | 32 #include "content/child/storage_util.h" |
34 #include "content/child/thread_safe_sender.h" | 33 #include "content/child/thread_safe_sender.h" |
35 #include "content/child/web_database_observer_impl.h" | 34 #include "content/child/web_database_observer_impl.h" |
36 #include "content/child/web_url_loader_impl.h" | 35 #include "content/child/web_url_loader_impl.h" |
37 #include "content/child/webfileutilities_impl.h" | 36 #include "content/child/webfileutilities_impl.h" |
38 #include "content/child/webmessageportchannel_impl.h" | 37 #include "content/child/webmessageportchannel_impl.h" |
39 #include "content/common/file_utilities_messages.h" | 38 #include "content/common/file_utilities_messages.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 141 |
143 using blink::Platform; | 142 using blink::Platform; |
144 using blink::WebAudioDevice; | 143 using blink::WebAudioDevice; |
145 using blink::WebBlobRegistry; | 144 using blink::WebBlobRegistry; |
146 using blink::WebCanvasCaptureHandler; | 145 using blink::WebCanvasCaptureHandler; |
147 using blink::WebDatabaseObserver; | 146 using blink::WebDatabaseObserver; |
148 using blink::WebFileInfo; | 147 using blink::WebFileInfo; |
149 using blink::WebFileSystem; | 148 using blink::WebFileSystem; |
150 using blink::WebGamepad; | 149 using blink::WebGamepad; |
151 using blink::WebGamepads; | 150 using blink::WebGamepads; |
152 using blink::WebIDBFactory; | |
153 using blink::WebImageCaptureFrameGrabber; | 151 using blink::WebImageCaptureFrameGrabber; |
154 using blink::WebMIDIAccessor; | 152 using blink::WebMIDIAccessor; |
155 using blink::WebMediaPlayer; | 153 using blink::WebMediaPlayer; |
156 using blink::WebMediaRecorderHandler; | 154 using blink::WebMediaRecorderHandler; |
157 using blink::WebMediaStream; | 155 using blink::WebMediaStream; |
158 using blink::WebMediaStreamCenter; | 156 using blink::WebMediaStreamCenter; |
159 using blink::WebMediaStreamCenterClient; | 157 using blink::WebMediaStreamCenterClient; |
160 using blink::WebMediaStreamTrack; | 158 using blink::WebMediaStreamTrack; |
161 using blink::WebMimeRegistry; | 159 using blink::WebMimeRegistry; |
162 using blink::WebRTCPeerConnectionHandler; | 160 using blink::WebRTCPeerConnectionHandler; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 #endif | 272 #endif |
275 | 273 |
276 // ChildThread may not exist in some tests. | 274 // ChildThread may not exist in some tests. |
277 if (ChildThreadImpl::current()) { | 275 if (ChildThreadImpl::current()) { |
278 sync_message_filter_ = ChildThreadImpl::current()->sync_message_filter(); | 276 sync_message_filter_ = ChildThreadImpl::current()->sync_message_filter(); |
279 thread_safe_sender_ = ChildThreadImpl::current()->thread_safe_sender(); | 277 thread_safe_sender_ = ChildThreadImpl::current()->thread_safe_sender(); |
280 quota_message_filter_ = ChildThreadImpl::current()->quota_message_filter(); | 278 quota_message_filter_ = ChildThreadImpl::current()->quota_message_filter(); |
281 blob_registry_.reset(new WebBlobRegistryImpl( | 279 blob_registry_.reset(new WebBlobRegistryImpl( |
282 RenderThreadImpl::current()->GetIOTaskRunner().get(), | 280 RenderThreadImpl::current()->GetIOTaskRunner().get(), |
283 base::ThreadTaskRunnerHandle::Get(), thread_safe_sender_.get())); | 281 base::ThreadTaskRunnerHandle::Get(), thread_safe_sender_.get())); |
| 282 #if 0 |
284 web_idb_factory_.reset(new WebIDBFactoryImpl(thread_safe_sender_.get())); | 283 web_idb_factory_.reset(new WebIDBFactoryImpl(thread_safe_sender_.get())); |
| 284 #endif |
285 web_database_observer_impl_.reset( | 285 web_database_observer_impl_.reset( |
286 new WebDatabaseObserverImpl(sync_message_filter_.get())); | 286 new WebDatabaseObserverImpl(sync_message_filter_.get())); |
287 } | 287 } |
288 | 288 |
289 top_level_blame_context_.Initialize(); | 289 top_level_blame_context_.Initialize(); |
290 renderer_scheduler_->SetTopLevelBlameContext(&top_level_blame_context_); | 290 renderer_scheduler_->SetTopLevelBlameContext(&top_level_blame_context_); |
291 } | 291 } |
292 | 292 |
293 RendererBlinkPlatformImpl::~RendererBlinkPlatformImpl() { | 293 RendererBlinkPlatformImpl::~RendererBlinkPlatformImpl() { |
294 WebFileSystemImpl::DeleteThreadSpecificInstance(); | 294 WebFileSystemImpl::DeleteThreadSpecificInstance(); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 if (!local_storage_cached_areas_) { | 467 if (!local_storage_cached_areas_) { |
468 local_storage_cached_areas_.reset(new LocalStorageCachedAreas( | 468 local_storage_cached_areas_.reset(new LocalStorageCachedAreas( |
469 RenderThreadImpl::current()->GetStoragePartitionService())); | 469 RenderThreadImpl::current()->GetStoragePartitionService())); |
470 } | 470 } |
471 return new LocalStorageNamespace(local_storage_cached_areas_.get()); | 471 return new LocalStorageNamespace(local_storage_cached_areas_.get()); |
472 } | 472 } |
473 | 473 |
474 return new WebStorageNamespaceImpl(); | 474 return new WebStorageNamespaceImpl(); |
475 } | 475 } |
476 | 476 |
477 | |
478 //------------------------------------------------------------------------------ | |
479 | |
480 WebIDBFactory* RendererBlinkPlatformImpl::idbFactory() { | |
481 return web_idb_factory_.get(); | |
482 } | |
483 | |
484 //------------------------------------------------------------------------------ | 477 //------------------------------------------------------------------------------ |
485 | 478 |
486 blink::WebServiceWorkerCacheStorage* RendererBlinkPlatformImpl::cacheStorage( | 479 blink::WebServiceWorkerCacheStorage* RendererBlinkPlatformImpl::cacheStorage( |
487 const blink::WebSecurityOrigin& security_origin) { | 480 const blink::WebSecurityOrigin& security_origin) { |
488 return new WebServiceWorkerCacheStorageImpl(thread_safe_sender_.get(), | 481 return new WebServiceWorkerCacheStorageImpl(thread_safe_sender_.get(), |
489 security_origin); | 482 security_origin); |
490 } | 483 } |
491 | 484 |
492 //------------------------------------------------------------------------------ | 485 //------------------------------------------------------------------------------ |
493 | 486 |
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 return &trial_token_validator_; | 1310 return &trial_token_validator_; |
1318 } | 1311 } |
1319 | 1312 |
1320 void RendererBlinkPlatformImpl::workerContextCreated( | 1313 void RendererBlinkPlatformImpl::workerContextCreated( |
1321 const v8::Local<v8::Context>& worker) { | 1314 const v8::Local<v8::Context>& worker) { |
1322 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( | 1315 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( |
1323 worker); | 1316 worker); |
1324 } | 1317 } |
1325 | 1318 |
1326 } // namespace content | 1319 } // namespace content |
OLD | NEW |