OLD | NEW |
| (Empty) |
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 | |
3 // LICENSE file. | |
4 | |
5 #include "chrome/renderer/websharedworkerrepository_impl.h" | |
6 | |
7 #include "chrome/common/render_messages.h" | |
8 #include "chrome/renderer/render_thread.h" | |
9 #include "chrome/renderer/websharedworker_proxy.h" | |
10 | |
11 WebSharedWorkerRepositoryImpl::WebSharedWorkerRepositoryImpl() {} | |
12 | |
13 WebSharedWorkerRepositoryImpl::~WebSharedWorkerRepositoryImpl() {} | |
14 | |
15 void WebSharedWorkerRepositoryImpl::addSharedWorker( | |
16 WebKit::WebSharedWorker* worker, DocumentID document) { | |
17 shared_worker_parents_.insert(document); | |
18 } | |
19 | |
20 void WebSharedWorkerRepositoryImpl::documentDetached(DocumentID document) { | |
21 DocumentSet::iterator iter = shared_worker_parents_.find(document); | |
22 if (iter != shared_worker_parents_.end()) { | |
23 // Notify the browser process that the document has shut down. | |
24 ChildThread::current()->Send(new ViewHostMsg_DocumentDetached(document)); | |
25 shared_worker_parents_.erase(iter); | |
26 } | |
27 } | |
28 | |
29 bool WebSharedWorkerRepositoryImpl::hasSharedWorkers(DocumentID document) { | |
30 return shared_worker_parents_.find(document) != shared_worker_parents_.end(); | |
31 } | |
OLD | NEW |