OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 | 4 |
5 #include "content/renderer/websharedworkerrepository_impl.h" | 5 #include "content/renderer/websharedworkerrepository_impl.h" |
6 | 6 |
7 #include "content/common/child_thread.h" | 7 #include "content/common/child_thread.h" |
8 #include "content/common/view_messages.h" | 8 #include "content/common/view_messages.h" |
9 #include "content/renderer/websharedworker_proxy.h" | 9 #include "content/renderer/websharedworker_proxy.h" |
10 | 10 |
| 11 namespace content { |
| 12 |
11 WebSharedWorkerRepositoryImpl::WebSharedWorkerRepositoryImpl() {} | 13 WebSharedWorkerRepositoryImpl::WebSharedWorkerRepositoryImpl() {} |
12 | 14 |
13 WebSharedWorkerRepositoryImpl::~WebSharedWorkerRepositoryImpl() {} | 15 WebSharedWorkerRepositoryImpl::~WebSharedWorkerRepositoryImpl() {} |
14 | 16 |
15 void WebSharedWorkerRepositoryImpl::addSharedWorker( | 17 void WebSharedWorkerRepositoryImpl::addSharedWorker( |
16 WebKit::WebSharedWorker* worker, DocumentID document) { | 18 WebKit::WebSharedWorker* worker, DocumentID document) { |
17 shared_worker_parents_.insert(document); | 19 shared_worker_parents_.insert(document); |
18 } | 20 } |
19 | 21 |
20 void WebSharedWorkerRepositoryImpl::documentDetached(DocumentID document) { | 22 void WebSharedWorkerRepositoryImpl::documentDetached(DocumentID document) { |
21 DocumentSet::iterator iter = shared_worker_parents_.find(document); | 23 DocumentSet::iterator iter = shared_worker_parents_.find(document); |
22 if (iter != shared_worker_parents_.end()) { | 24 if (iter != shared_worker_parents_.end()) { |
23 // Notify the browser process that the document has shut down. | 25 // Notify the browser process that the document has shut down. |
24 ChildThread::current()->Send(new ViewHostMsg_DocumentDetached(document)); | 26 ChildThread::current()->Send(new ViewHostMsg_DocumentDetached(document)); |
25 shared_worker_parents_.erase(iter); | 27 shared_worker_parents_.erase(iter); |
26 } | 28 } |
27 } | 29 } |
28 | 30 |
29 bool WebSharedWorkerRepositoryImpl::hasSharedWorkers(DocumentID document) { | 31 bool WebSharedWorkerRepositoryImpl::hasSharedWorkers(DocumentID document) { |
30 return shared_worker_parents_.find(document) != shared_worker_parents_.end(); | 32 return shared_worker_parents_.find(document) != shared_worker_parents_.end(); |
31 } | 33 } |
| 34 |
| 35 } // namespace content |
OLD | NEW |