| 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_webkitplatformsupport_impl.h" | 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 new RendererWebKitPlatformSupportImpl::SandboxSupport); | 235 new RendererWebKitPlatformSupportImpl::SandboxSupport); |
| 236 } else { | 236 } else { |
| 237 DVLOG(1) << "Disabling sandbox support for testing."; | 237 DVLOG(1) << "Disabling sandbox support for testing."; |
| 238 } | 238 } |
| 239 | 239 |
| 240 // ChildThread may not exist in some tests. | 240 // ChildThread may not exist in some tests. |
| 241 if (ChildThread::current()) { | 241 if (ChildThread::current()) { |
| 242 sync_message_filter_ = ChildThread::current()->sync_message_filter(); | 242 sync_message_filter_ = ChildThread::current()->sync_message_filter(); |
| 243 thread_safe_sender_ = ChildThread::current()->thread_safe_sender(); | 243 thread_safe_sender_ = ChildThread::current()->thread_safe_sender(); |
| 244 quota_message_filter_ = ChildThread::current()->quota_message_filter(); | 244 quota_message_filter_ = ChildThread::current()->quota_message_filter(); |
| 245 blob_registry_.reset(new WebBlobRegistryImpl(thread_safe_sender_)); | 245 blob_registry_.reset(new WebBlobRegistryImpl(thread_safe_sender_.get())); |
| 246 web_idb_factory_.reset(new WebIDBFactoryImpl(thread_safe_sender_)); | 246 web_idb_factory_.reset(new WebIDBFactoryImpl(thread_safe_sender_.get())); |
| 247 web_database_observer_impl_.reset( | 247 web_database_observer_impl_.reset( |
| 248 new WebDatabaseObserverImpl(sync_message_filter_)); | 248 new WebDatabaseObserverImpl(sync_message_filter_.get())); |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 | 251 |
| 252 RendererWebKitPlatformSupportImpl::~RendererWebKitPlatformSupportImpl() { | 252 RendererWebKitPlatformSupportImpl::~RendererWebKitPlatformSupportImpl() { |
| 253 WebFileSystemImpl::DeleteThreadSpecificInstance(); | 253 WebFileSystemImpl::DeleteThreadSpecificInstance(); |
| 254 } | 254 } |
| 255 | 255 |
| 256 //------------------------------------------------------------------------------ | 256 //------------------------------------------------------------------------------ |
| 257 | 257 |
| 258 blink::WebClipboard* RendererWebKitPlatformSupportImpl::clipboard() { | 258 blink::WebClipboard* RendererWebKitPlatformSupportImpl::clipboard() { |
| (...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 limits, | 974 limits, |
| 975 static_cast<WebGraphicsContext3DCommandBufferImpl*>(share_context)); | 975 static_cast<WebGraphicsContext3DCommandBufferImpl*>(share_context)); |
| 976 } | 976 } |
| 977 | 977 |
| 978 //------------------------------------------------------------------------------ | 978 //------------------------------------------------------------------------------ |
| 979 | 979 |
| 980 blink::WebGraphicsContext3DProvider* RendererWebKitPlatformSupportImpl:: | 980 blink::WebGraphicsContext3DProvider* RendererWebKitPlatformSupportImpl:: |
| 981 createSharedOffscreenGraphicsContext3DProvider() { | 981 createSharedOffscreenGraphicsContext3DProvider() { |
| 982 scoped_refptr<webkit::gpu::ContextProviderWebContext> provider = | 982 scoped_refptr<webkit::gpu::ContextProviderWebContext> provider = |
| 983 RenderThreadImpl::current()->SharedMainThreadContextProvider(); | 983 RenderThreadImpl::current()->SharedMainThreadContextProvider(); |
| 984 if (!provider) | 984 if (!provider.get()) |
| 985 return NULL; | 985 return NULL; |
| 986 return new WebGraphicsContext3DProviderImpl(provider); | 986 return new WebGraphicsContext3DProviderImpl(provider); |
| 987 } | 987 } |
| 988 | 988 |
| 989 //------------------------------------------------------------------------------ | 989 //------------------------------------------------------------------------------ |
| 990 | 990 |
| 991 blink::WebCompositorSupport* | 991 blink::WebCompositorSupport* |
| 992 RendererWebKitPlatformSupportImpl::compositorSupport() { | 992 RendererWebKitPlatformSupportImpl::compositorSupport() { |
| 993 return &compositor_support_; | 993 return &compositor_support_; |
| 994 } | 994 } |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1174 void RendererWebKitPlatformSupportImpl::MockBatteryStatusChangedForTesting( | 1174 void RendererWebKitPlatformSupportImpl::MockBatteryStatusChangedForTesting( |
| 1175 const blink::WebBatteryStatus& status) { | 1175 const blink::WebBatteryStatus& status) { |
| 1176 PlatformEventObserverBase* observer = | 1176 PlatformEventObserverBase* observer = |
| 1177 platform_event_observers_.Lookup(blink::WebPlatformEventBattery); | 1177 platform_event_observers_.Lookup(blink::WebPlatformEventBattery); |
| 1178 if (!observer) | 1178 if (!observer) |
| 1179 return; | 1179 return; |
| 1180 observer->SendFakeDataForTesting((void*)&status); | 1180 observer->SendFakeDataForTesting((void*)&status); |
| 1181 } | 1181 } |
| 1182 | 1182 |
| 1183 } // namespace content | 1183 } // namespace content |
| OLD | NEW |