| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 void SharedWorkerServiceImpl::RemoveObserver(WorkerServiceObserver* observer) { | 275 void SharedWorkerServiceImpl::RemoveObserver(WorkerServiceObserver* observer) { |
| 276 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 276 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 277 observers_.RemoveObserver(observer); | 277 observers_.RemoveObserver(observer); |
| 278 } | 278 } |
| 279 | 279 |
| 280 void SharedWorkerServiceImpl::CreateWorker( | 280 void SharedWorkerServiceImpl::CreateWorker( |
| 281 const ViewHostMsg_CreateWorker_Params& params, | 281 const ViewHostMsg_CreateWorker_Params& params, |
| 282 int route_id, | 282 int route_id, |
| 283 SharedWorkerMessageFilter* filter, | 283 SharedWorkerMessageFilter* filter, |
| 284 ResourceContext* resource_context, | 284 ResourceContext* resource_context, |
| 285 const WorkerStoragePartition& partition, | 285 const WorkerStoragePartitionId& partition_id, |
| 286 bool* url_mismatch) { | 286 bool* url_mismatch) { |
| 287 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 287 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 288 *url_mismatch = false; | 288 *url_mismatch = false; |
| 289 scoped_ptr<SharedWorkerInstance> instance( | 289 scoped_ptr<SharedWorkerInstance> instance( |
| 290 new SharedWorkerInstance(params.url, | 290 new SharedWorkerInstance(params.url, |
| 291 params.name, | 291 params.name, |
| 292 params.content_security_policy, | 292 params.content_security_policy, |
| 293 params.security_policy_type, | 293 params.security_policy_type, |
| 294 resource_context, | 294 resource_context, |
| 295 partition)); | 295 partition_id)); |
| 296 scoped_ptr<SharedWorkerPendingInstance::SharedWorkerPendingRequest> request( | 296 scoped_ptr<SharedWorkerPendingInstance::SharedWorkerPendingRequest> request( |
| 297 new SharedWorkerPendingInstance::SharedWorkerPendingRequest( | 297 new SharedWorkerPendingInstance::SharedWorkerPendingRequest( |
| 298 filter, | 298 filter, |
| 299 route_id, | 299 route_id, |
| 300 params.document_id, | 300 params.document_id, |
| 301 filter->render_process_id(), | 301 filter->render_process_id(), |
| 302 params.render_frame_route_id)); | 302 params.render_frame_route_id)); |
| 303 if (SharedWorkerPendingInstance* pending = FindPendingInstance(*instance)) { | 303 if (SharedWorkerPendingInstance* pending = FindPendingInstance(*instance)) { |
| 304 if (params.url != pending->instance()->url()) { | 304 if (params.url != pending->instance()->url()) { |
| 305 *url_mismatch = true; | 305 *url_mismatch = true; |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 UpdateWorkerDependencyFunc new_func) { | 654 UpdateWorkerDependencyFunc new_func) { |
| 655 update_worker_dependency_ = new_func; | 655 update_worker_dependency_ = new_func; |
| 656 } | 656 } |
| 657 | 657 |
| 658 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting( | 658 void SharedWorkerServiceImpl::ChangeTryIncrementWorkerRefCountFuncForTesting( |
| 659 bool (*new_func)(int)) { | 659 bool (*new_func)(int)) { |
| 660 s_try_increment_worker_ref_count_ = new_func; | 660 s_try_increment_worker_ref_count_ = new_func; |
| 661 } | 661 } |
| 662 | 662 |
| 663 } // namespace content | 663 } // namespace content |
| OLD | NEW |