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/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "content/renderer/renderer_clipboard_client.h" | 32 #include "content/renderer/renderer_clipboard_client.h" |
33 #include "content/renderer/websharedworkerrepository_impl.h" | 33 #include "content/renderer/websharedworkerrepository_impl.h" |
34 #include "googleurl/src/gurl.h" | 34 #include "googleurl/src/gurl.h" |
35 #include "ipc/ipc_sync_message_filter.h" | 35 #include "ipc/ipc_sync_message_filter.h" |
36 #include "media/audio/audio_output_device.h" | 36 #include "media/audio/audio_output_device.h" |
37 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegis
try.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegis
try.h" |
38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h" |
39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
40 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads.
h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads.
h" |
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" |
| 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" |
| 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" |
42 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre
amCenter.h" | 44 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre
amCenter.h" |
43 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre
amCenterClient.h" | 45 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre
amCenterClient.h" |
44 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandler.h" | 46 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandler.h" |
45 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandlerClient.h" | 47 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandlerClient.h" |
46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 48 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
| 49 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize
dScriptValue.h" |
47 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 50 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
48 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 51 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
49 #include "webkit/glue/simple_webmimeregistry_impl.h" | 52 #include "webkit/glue/simple_webmimeregistry_impl.h" |
50 #include "webkit/glue/webclipboard_impl.h" | 53 #include "webkit/glue/webclipboard_impl.h" |
51 #include "webkit/glue/webfileutilities_impl.h" | 54 #include "webkit/glue/webfileutilities_impl.h" |
52 #include "webkit/glue/webkit_glue.h" | 55 #include "webkit/glue/webkit_glue.h" |
53 | 56 |
54 #if defined(OS_WIN) | 57 #if defined(OS_WIN) |
55 #include "content/common/child_process_messages.h" | 58 #include "content/common/child_process_messages.h" |
56 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/win/WebSandb
oxSupport.h" | 59 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/win/WebSandb
oxSupport.h" |
(...skipping 20 matching lines...) Expand all Loading... |
77 #endif | 80 #endif |
78 | 81 |
79 using content::RenderThread; | 82 using content::RenderThread; |
80 using WebKit::WebAudioDevice; | 83 using WebKit::WebAudioDevice; |
81 using WebKit::WebBlobRegistry; | 84 using WebKit::WebBlobRegistry; |
82 using WebKit::WebFileInfo; | 85 using WebKit::WebFileInfo; |
83 using WebKit::WebFileSystem; | 86 using WebKit::WebFileSystem; |
84 using WebKit::WebFrame; | 87 using WebKit::WebFrame; |
85 using WebKit::WebGamepads; | 88 using WebKit::WebGamepads; |
86 using WebKit::WebIDBFactory; | 89 using WebKit::WebIDBFactory; |
| 90 using WebKit::WebIDBKey; |
| 91 using WebKit::WebIDBKeyPath; |
87 using WebKit::WebKitPlatformSupport; | 92 using WebKit::WebKitPlatformSupport; |
88 using WebKit::WebMediaStreamCenter; | 93 using WebKit::WebMediaStreamCenter; |
89 using WebKit::WebMediaStreamCenterClient; | 94 using WebKit::WebMediaStreamCenterClient; |
90 using WebKit::WebPeerConnection00Handler; | 95 using WebKit::WebPeerConnection00Handler; |
91 using WebKit::WebPeerConnection00HandlerClient; | 96 using WebKit::WebPeerConnection00HandlerClient; |
92 using WebKit::WebPeerConnectionHandler; | 97 using WebKit::WebPeerConnectionHandler; |
93 using WebKit::WebPeerConnectionHandlerClient; | 98 using WebKit::WebPeerConnectionHandlerClient; |
| 99 using WebKit::WebSerializedScriptValue; |
94 using WebKit::WebStorageNamespace; | 100 using WebKit::WebStorageNamespace; |
95 using WebKit::WebString; | 101 using WebKit::WebString; |
96 using WebKit::WebURL; | 102 using WebKit::WebURL; |
97 using WebKit::WebVector; | 103 using WebKit::WebVector; |
98 | 104 |
99 static bool g_sandbox_enabled = true; | 105 static bool g_sandbox_enabled = true; |
100 | 106 |
101 //------------------------------------------------------------------------------ | 107 //------------------------------------------------------------------------------ |
102 | 108 |
103 class RendererWebKitPlatformSupportImpl::MimeRegistry | 109 class RendererWebKitPlatformSupportImpl::MimeRegistry |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 WebIDBFactory* RendererWebKitPlatformSupportImpl::idbFactory() { | 338 WebIDBFactory* RendererWebKitPlatformSupportImpl::idbFactory() { |
333 if (!web_idb_factory_.get()) { | 339 if (!web_idb_factory_.get()) { |
334 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) | 340 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) |
335 web_idb_factory_.reset(WebIDBFactory::create()); | 341 web_idb_factory_.reset(WebIDBFactory::create()); |
336 else | 342 else |
337 web_idb_factory_.reset(new RendererWebIDBFactoryImpl()); | 343 web_idb_factory_.reset(new RendererWebIDBFactoryImpl()); |
338 } | 344 } |
339 return web_idb_factory_.get(); | 345 return web_idb_factory_.get(); |
340 } | 346 } |
341 | 347 |
| 348 void RendererWebKitPlatformSupportImpl::createIDBKeysFromSerializedValuesAndKeyP
ath( |
| 349 const WebVector<WebSerializedScriptValue>& values, |
| 350 const WebIDBKeyPath& keyPath, |
| 351 WebVector<WebIDBKey>& keys_out) { |
| 352 DCHECK(CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)); |
| 353 WebVector<WebIDBKey> keys(values.size()); |
| 354 for (size_t i = 0; i < values.size(); ++i) { |
| 355 keys[i] = WebIDBKey::createFromValueAndKeyPath( |
| 356 values[i], keyPath); |
| 357 } |
| 358 keys_out.swap(keys); |
| 359 } |
| 360 |
| 361 WebSerializedScriptValue |
| 362 RendererWebKitPlatformSupportImpl::injectIDBKeyIntoSerializedValue( |
| 363 const WebIDBKey& key, |
| 364 const WebSerializedScriptValue& value, |
| 365 const WebIDBKeyPath& keyPath) { |
| 366 DCHECK(CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)); |
| 367 return WebIDBKey::injectIDBKeyIntoSerializedValue( |
| 368 key, value, keyPath); |
| 369 } |
| 370 |
342 //------------------------------------------------------------------------------ | 371 //------------------------------------------------------------------------------ |
343 | 372 |
344 WebFileSystem* RendererWebKitPlatformSupportImpl::fileSystem() { | 373 WebFileSystem* RendererWebKitPlatformSupportImpl::fileSystem() { |
345 if (!web_file_system_.get()) | 374 if (!web_file_system_.get()) |
346 web_file_system_.reset(new WebFileSystemImpl()); | 375 web_file_system_.reset(new WebFileSystemImpl()); |
347 return web_file_system_.get(); | 376 return web_file_system_.get(); |
348 } | 377 } |
349 | 378 |
350 //------------------------------------------------------------------------------ | 379 //------------------------------------------------------------------------------ |
351 | 380 |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 bool enable) { | 730 bool enable) { |
702 bool was_enabled = g_sandbox_enabled; | 731 bool was_enabled = g_sandbox_enabled; |
703 g_sandbox_enabled = enable; | 732 g_sandbox_enabled = enable; |
704 return was_enabled; | 733 return was_enabled; |
705 } | 734 } |
706 | 735 |
707 GpuChannelHostFactory* | 736 GpuChannelHostFactory* |
708 RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { | 737 RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { |
709 return RenderThreadImpl::current(); | 738 return RenderThreadImpl::current(); |
710 } | 739 } |
OLD | NEW |