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

Unified Diff: content/renderer/service_worker/service_worker_fetch_context_impl.h

Issue 2816403002: test all
Patch Set: fix sharedworker 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: content/renderer/service_worker/service_worker_fetch_context_impl.h
diff --git a/content/renderer/service_worker/service_worker_fetch_context_impl.h b/content/renderer/service_worker/service_worker_fetch_context_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..21deeac459b746d9449ee86b3a583245c8a6d53d
--- /dev/null
+++ b/content/renderer/service_worker/service_worker_fetch_context_impl.h
@@ -0,0 +1,45 @@
+// 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 CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_FETCH_CONTEXT_IMPL_H_
+#define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_FETCH_CONTEXT_IMPL_H_
+
+#include "content/common/worker_url_loader_factory_provider.mojom.h"
+#include "third_party/WebKit/public/platform/WebWorkerFetchContext.h"
+
+namespace base {
+class SingleThreadTaskRunner;
+} // namespace base
+
+namespace content {
+class ResourceDispatcher;
+
+class ServiceWorkerFetchContextImpl : public blink::WebWorkerFetchContext {
+ public:
+ ServiceWorkerFetchContextImpl(
+ mojom::WorkerURLLoaderFactoryProviderPtrInfo provider_info,
+ int service_worker_provider_id);
+ ~ServiceWorkerFetchContextImpl() override;
+
+ // blink::WebWorkerFetchContext implementation:
+ void InitializeOnWorkerThread(base::SingleThreadTaskRunner*) override;
+ blink::WebURLLoader* CreateURLLoader() override;
+ void WillSendRequest(blink::WebURLRequest&) override;
+ bool IsControlledByServiceWorker() const override;
+ void SetDataSaverEnabled(bool flag) override;
+
+ private:
+ mojom::WorkerURLLoaderFactoryProviderPtrInfo provider_info_;
+ const int service_worker_provider_id_;
+ bool data_saver_enabled_ = false;
+
+ // Initialized on the worker thread when InitializeOnWorkerThread() is called.
+ std::unique_ptr<ResourceDispatcher> resource_dispatcher_;
+ mojom::WorkerURLLoaderFactoryProviderPtr provider_;
+ mojom::URLLoaderFactoryAssociatedPtr url_loader_factory_;
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_FETCH_CONTEXT_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698