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

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

Issue 2891453005: Pipe the FirstPartyForCookies to WorkerFetchContext for off-main-thread-fetch (Closed)
Patch Set: rebase 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 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/feature_list.h" 10 #include "base/feature_list.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 blink::WebServiceWorkerNetworkProvider* web_network_provider) { 265 blink::WebServiceWorkerNetworkProvider* web_network_provider) {
266 DCHECK(base::FeatureList::IsEnabled(features::kOffMainThreadFetch)); 266 DCHECK(base::FeatureList::IsEnabled(features::kOffMainThreadFetch));
267 mojom::WorkerURLLoaderFactoryProviderPtr worker_url_loader_factory_provider; 267 mojom::WorkerURLLoaderFactoryProviderPtr worker_url_loader_factory_provider;
268 RenderThreadImpl::current() 268 RenderThreadImpl::current()
269 ->blink_platform_impl() 269 ->blink_platform_impl()
270 ->GetInterfaceProvider() 270 ->GetInterfaceProvider()
271 ->GetInterface(mojo::MakeRequest(&worker_url_loader_factory_provider)); 271 ->GetInterface(mojo::MakeRequest(&worker_url_loader_factory_provider));
272 std::unique_ptr<WorkerFetchContextImpl> worker_fetch_context = 272 std::unique_ptr<WorkerFetchContextImpl> worker_fetch_context =
273 base::MakeUnique<WorkerFetchContextImpl>( 273 base::MakeUnique<WorkerFetchContextImpl>(
274 worker_url_loader_factory_provider.PassInterface()); 274 worker_url_loader_factory_provider.PassInterface());
275 // TODO(horo): To get the correct first_party_to_cookies for the shared
276 // worker, we need to check the all documents bounded by the shared worker.
277 // (crbug.com/723553)
278 // https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-2.1.2
279 worker_fetch_context->set_first_party_for_cookies(url_);
275 if (web_network_provider) { 280 if (web_network_provider) {
276 ServiceWorkerNetworkProvider* network_provider = 281 ServiceWorkerNetworkProvider* network_provider =
277 ServiceWorkerNetworkProvider::FromWebServiceWorkerNetworkProvider( 282 ServiceWorkerNetworkProvider::FromWebServiceWorkerNetworkProvider(
278 web_network_provider); 283 web_network_provider);
279 worker_fetch_context->set_service_worker_provider_id( 284 worker_fetch_context->set_service_worker_provider_id(
280 network_provider->provider_id()); 285 network_provider->provider_id());
281 worker_fetch_context->set_is_controlled_by_service_worker( 286 worker_fetch_context->set_is_controlled_by_service_worker(
282 network_provider->IsControlledByServiceWorker()); 287 network_provider->IsControlledByServiceWorker());
283 } 288 }
284 return std::move(worker_fetch_context); 289 return std::move(worker_fetch_context);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 322 }
318 } 323 }
319 324
320 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { 325 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() {
321 // After this we wouldn't get any IPC for this stub. 326 // After this we wouldn't get any IPC for this stub.
322 running_ = false; 327 running_ = false;
323 impl_->TerminateWorkerContext(); 328 impl_->TerminateWorkerContext();
324 } 329 }
325 330
326 } // namespace content 331 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698