summaryrefslogtreecommitdiffstats
path: root/chrome/browser/worker_host/worker_document_set.h
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-23 00:25:04 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-23 00:25:04 +0000
commitcb5b58c021e7fbcf3f377697870401cdd159ff6d (patch)
tree48e4845d5c8f984765a869f085eefd1d2fc5d2ed /chrome/browser/worker_host/worker_document_set.h
parent4225cbbd34cb72a87dc24be6e87537ba8c1b8505 (diff)
downloadchromium_src-cb5b58c021e7fbcf3f377697870401cdd159ff6d.zip
chromium_src-cb5b58c021e7fbcf3f377697870401cdd159ff6d.tar.gz
chromium_src-cb5b58c021e7fbcf3f377697870401cdd159ff6d.tar.bz2
Revert 36888 - Refactored code to allow associating workers with multiple renderers.
SharedWorkers now gracefully handle http auth requests after their initial window has closed. BUG=27660 TEST=WorkerHttpAuth,SharedWorkerHttpAuth uitests Review URL: http://codereview.chromium.org/509016 TBR=atwilson@chromium.org Review URL: http://codereview.chromium.org/549138 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36929 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/worker_host/worker_document_set.h')
-rw-r--r--chrome/browser/worker_host/worker_document_set.h85
1 files changed, 0 insertions, 85 deletions
diff --git a/chrome/browser/worker_host/worker_document_set.h b/chrome/browser/worker_host/worker_document_set.h
deleted file mode 100644
index 57c1669..0000000
--- a/chrome/browser/worker_host/worker_document_set.h
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_WORKER_HOST_WORKER_DOCUMENT_SET_H_
-#define CHROME_BROWSER_WORKER_HOST_WORKER_DOCUMENT_SET_H_
-
-#include <set>
-
-#include "base/basictypes.h"
-#include "base/ref_counted.h"
-#include "ipc/ipc_message.h"
-
-// The WorkerDocumentSet tracks all of the DOM documents associated with a
-// set of workers. With nested workers, multiple workers can share the same
-// WorkerDocumentSet (meaning that they all share the same lifetime, and will
-// all exit when the last document in that set exits, per the WebWorkers spec).
-class WorkerDocumentSet : public base::RefCounted<WorkerDocumentSet> {
- public:
- WorkerDocumentSet();
-
- // The information we track for each document
- class DocumentInfo {
- public:
- DocumentInfo(IPC::Message::Sender* sender, unsigned long long document_id,
- int renderer_id, int render_view_route_id);
- IPC::Message::Sender* sender() const { return sender_; }
- unsigned long long document_id() const { return document_id_; }
- int renderer_id() const { return renderer_id_; }
- int render_view_route_id() const { return render_view_route_id_; }
-
- // Define operator "<", which is used to determine uniqueness within
- // the set.
- bool operator <(DocumentInfo other) const {
- // Items are identical if the sender and document_id are identical,
- // otherwise create an arbitrary stable ordering based on the document
- // id/sender.
- if (sender() == other.sender()) {
- return document_id() < other.document_id();
- } else {
- return reinterpret_cast<unsigned long long>(sender()) <
- reinterpret_cast<unsigned long long>(other.sender());
- }
- }
-
- private:
- IPC::Message::Sender* sender_;
- unsigned long long document_id_;
- int renderer_id_;
- int render_view_route_id_;
- };
-
- // Adds a document to a shared worker's document set. Also includes the
- // associated renderer_id the document is associated with, to enable
- // communication with the parent tab for things like http auth dialogs.
- void Add(IPC::Message::Sender* parent,
- unsigned long long document_id,
- int renderer_id,
- int render_view_route_id);
-
- // Checks to see if a document is in a shared worker's document set.
- bool Contains(IPC::Message::Sender* parent,
- unsigned long long document_id) const;
-
- // Removes a specific document from a worker's document set when that document
- // is detached.
- void Remove(IPC::Message::Sender* parent, unsigned long long document_id);
-
- // Invoked when a render process exits, to remove all associated documents
- // from a worker's document set.
- void RemoveAll(IPC::Message::Sender* parent);
-
- bool IsEmpty() const { return document_set_.empty(); }
-
- // Define a typedef for convenience here when declaring iterators, etc.
- typedef std::set<DocumentInfo> DocumentInfoSet;
-
- // Returns the set of documents associated with this worker.
- const DocumentInfoSet& documents() { return document_set_; }
-
- private:
- DocumentInfoSet document_set_;
-};
-
-#endif // CHROME_BROWSER_WORKER_HOST_WORKER_DOCUMENT_SET_H_