Commit bb4c5fb0 authored by michaeln@google.com's avatar michaeln@google.com

Add the HasAreaOpen method to DomStorageHost. Intended for use to make event...

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
parent 2728be6e
...@@ -115,6 +115,18 @@ bool DomStorageHost::ClearArea(int connection_id, const GURL& page_url) { ...@@ -115,6 +115,18 @@ bool DomStorageHost::ClearArea(int connection_id, const GURL& page_url) {
return true; 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) { DomStorageArea* DomStorageHost::GetOpenArea(int connection_id) {
AreaMap::iterator found = connections_.find(connection_id); AreaMap::iterator found = connections_.find(connection_id);
if (found == connections_.end()) if (found == connections_.end())
......
...@@ -46,6 +46,7 @@ class DomStorageHost { ...@@ -46,6 +46,7 @@ class DomStorageHost {
const GURL& page_url, const GURL& page_url,
string16* old_value); string16* old_value);
bool ClearArea(int connection_id, const GURL& page_url); bool ClearArea(int connection_id, const GURL& page_url);
bool HasAreaOpen(int namespace_id, const GURL& origin) const;
private: private:
// Struct to hold references needed for areas that are open // Struct to hold references needed for areas that are open
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment