Index: third_party/WebKit/public/platform/WebWorkerFetchContext.h |
diff --git a/third_party/WebKit/public/platform/WebWorkerFetchContext.h b/third_party/WebKit/public/platform/WebWorkerFetchContext.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..56b117ec38cd0fea4281d6d324f31218ae69c59e |
--- /dev/null |
+++ b/third_party/WebKit/public/platform/WebWorkerFetchContext.h |
@@ -0,0 +1,34 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef WebWorkerFetchContext_h |
+#define WebWorkerFetchContext_h |
+ |
+namespace blink { |
+ |
+class WebURLLoader; |
+class WebURLRequest; |
+ |
+// WebWorkerFetchContext is crated from WebWorkerFetchContextInfo to create a |
+// new WebURLLoader instance in the worker thread. |
+class WebWorkerFetchContext { |
kinuko
2017/04/14 02:27:02
I wonder if this could be implemented using WebSer
kinuko
2017/04/14 05:38:12
This part could be probably cleaned up a bit but w
|
+ public: |
+ virtual ~WebWorkerFetchContext() {} |
+ |
+ // Returns a new WebURLLoader instance which is associated with the worker |
+ // thread. |
+ virtual WebURLLoader* CreateURLLoader() = 0; |
+ |
+ // Called when a request is about to be sent out to modify the request to |
+ // handle the rquest correctly in the loading stack later. (Example: service |
kinuko
2017/04/14 02:27:02
rquest -> request
horo
2017/04/14 07:22:45
Done.
|
+ // worker) |
+ virtual void WillSendRequest(WebURLRequest&) = 0; |
+ |
+ // Whether the fetch context is controlled by a service worker. |
+ virtual bool IsControlledByServiceWorker() const = 0; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // WebWorkerFetchContext_h |