OLD | NEW |
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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 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. | 276 // worker, we need to check the all documents bounded by the shared worker. |
277 // (crbug.com/723553) | 277 // (crbug.com/723553) |
278 // https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-2.1.2 | 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_); | 279 worker_fetch_context->set_first_party_for_cookies(url_); |
| 280 // TODO(horo): Currently we treat the worker context as secure if the origin |
| 281 // of the shared worker script url is secure. But according to the spec, if |
| 282 // the creation context is not secure, we should treat the worker as |
| 283 // non-secure. crbug.com/723575 |
| 284 // https://w3c.github.io/webappsec-secure-contexts/#examples-shared-workers |
| 285 worker_fetch_context->set_is_secure_context(IsOriginSecure(url_)); |
280 if (web_network_provider) { | 286 if (web_network_provider) { |
281 ServiceWorkerNetworkProvider* network_provider = | 287 ServiceWorkerNetworkProvider* network_provider = |
282 ServiceWorkerNetworkProvider::FromWebServiceWorkerNetworkProvider( | 288 ServiceWorkerNetworkProvider::FromWebServiceWorkerNetworkProvider( |
283 web_network_provider); | 289 web_network_provider); |
284 worker_fetch_context->set_service_worker_provider_id( | 290 worker_fetch_context->set_service_worker_provider_id( |
285 network_provider->provider_id()); | 291 network_provider->provider_id()); |
286 worker_fetch_context->set_is_controlled_by_service_worker( | 292 worker_fetch_context->set_is_controlled_by_service_worker( |
287 network_provider->IsControlledByServiceWorker()); | 293 network_provider->IsControlledByServiceWorker()); |
288 } | 294 } |
289 return std::move(worker_fetch_context); | 295 return std::move(worker_fetch_context); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 } | 328 } |
323 } | 329 } |
324 | 330 |
325 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { | 331 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { |
326 // After this we wouldn't get any IPC for this stub. | 332 // After this we wouldn't get any IPC for this stub. |
327 running_ = false; | 333 running_ = false; |
328 impl_->TerminateWorkerContext(); | 334 impl_->TerminateWorkerContext(); |
329 } | 335 } |
330 | 336 |
331 } // namespace content | 337 } // namespace content |
OLD | NEW |