Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: content/renderer/websharedworkerrepository_impl.cc

Issue 40303002: Simplify SharedWorkerRepository code (Chromium side) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/websharedworkerrepository_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/renderer/websharedworkerrepository_impl.h"
6
7 #include "content/child/child_thread.h"
8 #include "content/common/view_messages.h"
9 #include "content/renderer/websharedworker_proxy.h"
10
11 namespace content {
12
13 WebSharedWorkerRepositoryImpl::WebSharedWorkerRepositoryImpl() {}
14
15 WebSharedWorkerRepositoryImpl::~WebSharedWorkerRepositoryImpl() {}
16
17 void WebSharedWorkerRepositoryImpl::addSharedWorker(
18 WebKit::WebSharedWorker* worker, DocumentID document) {
19 shared_worker_parents_.insert(document);
20 }
21
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);
28 }
29 }
30
31 bool WebSharedWorkerRepositoryImpl::hasSharedWorkers(DocumentID document) {
32 return shared_worker_parents_.find(document) != shared_worker_parents_.end();
33 }
34
35 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/websharedworkerrepository_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698