| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shared_worker_repository.h" | 5 #include "content/renderer/shared_worker/shared_worker_repository.h" |
| 6 | 6 |
| 7 #include "content/common/view_messages.h" | 7 #include "content/common/view_messages.h" |
| 8 #include "content/renderer/render_frame_impl.h" | 8 #include "content/renderer/render_frame_impl.h" |
| 9 #include "content/renderer/shared_worker/websharedworker_proxy.h" | 9 #include "content/renderer/shared_worker/websharedworker_proxy.h" |
| 10 #include "third_party/WebKit/public/web/WebSharedWorkerConnectListener.h" | 10 #include "third_party/WebKit/public/web/WebSharedWorkerConnectListener.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 params.url = url; | 32 params.url = url; |
| 33 params.name = name.utf16(); | 33 params.name = name.utf16(); |
| 34 params.content_security_policy = content_security_policy.utf16(); | 34 params.content_security_policy = content_security_policy.utf16(); |
| 35 params.security_policy_type = security_policy_type; | 35 params.security_policy_type = security_policy_type; |
| 36 params.document_id = document_id; | 36 params.document_id = document_id; |
| 37 params.render_frame_route_id = render_frame_->GetRoutingID(); | 37 params.render_frame_route_id = render_frame_->GetRoutingID(); |
| 38 params.creation_address_space = creation_address_space; | 38 params.creation_address_space = creation_address_space; |
| 39 params.creation_context_type = creation_context_type; | 39 params.creation_context_type = creation_context_type; |
| 40 ViewHostMsg_CreateWorker_Reply reply; | 40 ViewHostMsg_CreateWorker_Reply reply; |
| 41 | 41 |
| 42 // This proxy will self-destruct when a connection is established. | 42 // This proxy will self-destruct when a worker is destroyed. |
| 43 new WebSharedWorkerProxy(std::move(listener), params, channel); | 43 new WebSharedWorkerProxy(std::move(listener), params, channel); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void SharedWorkerRepository::documentDetached(DocumentID document) { | 46 void SharedWorkerRepository::documentDetached(DocumentID document) { |
| 47 std::set<DocumentID>::iterator iter = documents_with_workers_.find(document); | 47 std::set<DocumentID>::iterator iter = documents_with_workers_.find(document); |
| 48 if (iter != documents_with_workers_.end()) { | 48 if (iter != documents_with_workers_.end()) { |
| 49 // Notify the browser process that the document has shut down. | 49 // Notify the browser process that the document has shut down. |
| 50 render_frame_->Send(new ViewHostMsg_DocumentDetached(document)); | 50 render_frame_->Send(new ViewHostMsg_DocumentDetached(document)); |
| 51 documents_with_workers_.erase(iter); | 51 documents_with_workers_.erase(iter); |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 | 54 |
| 55 } // namespace content | 55 } // namespace content |
| OLD | NEW |