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/browser/shared_worker/shared_worker_service_impl.h" | 5 #include "content/browser/shared_worker/shared_worker_service_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <iterator> | 10 #include <iterator> |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 blink::WebWorkerCreationError SharedWorkerServiceImpl::CreateWorker( | 328 blink::WebWorkerCreationError SharedWorkerServiceImpl::CreateWorker( |
329 const ViewHostMsg_CreateWorker_Params& params, | 329 const ViewHostMsg_CreateWorker_Params& params, |
330 int route_id, | 330 int route_id, |
331 SharedWorkerMessageFilter* filter, | 331 SharedWorkerMessageFilter* filter, |
332 ResourceContext* resource_context, | 332 ResourceContext* resource_context, |
333 const WorkerStoragePartitionId& partition_id) { | 333 const WorkerStoragePartitionId& partition_id) { |
334 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 334 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
335 std::unique_ptr<SharedWorkerInstance> instance(new SharedWorkerInstance( | 335 std::unique_ptr<SharedWorkerInstance> instance(new SharedWorkerInstance( |
336 params.url, params.name, params.content_security_policy, | 336 params.url, params.name, params.content_security_policy, |
337 params.security_policy_type, params.creation_address_space, | 337 params.security_policy_type, params.creation_address_space, |
338 resource_context, partition_id, params.creation_context_type)); | 338 resource_context, partition_id, params.creation_context_type, |
| 339 params.data_saver_enabled)); |
339 std::unique_ptr<SharedWorkerPendingInstance::SharedWorkerPendingRequest> | 340 std::unique_ptr<SharedWorkerPendingInstance::SharedWorkerPendingRequest> |
340 request(new SharedWorkerPendingInstance::SharedWorkerPendingRequest( | 341 request(new SharedWorkerPendingInstance::SharedWorkerPendingRequest( |
341 filter, route_id, params.document_id, filter->render_process_id(), | 342 filter, route_id, params.document_id, filter->render_process_id(), |
342 params.render_frame_route_id)); | 343 params.render_frame_route_id)); |
343 if (SharedWorkerPendingInstance* pending = FindPendingInstance(*instance)) { | 344 if (SharedWorkerPendingInstance* pending = FindPendingInstance(*instance)) { |
344 pending->AddRequest(std::move(request)); | 345 pending->AddRequest(std::move(request)); |
345 if (params.creation_context_type != | 346 if (params.creation_context_type != |
346 pending->instance()->creation_context_type()) | 347 pending->instance()->creation_context_type()) |
347 return blink::kWebWorkerCreationErrorSecureContextMismatch; | 348 return blink::kWebWorkerCreationErrorSecureContextMismatch; |
348 return blink::kWebWorkerCreationErrorNone; | 349 return blink::kWebWorkerCreationErrorNone; |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 UpdateWorkerDependencyFunc new_func) { | 693 UpdateWorkerDependencyFunc new_func) { |
693 update_worker_dependency_ = new_func; | 694 update_worker_dependency_ = new_func; |
694 } | 695 } |
695 | 696 |
696 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting( | 697 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting( |
697 bool (*new_func)(int)) { | 698 bool (*new_func)(int)) { |
698 s_try_increment_worker_ref_count_ = new_func; | 699 s_try_increment_worker_ref_count_ = new_func; |
699 } | 700 } |
700 | 701 |
701 } // namespace content | 702 } // namespace content |
OLD | NEW |