Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(901)

Unified Diff: third_party/WebKit/public/platform/WebWorkerFetchContext.h

Issue 2804843005: Implement the infrastructure of creating WorkerFetchContext in worker global scope. (Closed)
Patch Set: incorporated nhiroki and kinuko's comment Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..22f4f04bb66d99741c8579a8828ce9a2ddeb32e7
--- /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 {
+ 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 request correctly in the loading stack later. (Example: service
+ // 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

Powered by Google App Engine
This is Rietveld 408576698