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

Side by Side Diff: content/renderer/service_worker/worker_fetch_context_impl.cc

Issue 2881073003: Support DataSaver for SharedWorker (Closed)
Patch Set: fix #include "public/web/WebDataSaverFlag.h" Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/service_worker/worker_fetch_context_impl.h" 5 #include "content/renderer/service_worker/worker_fetch_context_impl.h"
6 6
7 #include "content/child/request_extra_data.h" 7 #include "content/child/request_extra_data.h"
8 #include "content/child/resource_dispatcher.h" 8 #include "content/child/resource_dispatcher.h"
9 #include "content/child/web_url_loader_impl.h" 9 #include "content/child/web_url_loader_impl.h"
10 #include "mojo/public/cpp/bindings/associated_binding.h" 10 #include "mojo/public/cpp/bindings/associated_binding.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 request.SetServiceWorkerMode( 51 request.SetServiceWorkerMode(
52 blink::WebURLRequest::ServiceWorkerMode::kForeign); 52 blink::WebURLRequest::ServiceWorkerMode::kForeign);
53 } 53 }
54 } 54 }
55 55
56 bool WorkerFetchContextImpl::IsControlledByServiceWorker() const { 56 bool WorkerFetchContextImpl::IsControlledByServiceWorker() const {
57 return is_controlled_by_service_worker_ || 57 return is_controlled_by_service_worker_ ||
58 (controller_version_id_ != kInvalidServiceWorkerVersionId); 58 (controller_version_id_ != kInvalidServiceWorkerVersionId);
59 } 59 }
60 60
61 void WorkerFetchContextImpl::SetDataSaverEnabled(bool enabled) { 61 void WorkerFetchContextImpl::SetDataSaverFlag(blink::WebDataSaverFlag flag) {
62 is_data_saver_enabled_ = enabled; 62 data_saver_flag_ = flag;
63 } 63 }
64 64
65 bool WorkerFetchContextImpl::IsDataSaverEnabled() const { 65 blink::WebDataSaverFlag WorkerFetchContextImpl::DataSaverFlag() const {
66 return is_data_saver_enabled_; 66 return data_saver_flag_;
67 } 67 }
68 68
69 void WorkerFetchContextImpl::set_service_worker_provider_id(int id) { 69 void WorkerFetchContextImpl::set_service_worker_provider_id(int id) {
70 service_worker_provider_id_ = id; 70 service_worker_provider_id_ = id;
71 } 71 }
72 72
73 void WorkerFetchContextImpl::set_is_controlled_by_service_worker(bool flag) { 73 void WorkerFetchContextImpl::set_is_controlled_by_service_worker(bool flag) {
74 is_controlled_by_service_worker_ = flag; 74 is_controlled_by_service_worker_ = flag;
75 } 75 }
76 76
77 void WorkerFetchContextImpl::SetControllerServiceWorker( 77 void WorkerFetchContextImpl::SetControllerServiceWorker(
78 int64_t controller_version_id) { 78 int64_t controller_version_id) {
79 controller_version_id_ = controller_version_id; 79 controller_version_id_ = controller_version_id;
80 } 80 }
81 81
82 } // namespace content 82 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698