Index: public/web/WebServiceWorkerContextClient.h |
diff --git a/public/web/WebServiceWorkerContextClient.h b/public/web/WebServiceWorkerContextClient.h |
index d0c87b41664bb2668748feb73ccfd059e84e5c05..4a2fb680c3fd9d3149fcf79faf02d6290abe1d89 100644 |
--- a/public/web/WebServiceWorkerContextClient.h |
+++ b/public/web/WebServiceWorkerContextClient.h |
@@ -35,14 +35,31 @@ |
namespace blink { |
+class WebDataSource; |
class WebString; |
class WebServiceWorkerContextProxy; |
class WebServiceWorkerResponse; |
+class WebURLRequest; |
+class WebURLResponse; |
+ |
+// This interface is implemented by the client and is only called on the main thread. |
+// FIXME: put this in a seperate .h |
michaeln
2014/03/14 01:01:02
should be in another file, if we like this change
kinuko
2014/03/14 11:47:17
Yes I think this change makes sense
|
+class WebServiceWorkerNetworkProvider { |
+public: |
+ virtual ~WebServiceWorkerNetworkProvider() { } |
+ |
+ // A request is about to be sent out, and the client may modify it. Request |
+ // is writable, and changes to the URL, for example, will change the request |
+ // made. If this request is the result of a redirect, then redirectResponse |
+ // will be non-null and contain the response that triggered the redirect. |
kinuko
2014/03/14 11:47:17
Is this comment from WebFrameClient? May give impr
michaeln
2014/03/15 01:22:39
Done, removed the redirectResponse param and fixed
|
+ virtual void willSendRequest(blink::WebDataSource*, blink::WebURLRequest&, const blink::WebURLResponse& redirectResponse) { } |
+}; |
// This interface is implemented by the client. It is suppoed to be created |
// on the main thread and then passed on to the worker thread to be owned |
// by a newly created WorkerGlobalScope. All methods of this class, except |
-// for workerContextFailedToStart(), are called on the worker thread. |
+// for createServiceWorkerNetworkProvider() and workerContextFailedToStart(), |
+// are called on the worker thread. |
// FIXME: Split this into EmbeddedWorkerContextClient and |
// ServiceWorkerScriptContextClient when we decide to use EmbeddedWorker |
// framework for other implementation (like SharedWorker). |
@@ -84,6 +101,9 @@ public: |
// should fallback to native fetch. |
virtual void didHandleFetchEvent(int fetchEventID) { } |
virtual void didHandleFetchEvent(int fetchEventID, const WebServiceWorkerResponse& response) { } |
+ |
+ // Ownership of the returned object is transferred to the caller. |
+ virtual WebServiceWorkerNetworkProvider* createServiceWorkerNetworkProvider(blink::WebDataSource*) { return 0; } |
}; |
} // namespace blink |