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

Side by Side Diff: content/renderer/shared_worker/embedded_shared_worker_stub.cc

Issue 2714423002: Rename SkipServiceWorker to ServiceWorkerMode (Closed)
Patch Set: typos-- Created 3 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/shared_worker/embedded_shared_worker_stub.h" 5 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 ServiceWorkerNetworkProvider* provider = 89 ServiceWorkerNetworkProvider* provider =
90 GetNetworkProviderFromDataSource(data_source); 90 GetNetworkProviderFromDataSource(data_source);
91 std::unique_ptr<RequestExtraData> extra_data(new RequestExtraData); 91 std::unique_ptr<RequestExtraData> extra_data(new RequestExtraData);
92 extra_data->set_service_worker_provider_id(provider->provider_id()); 92 extra_data->set_service_worker_provider_id(provider->provider_id());
93 extra_data->set_initiated_in_secure_context( 93 extra_data->set_initiated_in_secure_context(
94 static_cast<DataSourceExtraData*>(data_source->getExtraData()) 94 static_cast<DataSourceExtraData*>(data_source->getExtraData())
95 ->is_secure_context); 95 ->is_secure_context);
96 request.setExtraData(extra_data.release()); 96 request.setExtraData(extra_data.release());
97 // If the provider does not have a controller at this point, the renderer 97 // If the provider does not have a controller at this point, the renderer
98 // expects subresource requests to never be handled by a controlling service 98 // expects subresource requests to never be handled by a controlling service
99 // worker, so set the SkipServiceWorker flag here. Otherwise, a service 99 // worker, so set the ServiceWorkerMode to skip local workers here.
100 // worker that is in the process of becoming the controller (i.e., via 100 // Otherwise, a service worker that is in the process of becoming the
101 // claim()) on the browser-side could handle the request and break the 101 // controller (i.e., via claim()) on the browser-side could handle the
102 // assumptions of the renderer. 102 // request and break the assumptions of the renderer.
103 if (request.getRequestContext() != 103 if (request.getRequestContext() !=
104 blink::WebURLRequest::RequestContextSharedWorker && 104 blink::WebURLRequest::RequestContextSharedWorker &&
105 !provider->IsControlledByServiceWorker() && 105 !provider->IsControlledByServiceWorker() &&
106 request.skipServiceWorker() != 106 request.getServiceWorkerMode() !=
107 blink::WebURLRequest::SkipServiceWorker::All) { 107 blink::WebURLRequest::ServiceWorkerMode::None) {
108 request.setSkipServiceWorker( 108 request.setServiceWorkerMode(
109 blink::WebURLRequest::SkipServiceWorker::Controlling); 109 blink::WebURLRequest::ServiceWorkerMode::Foreign);
110 } 110 }
111 } 111 }
112 112
113 bool isControlledByServiceWorker(blink::WebDataSource& data_source) override { 113 bool isControlledByServiceWorker(blink::WebDataSource& data_source) override {
114 ServiceWorkerNetworkProvider* provider = 114 ServiceWorkerNetworkProvider* provider =
115 GetNetworkProviderFromDataSource(&data_source); 115 GetNetworkProviderFromDataSource(&data_source);
116 return provider->IsControlledByServiceWorker(); 116 return provider->IsControlledByServiceWorker();
117 } 117 }
118 118
119 int64_t serviceWorkerID(blink::WebDataSource& data_source) override { 119 int64_t serviceWorkerID(blink::WebDataSource& data_source) override {
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 } 313 }
314 } 314 }
315 315
316 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { 316 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() {
317 // After this we wouldn't get any IPC for this stub. 317 // After this we wouldn't get any IPC for this stub.
318 running_ = false; 318 running_ = false;
319 impl_->terminateWorkerContext(); 319 impl_->terminateWorkerContext();
320 } 320 }
321 321
322 } // namespace content 322 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698