[content shell] implement testRunner.overridePreference
[chromium-blink-merge.git] / content / renderer / websharedworkerrepository_impl.cc
blobeb3fc9395ed9f48d38186907cbb5ea619baa6439
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.
5 #include "content/renderer/websharedworkerrepository_impl.h"
7 #include "content/common/child_thread.h"
8 #include "content/common/view_messages.h"
9 #include "content/renderer/websharedworker_proxy.h"
11 namespace content {
13 WebSharedWorkerRepositoryImpl::WebSharedWorkerRepositoryImpl() {}
15 WebSharedWorkerRepositoryImpl::~WebSharedWorkerRepositoryImpl() {}
17 void WebSharedWorkerRepositoryImpl::addSharedWorker(
18 WebKit::WebSharedWorker* worker, DocumentID document) {
19 shared_worker_parents_.insert(document);
22 void WebSharedWorkerRepositoryImpl::documentDetached(DocumentID document) {
23 DocumentSet::iterator iter = shared_worker_parents_.find(document);
24 if (iter != shared_worker_parents_.end()) {
25 // Notify the browser process that the document has shut down.
26 ChildThread::current()->Send(new ViewHostMsg_DocumentDetached(document));
27 shared_worker_parents_.erase(iter);
31 bool WebSharedWorkerRepositoryImpl::hasSharedWorkers(DocumentID document) {
32 return shared_worker_parents_.find(document) != shared_worker_parents_.end();
35 } // namespace content