summaryrefslogtreecommitdiffstats
path: root/webkit/dom_storage
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-21 22:52:14 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-21 22:52:14 +0000
commitbb4c5fb067dcc8b62557293eb0dc4bab0384230a (patch)
tree7577d3f111090adab5196d16c82eff8d28afceff /webkit/dom_storage
parent2728be6ea93d7c0cbb8eb6d426bd97ce64f33511 (diff)
downloadchromium_src-bb4c5fb067dcc8b62557293eb0dc4bab0384230a.zip
chromium_src-bb4c5fb067dcc8b62557293eb0dc4bab0384230a.tar.gz
chromium_src-bb4c5fb067dcc8b62557293eb0dc4bab0384230a.tar.bz2
Add the HasAreaOpen method to DomStorageHost. Intended for use to make event propagation less chatty.
BUG=128482 Review URL: https://chromiumcodereview.appspot.com/10413018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138158 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/dom_storage')
-rw-r--r--webkit/dom_storage/dom_storage_host.cc12
-rw-r--r--webkit/dom_storage/dom_storage_host.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/webkit/dom_storage/dom_storage_host.cc b/webkit/dom_storage/dom_storage_host.cc
index b97c02c..301726d 100644
--- a/webkit/dom_storage/dom_storage_host.cc
+++ b/webkit/dom_storage/dom_storage_host.cc
@@ -115,6 +115,18 @@ bool DomStorageHost::ClearArea(int connection_id, const GURL& page_url) {
return true;
}
+bool DomStorageHost::HasAreaOpen(
+ int namespace_id, const GURL& origin) const {
+ AreaMap::const_iterator it = connections_.begin();
+ for (; it != connections_.end(); ++it) {
+ if (namespace_id == it->second.namespace_->namespace_id() &&
+ origin == it->second.area_->origin()) {
+ return true;
+ }
+ }
+ return false;
+}
+
DomStorageArea* DomStorageHost::GetOpenArea(int connection_id) {
AreaMap::iterator found = connections_.find(connection_id);
if (found == connections_.end())
diff --git a/webkit/dom_storage/dom_storage_host.h b/webkit/dom_storage/dom_storage_host.h
index d6c74f3..78853fa 100644
--- a/webkit/dom_storage/dom_storage_host.h
+++ b/webkit/dom_storage/dom_storage_host.h
@@ -46,6 +46,7 @@ class DomStorageHost {
const GURL& page_url,
string16* old_value);
bool ClearArea(int connection_id, const GURL& page_url);
+ bool HasAreaOpen(int namespace_id, const GURL& origin) const;
private:
// Struct to hold references needed for areas that are open