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/platform_file.h" | 10 #include "base/platform_file.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "content/renderer/media/audio_device.h" | 27 #include "content/renderer/media/audio_device.h" |
28 #include "content/renderer/media/audio_hardware.h" | 28 #include "content/renderer/media/audio_hardware.h" |
29 #include "content/renderer/media/renderer_webaudiodevice_impl.h" | 29 #include "content/renderer/media/renderer_webaudiodevice_impl.h" |
30 #include "content/renderer/render_thread_impl.h" | 30 #include "content/renderer/render_thread_impl.h" |
31 #include "content/renderer/render_view_impl.h" | 31 #include "content/renderer/render_view_impl.h" |
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 "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegis
try.h" | 36 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobRegis
try.h" |
| 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileInfo.h" |
37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
38 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads.
h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGamepads.
h" |
39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" |
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" |
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" |
42 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre
amCenter.h" | 43 #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" | 44 #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" | 45 #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" | 46 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandlerClient.h" |
46 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 47 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
(...skipping 25 matching lines...) Expand all Loading... |
72 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/linux/WebFon
tFamily.h" | 73 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/linux/WebFon
tFamily.h" |
73 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/linux/WebSan
dboxSupport.h" | 74 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/linux/WebSan
dboxSupport.h" |
74 #endif | 75 #endif |
75 | 76 |
76 #if defined(OS_POSIX) | 77 #if defined(OS_POSIX) |
77 #include "base/file_descriptor_posix.h" | 78 #include "base/file_descriptor_posix.h" |
78 #endif | 79 #endif |
79 | 80 |
80 using WebKit::WebAudioDevice; | 81 using WebKit::WebAudioDevice; |
81 using WebKit::WebBlobRegistry; | 82 using WebKit::WebBlobRegistry; |
| 83 using WebKit::WebFileInfo; |
82 using WebKit::WebFileSystem; | 84 using WebKit::WebFileSystem; |
83 using WebKit::WebFrame; | 85 using WebKit::WebFrame; |
84 using WebKit::WebGamepads; | 86 using WebKit::WebGamepads; |
85 using WebKit::WebIDBFactory; | 87 using WebKit::WebIDBFactory; |
86 using WebKit::WebIDBKey; | 88 using WebKit::WebIDBKey; |
87 using WebKit::WebIDBKeyPath; | 89 using WebKit::WebIDBKeyPath; |
88 using WebKit::WebKitPlatformSupport; | 90 using WebKit::WebKitPlatformSupport; |
89 using WebKit::WebMediaStreamCenter; | 91 using WebKit::WebMediaStreamCenter; |
90 using WebKit::WebMediaStreamCenterClient; | 92 using WebKit::WebMediaStreamCenterClient; |
91 using WebKit::WebPeerConnection00Handler; | 93 using WebKit::WebPeerConnection00Handler; |
(...skipping 16 matching lines...) Expand all Loading... |
108 virtual WebKit::WebString preferredExtensionForMIMEType( | 110 virtual WebKit::WebString preferredExtensionForMIMEType( |
109 const WebKit::WebString&); | 111 const WebKit::WebString&); |
110 }; | 112 }; |
111 | 113 |
112 class RendererWebKitPlatformSupportImpl::FileUtilities | 114 class RendererWebKitPlatformSupportImpl::FileUtilities |
113 : public webkit_glue::WebFileUtilitiesImpl { | 115 : public webkit_glue::WebFileUtilitiesImpl { |
114 public: | 116 public: |
115 virtual bool getFileSize(const WebKit::WebString& path, long long& result); | 117 virtual bool getFileSize(const WebKit::WebString& path, long long& result); |
116 virtual bool getFileModificationTime(const WebKit::WebString& path, | 118 virtual bool getFileModificationTime(const WebKit::WebString& path, |
117 double& result); | 119 double& result); |
| 120 virtual bool getFileInfo(const WebString& path, WebFileInfo& result); |
118 virtual base::PlatformFile openFile(const WebKit::WebString& path, | 121 virtual base::PlatformFile openFile(const WebKit::WebString& path, |
119 int mode); | 122 int mode); |
120 }; | 123 }; |
121 | 124 |
122 #if defined(OS_ANDROID) | 125 #if defined(OS_ANDROID) |
123 // WebKit doesn't use WebSandboxSupport on android so we don't need to | 126 // WebKit doesn't use WebSandboxSupport on android so we don't need to |
124 // implement anything here. | 127 // implement anything here. |
125 class RendererWebKitPlatformSupportImpl::SandboxSupport { | 128 class RendererWebKitPlatformSupportImpl::SandboxSupport { |
126 }; | 129 }; |
127 #else | 130 #else |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 if (SendSyncMessageFromAnyThread(new FileUtilitiesMsg_GetFileModificationTime( | 428 if (SendSyncMessageFromAnyThread(new FileUtilitiesMsg_GetFileModificationTime( |
426 webkit_glue::WebStringToFilePath(path), &time))) { | 429 webkit_glue::WebStringToFilePath(path), &time))) { |
427 result = time.ToDoubleT(); | 430 result = time.ToDoubleT(); |
428 return !time.is_null(); | 431 return !time.is_null(); |
429 } | 432 } |
430 | 433 |
431 result = 0; | 434 result = 0; |
432 return false; | 435 return false; |
433 } | 436 } |
434 | 437 |
| 438 bool RendererWebKitPlatformSupportImpl::FileUtilities::getFileInfo( |
| 439 const WebString& path, |
| 440 WebFileInfo& web_file_info) { |
| 441 base::PlatformFileInfo file_info; |
| 442 base::PlatformFileError status; |
| 443 if (!SendSyncMessageFromAnyThread(new FileUtilitiesMsg_GetFileInfo( |
| 444 webkit_glue::WebStringToFilePath(path), &file_info, &status)) || |
| 445 status != base::PLATFORM_FILE_OK) { |
| 446 return false; |
| 447 } |
| 448 webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info); |
| 449 web_file_info.platformPath = path; |
| 450 return true; |
| 451 } |
| 452 |
435 base::PlatformFile RendererWebKitPlatformSupportImpl::FileUtilities::openFile( | 453 base::PlatformFile RendererWebKitPlatformSupportImpl::FileUtilities::openFile( |
436 const WebString& path, | 454 const WebString& path, |
437 int mode) { | 455 int mode) { |
438 IPC::PlatformFileForTransit handle = IPC::InvalidPlatformFileForTransit(); | 456 IPC::PlatformFileForTransit handle = IPC::InvalidPlatformFileForTransit(); |
439 SendSyncMessageFromAnyThread(new FileUtilitiesMsg_OpenFile( | 457 SendSyncMessageFromAnyThread(new FileUtilitiesMsg_OpenFile( |
440 webkit_glue::WebStringToFilePath(path), mode, &handle)); | 458 webkit_glue::WebStringToFilePath(path), mode, &handle)); |
441 return IPC::PlatformFileForTransitToPlatformFile(handle); | 459 return IPC::PlatformFileForTransitToPlatformFile(handle); |
442 } | 460 } |
443 | 461 |
444 //------------------------------------------------------------------------------ | 462 //------------------------------------------------------------------------------ |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 DCHECK(render_thread); | 733 DCHECK(render_thread); |
716 if (!render_thread) | 734 if (!render_thread) |
717 return NULL; | 735 return NULL; |
718 return render_thread->CreateMediaStreamCenter(client); | 736 return render_thread->CreateMediaStreamCenter(client); |
719 } | 737 } |
720 | 738 |
721 GpuChannelHostFactory* | 739 GpuChannelHostFactory* |
722 RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { | 740 RendererWebKitPlatformSupportImpl::GetGpuChannelHostFactory() { |
723 return RenderThreadImpl::current(); | 741 return RenderThreadImpl::current(); |
724 } | 742 } |
OLD | NEW |