blob: eb3fc9395ed9f48d38186907cbb5ea619baa6439 [file] [log] [blame]
[email protected]ab3505362009-10-30 18:11:471// 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
[email protected]6f516082011-03-17 19:15:355#include "content/renderer/websharedworkerrepository_impl.h"
[email protected]ab3505362009-10-30 18:11:476
[email protected]f1a29a02011-10-06 23:08:447#include "content/common/child_thread.h"
[email protected]59f4f2fa2011-03-23 01:00:558#include "content/common/view_messages.h"
[email protected]6f516082011-03-17 19:15:359#include "content/renderer/websharedworker_proxy.h"
[email protected]9c00f002009-11-05 22:37:4210
[email protected]eb398192012-10-22 20:16:1911namespace content {
12
[email protected]38e08982010-10-22 17:28:4313WebSharedWorkerRepositoryImpl::WebSharedWorkerRepositoryImpl() {}
14
15WebSharedWorkerRepositoryImpl::~WebSharedWorkerRepositoryImpl() {}
16
[email protected]9c00f002009-11-05 22:37:4217void WebSharedWorkerRepositoryImpl::addSharedWorker(
18 WebKit::WebSharedWorker* worker, DocumentID document) {
[email protected]30447b62009-11-13 01:13:3719 shared_worker_parents_.insert(document);
[email protected]ab3505362009-10-30 18:11:4720}
21
[email protected]30447b62009-11-13 01:13:3722void 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);
28 }
[email protected]ab3505362009-10-30 18:11:4729}
30
[email protected]30447b62009-11-13 01:13:3731bool WebSharedWorkerRepositoryImpl::hasSharedWorkers(DocumentID document) {
32 return shared_worker_parents_.find(document) != shared_worker_parents_.end();
[email protected]ab3505362009-10-30 18:11:4733}
[email protected]eb398192012-10-22 20:16:1934
35} // namespace content