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/worker/worker_webkitplatformsupport_impl.h" | 5 #include "content/worker/worker_webkitplatformsupport_impl.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "ipc/ipc_sync_message_filter.h" | 23 #include "ipc/ipc_sync_message_filter.h" |
24 #include "net/base/mime_util.h" | 24 #include "net/base/mime_util.h" |
25 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" | 25 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" |
26 #include "third_party/WebKit/public/platform/WebFileInfo.h" | 26 #include "third_party/WebKit/public/platform/WebFileInfo.h" |
27 #include "third_party/WebKit/public/platform/WebString.h" | 27 #include "third_party/WebKit/public/platform/WebString.h" |
28 #include "third_party/WebKit/public/platform/WebURL.h" | 28 #include "third_party/WebKit/public/platform/WebURL.h" |
29 #include "webkit/common/quota/quota_types.h" | 29 #include "webkit/common/quota/quota_types.h" |
30 #include "webkit/glue/webfileutilities_impl.h" | 30 #include "webkit/glue/webfileutilities_impl.h" |
31 #include "webkit/glue/webkit_glue.h" | 31 #include "webkit/glue/webkit_glue.h" |
32 | 32 |
33 using WebKit::Platform; | 33 using blink::Platform; |
34 using WebKit::WebBlobRegistry; | 34 using blink::WebBlobRegistry; |
35 using WebKit::WebClipboard; | 35 using blink::WebClipboard; |
36 using WebKit::WebFileInfo; | 36 using blink::WebFileInfo; |
37 using WebKit::WebFileSystem; | 37 using blink::WebFileSystem; |
38 using WebKit::WebFileUtilities; | 38 using blink::WebFileUtilities; |
39 using WebKit::WebMessagePortChannel; | 39 using blink::WebMessagePortChannel; |
40 using WebKit::WebMimeRegistry; | 40 using blink::WebMimeRegistry; |
41 using WebKit::WebSandboxSupport; | 41 using blink::WebSandboxSupport; |
42 using WebKit::WebStorageNamespace; | 42 using blink::WebStorageNamespace; |
43 using WebKit::WebString; | 43 using blink::WebString; |
44 using WebKit::WebURL; | 44 using blink::WebURL; |
45 | 45 |
46 namespace content { | 46 namespace content { |
47 | 47 |
48 // TODO(kinuko): Probably this could be consolidated into | 48 // TODO(kinuko): Probably this could be consolidated into |
49 // RendererWebKitPlatformSupportImpl::FileUtilities. | 49 // RendererWebKitPlatformSupportImpl::FileUtilities. |
50 class WorkerWebKitPlatformSupportImpl::FileUtilities | 50 class WorkerWebKitPlatformSupportImpl::FileUtilities |
51 : public webkit_glue::WebFileUtilitiesImpl { | 51 : public webkit_glue::WebFileUtilitiesImpl { |
52 public: | 52 public: |
53 explicit FileUtilities(ThreadSafeSender* sender) | 53 explicit FileUtilities(ThreadSafeSender* sender) |
54 : thread_safe_sender_(sender) {} | 54 : thread_safe_sender_(sender) {} |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 WebStorageNamespace* | 163 WebStorageNamespace* |
164 WorkerWebKitPlatformSupportImpl::createLocalStorageNamespace() { | 164 WorkerWebKitPlatformSupportImpl::createLocalStorageNamespace() { |
165 NOTREACHED(); | 165 NOTREACHED(); |
166 return 0; | 166 return 0; |
167 } | 167 } |
168 | 168 |
169 void WorkerWebKitPlatformSupportImpl::dispatchStorageEvent( | 169 void WorkerWebKitPlatformSupportImpl::dispatchStorageEvent( |
170 const WebString& key, const WebString& old_value, | 170 const WebString& key, const WebString& old_value, |
171 const WebString& new_value, const WebString& origin, | 171 const WebString& new_value, const WebString& origin, |
172 const WebKit::WebURL& url, bool is_local_storage) { | 172 const blink::WebURL& url, bool is_local_storage) { |
173 NOTREACHED(); | 173 NOTREACHED(); |
174 } | 174 } |
175 | 175 |
176 Platform::FileHandle | 176 Platform::FileHandle |
177 WorkerWebKitPlatformSupportImpl::databaseOpenFile( | 177 WorkerWebKitPlatformSupportImpl::databaseOpenFile( |
178 const WebString& vfs_file_name, int desired_flags) { | 178 const WebString& vfs_file_name, int desired_flags) { |
179 return DatabaseUtil::DatabaseOpenFile( | 179 return DatabaseUtil::DatabaseOpenFile( |
180 vfs_file_name, desired_flags, sync_message_filter_.get()); | 180 vfs_file_name, desired_flags, sync_message_filter_.get()); |
181 } | 181 } |
182 | 182 |
(...skipping 14 matching lines...) Expand all Loading... |
197 return DatabaseUtil::DatabaseGetFileSize(vfs_file_name, | 197 return DatabaseUtil::DatabaseGetFileSize(vfs_file_name, |
198 sync_message_filter_.get()); | 198 sync_message_filter_.get()); |
199 } | 199 } |
200 | 200 |
201 long long WorkerWebKitPlatformSupportImpl::databaseGetSpaceAvailableForOrigin( | 201 long long WorkerWebKitPlatformSupportImpl::databaseGetSpaceAvailableForOrigin( |
202 const WebString& origin_identifier) { | 202 const WebString& origin_identifier) { |
203 return DatabaseUtil::DatabaseGetSpaceAvailable(origin_identifier, | 203 return DatabaseUtil::DatabaseGetSpaceAvailable(origin_identifier, |
204 sync_message_filter_.get()); | 204 sync_message_filter_.get()); |
205 } | 205 } |
206 | 206 |
207 WebKit::WebIDBFactory* WorkerWebKitPlatformSupportImpl::idbFactory() { | 207 blink::WebIDBFactory* WorkerWebKitPlatformSupportImpl::idbFactory() { |
208 if (!web_idb_factory_) | 208 if (!web_idb_factory_) |
209 web_idb_factory_.reset( | 209 web_idb_factory_.reset( |
210 new RendererWebIDBFactoryImpl(thread_safe_sender_.get())); | 210 new RendererWebIDBFactoryImpl(thread_safe_sender_.get())); |
211 return web_idb_factory_.get(); | 211 return web_idb_factory_.get(); |
212 } | 212 } |
213 | 213 |
214 WebMimeRegistry::SupportsType | 214 WebMimeRegistry::SupportsType |
215 WorkerWebKitPlatformSupportImpl::supportsMIMEType( | 215 WorkerWebKitPlatformSupportImpl::supportsMIMEType( |
216 const WebString&) { | 216 const WebString&) { |
217 return WebMimeRegistry::IsSupported; | 217 return WebMimeRegistry::IsSupported; |
(...skipping 13 matching lines...) Expand all Loading... |
231 } | 231 } |
232 | 232 |
233 WebMimeRegistry::SupportsType | 233 WebMimeRegistry::SupportsType |
234 WorkerWebKitPlatformSupportImpl::supportsMediaMIMEType( | 234 WorkerWebKitPlatformSupportImpl::supportsMediaMIMEType( |
235 const WebString&, const WebString&, const WebString&) { | 235 const WebString&, const WebString&, const WebString&) { |
236 NOTREACHED(); | 236 NOTREACHED(); |
237 return WebMimeRegistry::IsSupported; | 237 return WebMimeRegistry::IsSupported; |
238 } | 238 } |
239 | 239 |
240 bool WorkerWebKitPlatformSupportImpl::supportsMediaSourceMIMEType( | 240 bool WorkerWebKitPlatformSupportImpl::supportsMediaSourceMIMEType( |
241 const WebKit::WebString& mimeType, const WebKit::WebString& codecs) { | 241 const blink::WebString& mimeType, const blink::WebString& codecs) { |
242 NOTREACHED(); | 242 NOTREACHED(); |
243 return false; | 243 return false; |
244 } | 244 } |
245 | 245 |
246 WebMimeRegistry::SupportsType | 246 WebMimeRegistry::SupportsType |
247 WorkerWebKitPlatformSupportImpl::supportsNonImageMIMEType( | 247 WorkerWebKitPlatformSupportImpl::supportsNonImageMIMEType( |
248 const WebString&) { | 248 const WebString&) { |
249 NOTREACHED(); | 249 NOTREACHED(); |
250 return WebMimeRegistry::IsSupported; | 250 return WebMimeRegistry::IsSupported; |
251 } | 251 } |
(...skipping 22 matching lines...) Expand all Loading... |
274 base::FilePath::FromUTF16Unsafe(file_path), | 274 base::FilePath::FromUTF16Unsafe(file_path), |
275 &mime_type)); | 275 &mime_type)); |
276 return ASCIIToUTF16(mime_type); | 276 return ASCIIToUTF16(mime_type); |
277 } | 277 } |
278 | 278 |
279 WebBlobRegistry* WorkerWebKitPlatformSupportImpl::blobRegistry() { | 279 WebBlobRegistry* WorkerWebKitPlatformSupportImpl::blobRegistry() { |
280 return blob_registry_.get(); | 280 return blob_registry_.get(); |
281 } | 281 } |
282 | 282 |
283 void WorkerWebKitPlatformSupportImpl::queryStorageUsageAndQuota( | 283 void WorkerWebKitPlatformSupportImpl::queryStorageUsageAndQuota( |
284 const WebKit::WebURL& storage_partition, | 284 const blink::WebURL& storage_partition, |
285 WebKit::WebStorageQuotaType type, | 285 blink::WebStorageQuotaType type, |
286 WebKit::WebStorageQuotaCallbacks* callbacks) { | 286 blink::WebStorageQuotaCallbacks* callbacks) { |
287 if (!thread_safe_sender_.get() || !quota_message_filter_.get()) | 287 if (!thread_safe_sender_.get() || !quota_message_filter_.get()) |
288 return; | 288 return; |
289 QuotaDispatcher::ThreadSpecificInstance( | 289 QuotaDispatcher::ThreadSpecificInstance( |
290 thread_safe_sender_.get(), | 290 thread_safe_sender_.get(), |
291 quota_message_filter_.get())->QueryStorageUsageAndQuota( | 291 quota_message_filter_.get())->QueryStorageUsageAndQuota( |
292 storage_partition, | 292 storage_partition, |
293 static_cast<quota::StorageType>(type), | 293 static_cast<quota::StorageType>(type), |
294 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 294 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
295 } | 295 } |
296 | 296 |
297 } // namespace content | 297 } // namespace content |
OLD | NEW |