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" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "content/child/database_util.h" | 12 #include "content/child/database_util.h" |
13 #include "content/child/fileapi/webfilesystem_impl.h" | 13 #include "content/child/fileapi/webfilesystem_impl.h" |
14 #include "content/child/indexed_db/proxy_webidbfactory_impl.h" | 14 #include "content/child/indexed_db/proxy_webidbfactory_impl.h" |
15 #include "content/child/quota_dispatcher.h" | 15 #include "content/child/quota_dispatcher.h" |
16 #include "content/child/quota_message_filter.h" | 16 #include "content/child/quota_message_filter.h" |
17 #include "content/child/thread_safe_sender.h" | 17 #include "content/child/thread_safe_sender.h" |
18 #include "content/child/webblobregistry_impl.h" | 18 #include "content/child/webblobregistry_impl.h" |
19 #include "content/child/webmessageportchannel_impl.h" | 19 #include "content/child/webmessageportchannel_impl.h" |
| 20 #include "content/common/appcache_messages.h" |
20 #include "content/common/file_utilities_messages.h" | 21 #include "content/common/file_utilities_messages.h" |
21 #include "content/common/mime_registry_messages.h" | 22 #include "content/common/mime_registry_messages.h" |
22 #include "content/worker/worker_thread.h" | 23 #include "content/worker/worker_thread.h" |
23 #include "ipc/ipc_sync_message_filter.h" | 24 #include "ipc/ipc_sync_message_filter.h" |
24 #include "net/base/mime_util.h" | 25 #include "net/base/mime_util.h" |
25 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" | 26 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" |
26 #include "third_party/WebKit/public/platform/WebFileInfo.h" | 27 #include "third_party/WebKit/public/platform/WebFileInfo.h" |
27 #include "third_party/WebKit/public/platform/WebString.h" | 28 #include "third_party/WebKit/public/platform/WebString.h" |
28 #include "third_party/WebKit/public/platform/WebURL.h" | 29 #include "third_party/WebKit/public/platform/WebURL.h" |
| 30 #include "third_party/WebKit/public/web/WebController.h" |
29 #include "webkit/common/quota/quota_types.h" | 31 #include "webkit/common/quota/quota_types.h" |
30 #include "webkit/glue/webfileutilities_impl.h" | 32 #include "webkit/glue/webfileutilities_impl.h" |
31 #include "webkit/glue/webkit_glue.h" | 33 #include "webkit/glue/webkit_glue.h" |
32 | 34 |
33 using WebKit::Platform; | 35 using WebKit::Platform; |
34 using WebKit::WebBlobRegistry; | 36 using WebKit::WebBlobRegistry; |
35 using WebKit::WebClipboard; | 37 using WebKit::WebClipboard; |
36 using WebKit::WebFileInfo; | 38 using WebKit::WebFileInfo; |
37 using WebKit::WebFileSystem; | 39 using WebKit::WebFileSystem; |
38 using WebKit::WebFileUtilities; | 40 using WebKit::WebFileUtilities; |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 if (!thread_safe_sender_.get() || !quota_message_filter_.get()) | 296 if (!thread_safe_sender_.get() || !quota_message_filter_.get()) |
295 return; | 297 return; |
296 QuotaDispatcher::ThreadSpecificInstance( | 298 QuotaDispatcher::ThreadSpecificInstance( |
297 thread_safe_sender_.get(), | 299 thread_safe_sender_.get(), |
298 quota_message_filter_.get())->QueryStorageUsageAndQuota( | 300 quota_message_filter_.get())->QueryStorageUsageAndQuota( |
299 storage_partition, | 301 storage_partition, |
300 static_cast<quota::StorageType>(type), | 302 static_cast<quota::StorageType>(type), |
301 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 303 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
302 } | 304 } |
303 | 305 |
| 306 void WorkerWebKitPlatformSupportImpl::appcacheExeHandlerResponse( |
| 307 int requestId, |
| 308 WebKit::WebControllerResponse* webResponse) { |
| 309 if (!thread_safe_sender_.get()) |
| 310 return; |
| 311 |
| 312 appcache::AppCacheExecutableHandler::Response response; |
| 313 response.status_code = webResponse->statusCode; |
| 314 response.status_text = webResponse->statusText; |
| 315 response.blob_id = webResponse->blobId; |
| 316 response.use_default = webResponse->useDefault; // this means use the network |
| 317 DCHECK((response.status_code != 0) != response.use_default); // xor one or th
e other form of response |
| 318 for (std::vector<std::pair<WebString, WebString> >::const_iterator iter = webR
esponse->headers.begin(); |
| 319 iter != webResponse->headers.end(); ++iter) { |
| 320 response.headers[iter->first] = iter->second; |
| 321 } |
| 322 |
| 323 thread_safe_sender_->Send( |
| 324 new AppCacheHostMsg_ExeHandlerResponse(requestId, response)); |
| 325 } |
| 326 |
304 } // namespace content | 327 } // namespace content |
OLD | NEW |