Index: webkit/browser/appcache/appcache_executable_handler.h |
diff --git a/webkit/browser/appcache/appcache_executable_handler.h b/webkit/browser/appcache/appcache_executable_handler.h |
index 43ee0a39e2d8291e06b0aa9c60b543b7e4c98d08..ff686f7c00bf7bd7872b144197100ad6215c6a3d 100644 |
--- a/webkit/browser/appcache/appcache_executable_handler.h |
+++ b/webkit/browser/appcache/appcache_executable_handler.h |
@@ -5,37 +5,36 @@ |
#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_EXECUTABLE_HANDLER_H_ |
#define WEBKIT_BROWSER_APPCACHE_APPCACHE_EXECUTABLE_HANDLER_H_ |
+#include <map> |
#include "base/callback.h" |
#include "base/memory/scoped_ptr.h" |
#include "url/gurl.h" |
#include "webkit/browser/webkit_storage_browser_export.h" |
+#include "webkit/common/appcache/appcache_interfaces.h" |
namespace net { |
class IOBuffer; |
class URLRequest; |
} |
+namespace fileapi { |
+class FileSystemContext; |
+} |
+namespace webkit_blob { |
+class BlobStorageController; |
+} |
namespace appcache { |
// An interface that must be provided by the embedder to support this feature. |
-class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheExecutableHandler { |
+class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheExecutableHandler : |
+ public AppCacheExecutableHandlerInterfaces { // so our request/response structs are on a common lib |
public: |
- // A handler can respond in one of 4 ways, if each of the GURL fields |
- // in 'Response' are empty and use_network is false, an error response is |
- // synthesized. |
- struct Response { |
- GURL cached_resource_url; |
- GURL redirect_url; |
- bool use_network; |
- // TODO: blob + headers would be a good one to provide as well, as it would |
- // make templating possible. |
- }; |
typedef base::Callback<void(const Response&)> ResponseCallback; |
// Deletion of the handler cancels all pending callbacks. |
virtual ~AppCacheExecutableHandler() {} |
- virtual void HandleRequest(net::URLRequest* req, |
+ virtual void HandleRequest(const Request& request, |
ResponseCallback callback) = 0; |
}; |
@@ -43,7 +42,14 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheExecutableHandler { |
class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheExecutableHandlerFactory { |
public: |
virtual scoped_ptr<AppCacheExecutableHandler> CreateHandler( |
- const GURL& handler_url, net::IOBuffer* handler_source) = 0; |
+ int64 appcache_id, |
+ const GURL& handler_url, |
+ const std::string& raw_handler_source) = 0; |
+ |
+ // In order to return Blob responses, access to the blob and fileapi |
+ // contexts are needed. |
+ virtual webkit_blob::BlobStorageController* GetBlobStorageController() = 0; |
+ virtual fileapi::FileSystemContext* GetFileSystemContext() = 0; |
protected: |
virtual ~AppCacheExecutableHandlerFactory() {} |