| 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 #ifndef CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ |
| 6 #define CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> |
| 12 |
| 11 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 12 #include "base/id_map.h" | 14 #include "base/id_map.h" |
| 13 #include "base/macros.h" | 15 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 16 #include "cc/blink/web_compositor_support_impl.h" | 17 #include "cc/blink/web_compositor_support_impl.h" |
| 17 #include "content/child/blink_platform_impl.h" | 18 #include "content/child/blink_platform_impl.h" |
| 18 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 19 #include "content/renderer/origin_trials/web_trial_token_validator_impl.h" | 20 #include "content/renderer/origin_trials/web_trial_token_validator_impl.h" |
| 20 #include "content/renderer/top_level_blame_context.h" | 21 #include "content/renderer/top_level_blame_context.h" |
| 21 #include "content/renderer/webpublicsuffixlist_impl.h" | 22 #include "content/renderer/webpublicsuffixlist_impl.h" |
| 22 #include "device/vibration/vibration_manager.mojom.h" | 23 #include "device/vibration/vibration_manager.mojom.h" |
| 23 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 24 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 24 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBFactory.h" | 25 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBFactory.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 void recordRapporURL(const char* metric, const blink::WebURL& url) override; | 197 void recordRapporURL(const char* metric, const blink::WebURL& url) override; |
| 197 | 198 |
| 198 blink::WebTrialTokenValidator* trialTokenValidator() override; | 199 blink::WebTrialTokenValidator* trialTokenValidator() override; |
| 199 | 200 |
| 200 // Set the PlatformEventObserverBase in |platform_event_observers_| associated | 201 // Set the PlatformEventObserverBase in |platform_event_observers_| associated |
| 201 // with |type| to |observer|. If there was already an observer associated to | 202 // with |type| to |observer|. If there was already an observer associated to |
| 202 // the given |type|, it will be replaced. | 203 // the given |type|, it will be replaced. |
| 203 // Note that |observer| will be owned by this object after the call. | 204 // Note that |observer| will be owned by this object after the call. |
| 204 void SetPlatformEventObserverForTesting( | 205 void SetPlatformEventObserverForTesting( |
| 205 blink::WebPlatformEventType type, | 206 blink::WebPlatformEventType type, |
| 206 scoped_ptr<PlatformEventObserverBase> observer); | 207 std::unique_ptr<PlatformEventObserverBase> observer); |
| 207 | 208 |
| 208 // Disables the WebSandboxSupport implementation for testing. | 209 // Disables the WebSandboxSupport implementation for testing. |
| 209 // Tests that do not set up a full sandbox environment should call | 210 // Tests that do not set up a full sandbox environment should call |
| 210 // SetSandboxEnabledForTesting(false) _before_ creating any instances | 211 // SetSandboxEnabledForTesting(false) _before_ creating any instances |
| 211 // of this class, to ensure that we don't attempt to use sandbox-related | 212 // of this class, to ensure that we don't attempt to use sandbox-related |
| 212 // file descriptors or other resources. | 213 // file descriptors or other resources. |
| 213 // | 214 // |
| 214 // Returns the previous |enable| value. | 215 // Returns the previous |enable| value. |
| 215 static bool SetSandboxEnabledForTesting(bool enable); | 216 static bool SetSandboxEnabledForTesting(bool enable); |
| 216 | 217 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 236 // Factory that takes a type and return PlatformEventObserverBase that matches | 237 // Factory that takes a type and return PlatformEventObserverBase that matches |
| 237 // it. | 238 // it. |
| 238 static PlatformEventObserverBase* CreatePlatformEventObserverFromType( | 239 static PlatformEventObserverBase* CreatePlatformEventObserverFromType( |
| 239 blink::WebPlatformEventType type); | 240 blink::WebPlatformEventType type); |
| 240 | 241 |
| 241 // Use the data previously set via SetMockDevice...DataForTesting() and send | 242 // Use the data previously set via SetMockDevice...DataForTesting() and send |
| 242 // them to the registered listener. | 243 // them to the registered listener. |
| 243 void SendFakeDeviceEventDataForTesting(blink::WebPlatformEventType type); | 244 void SendFakeDeviceEventDataForTesting(blink::WebPlatformEventType type); |
| 244 device::VibrationManagerPtr& GetConnectedVibrationManagerService(); | 245 device::VibrationManagerPtr& GetConnectedVibrationManagerService(); |
| 245 | 246 |
| 246 scoped_ptr<blink::WebThread> main_thread_; | 247 std::unique_ptr<blink::WebThread> main_thread_; |
| 247 | 248 |
| 248 scoped_ptr<RendererClipboardDelegate> clipboard_delegate_; | 249 std::unique_ptr<RendererClipboardDelegate> clipboard_delegate_; |
| 249 scoped_ptr<WebClipboardImpl> clipboard_; | 250 std::unique_ptr<WebClipboardImpl> clipboard_; |
| 250 | 251 |
| 251 class FileUtilities; | 252 class FileUtilities; |
| 252 scoped_ptr<FileUtilities> file_utilities_; | 253 std::unique_ptr<FileUtilities> file_utilities_; |
| 253 | 254 |
| 254 class MimeRegistry; | 255 class MimeRegistry; |
| 255 scoped_ptr<MimeRegistry> mime_registry_; | 256 std::unique_ptr<MimeRegistry> mime_registry_; |
| 256 | 257 |
| 257 #if !defined(OS_ANDROID) && !defined(OS_WIN) | 258 #if !defined(OS_ANDROID) && !defined(OS_WIN) |
| 258 class SandboxSupport; | 259 class SandboxSupport; |
| 259 scoped_ptr<SandboxSupport> sandbox_support_; | 260 std::unique_ptr<SandboxSupport> sandbox_support_; |
| 260 #endif | 261 #endif |
| 261 | 262 |
| 262 // This counter keeps track of the number of times sudden termination is | 263 // This counter keeps track of the number of times sudden termination is |
| 263 // enabled or disabled. It starts at 0 (enabled) and for every disable | 264 // enabled or disabled. It starts at 0 (enabled) and for every disable |
| 264 // increments by 1, for every enable decrements by 1. When it reaches 0, | 265 // increments by 1, for every enable decrements by 1. When it reaches 0, |
| 265 // we tell the browser to enable fast termination. | 266 // we tell the browser to enable fast termination. |
| 266 int sudden_termination_disables_; | 267 int sudden_termination_disables_; |
| 267 | 268 |
| 268 // If true, then a GetPlugins call is allowed to rescan the disk. | 269 // If true, then a GetPlugins call is allowed to rescan the disk. |
| 269 bool plugin_refresh_allowed_; | 270 bool plugin_refresh_allowed_; |
| 270 | 271 |
| 271 scoped_ptr<blink::WebIDBFactory> web_idb_factory_; | 272 std::unique_ptr<blink::WebIDBFactory> web_idb_factory_; |
| 272 | 273 |
| 273 scoped_ptr<blink::WebBlobRegistry> blob_registry_; | 274 std::unique_ptr<blink::WebBlobRegistry> blob_registry_; |
| 274 | 275 |
| 275 WebPublicSuffixListImpl public_suffix_list_; | 276 WebPublicSuffixListImpl public_suffix_list_; |
| 276 | 277 |
| 277 scoped_ptr<DeviceLightEventPump> device_light_event_pump_; | 278 std::unique_ptr<DeviceLightEventPump> device_light_event_pump_; |
| 278 scoped_ptr<DeviceMotionEventPump> device_motion_event_pump_; | 279 std::unique_ptr<DeviceMotionEventPump> device_motion_event_pump_; |
| 279 scoped_ptr<DeviceOrientationEventPump> device_orientation_event_pump_; | 280 std::unique_ptr<DeviceOrientationEventPump> device_orientation_event_pump_; |
| 280 | 281 |
| 281 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; | 282 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; |
| 282 scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner_; | 283 scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner_; |
| 283 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; | 284 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; |
| 284 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 285 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| 285 scoped_refptr<QuotaMessageFilter> quota_message_filter_; | 286 scoped_refptr<QuotaMessageFilter> quota_message_filter_; |
| 286 | 287 |
| 287 scoped_ptr<WebDatabaseObserverImpl> web_database_observer_impl_; | 288 std::unique_ptr<WebDatabaseObserverImpl> web_database_observer_impl_; |
| 288 | 289 |
| 289 cc_blink::WebCompositorSupportImpl compositor_support_; | 290 cc_blink::WebCompositorSupportImpl compositor_support_; |
| 290 | 291 |
| 291 scoped_ptr<blink::WebScrollbarBehavior> web_scrollbar_behavior_; | 292 std::unique_ptr<blink::WebScrollbarBehavior> web_scrollbar_behavior_; |
| 292 | 293 |
| 293 // Handle to the Vibration mojo service. | 294 // Handle to the Vibration mojo service. |
| 294 device::VibrationManagerPtr vibration_manager_; | 295 device::VibrationManagerPtr vibration_manager_; |
| 295 | 296 |
| 296 IDMap<PlatformEventObserverBase, IDMapOwnPointer> platform_event_observers_; | 297 IDMap<PlatformEventObserverBase, IDMapOwnPointer> platform_event_observers_; |
| 297 | 298 |
| 298 scheduler::RendererScheduler* renderer_scheduler_; // NOT OWNED | 299 scheduler::RendererScheduler* renderer_scheduler_; // NOT OWNED |
| 299 TopLevelBlameContext top_level_blame_context_; | 300 TopLevelBlameContext top_level_blame_context_; |
| 300 | 301 |
| 301 WebTrialTokenValidatorImpl trial_token_validator_; | 302 WebTrialTokenValidatorImpl trial_token_validator_; |
| 302 | 303 |
| 303 scoped_ptr<LocalStorageCachedAreas> local_storage_cached_areas_; | 304 std::unique_ptr<LocalStorageCachedAreas> local_storage_cached_areas_; |
| 304 | 305 |
| 305 scoped_ptr<BlinkServiceRegistryImpl> blink_service_registry_; | 306 std::unique_ptr<BlinkServiceRegistryImpl> blink_service_registry_; |
| 306 | 307 |
| 307 DISALLOW_COPY_AND_ASSIGN(RendererBlinkPlatformImpl); | 308 DISALLOW_COPY_AND_ASSIGN(RendererBlinkPlatformImpl); |
| 308 }; | 309 }; |
| 309 | 310 |
| 310 } // namespace content | 311 } // namespace content |
| 311 | 312 |
| 312 #endif // CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ | 313 #endif // CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ |
| OLD | NEW |