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

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: 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 // https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-2.1.2
falken 2017/05/17 08:55:31 This sounds serious. Shall we open a bug for this?
horo 2017/05/17 09:44:03 Filed crbug.com/723553
278 worker_fetch_context->set_first_party_for_cookies(url_);
275 if (web_network_provider) { 279 if (web_network_provider) {
276 ServiceWorkerNetworkProvider* network_provider = 280 ServiceWorkerNetworkProvider* network_provider =
277 ServiceWorkerNetworkProvider::FromWebServiceWorkerNetworkProvider( 281 ServiceWorkerNetworkProvider::FromWebServiceWorkerNetworkProvider(
278 web_network_provider); 282 web_network_provider);
279 worker_fetch_context->set_service_worker_provider_id( 283 worker_fetch_context->set_service_worker_provider_id(
280 network_provider->provider_id()); 284 network_provider->provider_id());
281 worker_fetch_context->set_is_controlled_by_service_worker( 285 worker_fetch_context->set_is_controlled_by_service_worker(
282 network_provider->IsControlledByServiceWorker()); 286 network_provider->IsControlledByServiceWorker());
283 } 287 }
284 return std::move(worker_fetch_context); 288 return std::move(worker_fetch_context);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 321 }
318 } 322 }
319 323
320 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { 324 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() {
321 // After this we wouldn't get any IPC for this stub. 325 // After this we wouldn't get any IPC for this stub.
322 running_ = false; 326 running_ = false;
323 impl_->TerminateWorkerContext(); 327 impl_->TerminateWorkerContext();
324 } 328 }
325 329
326 } // namespace content 330 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698