| Index: content/browser/dom_storage/dom_storage_host.cc
|
| diff --git a/content/browser/dom_storage/dom_storage_host.cc b/content/browser/dom_storage/dom_storage_host.cc
|
| index 556f76d5c0fa22e3b14ffecf5ea326a376cd3126..14d288d865393acebe876c1673389641339e3271 100644
|
| --- a/content/browser/dom_storage/dom_storage_host.cc
|
| +++ b/content/browser/dom_storage/dom_storage_host.cc
|
| @@ -12,10 +12,8 @@
|
|
|
| namespace content {
|
|
|
| -DOMStorageHost::DOMStorageHost(DOMStorageContextImpl* context,
|
| - int render_process_id)
|
| - : context_(context),
|
| - render_process_id_(render_process_id) {
|
| +DOMStorageHost::DOMStorageHost(DOMStorageContextImpl* context)
|
| + : context_(context) {
|
| }
|
|
|
| DOMStorageHost::~DOMStorageHost() {
|
| @@ -49,7 +47,7 @@ void DOMStorageHost::CloseStorageArea(int connection_id) {
|
| }
|
|
|
| bool DOMStorageHost::ExtractAreaValues(
|
| - int connection_id, DOMStorageValuesMap* map, bool* send_log_get_messages) {
|
| + int connection_id, DOMStorageValuesMap* map) {
|
| map->clear();
|
| DOMStorageArea* area = GetOpenArea(connection_id);
|
| if (!area)
|
| @@ -64,10 +62,6 @@ bool DOMStorageHost::ExtractAreaValues(
|
| }
|
| }
|
| area->ExtractValues(map);
|
| - *send_log_get_messages = false;
|
| - DOMStorageNamespace* ns = GetNamespace(connection_id);
|
| - DCHECK(ns);
|
| - *send_log_get_messages = ns->IsLoggingRenderer(render_process_id_);
|
| return true;
|
| }
|
|
|
| @@ -105,24 +99,9 @@ bool DOMStorageHost::SetAreaItem(
|
| return false;
|
| if (old_value->is_null() || old_value->string() != value)
|
| context_->NotifyItemSet(area, key, value, *old_value, page_url);
|
| - MaybeLogTransaction(connection_id,
|
| - DOMStorageNamespace::TRANSACTION_WRITE,
|
| - area->origin(), page_url, key,
|
| - base::NullableString16(value, false));
|
| return true;
|
| }
|
|
|
| -void DOMStorageHost::LogGetAreaItem(
|
| - int connection_id, const base::string16& key,
|
| - const base::NullableString16& value) {
|
| - DOMStorageArea* area = GetOpenArea(connection_id);
|
| - if (!area)
|
| - return;
|
| - MaybeLogTransaction(connection_id,
|
| - DOMStorageNamespace::TRANSACTION_READ,
|
| - area->origin(), GURL(), key, value);
|
| -}
|
| -
|
| bool DOMStorageHost::RemoveAreaItem(
|
| int connection_id, const base::string16& key, const GURL& page_url,
|
| base::string16* old_value) {
|
| @@ -132,9 +111,6 @@ bool DOMStorageHost::RemoveAreaItem(
|
| if (!area->RemoveItem(key, old_value))
|
| return false;
|
| context_->NotifyItemRemoved(area, key, *old_value, page_url);
|
| - MaybeLogTransaction(connection_id,
|
| - DOMStorageNamespace::TRANSACTION_REMOVE,
|
| - area->origin(), page_url, key, base::NullableString16());
|
| return true;
|
| }
|
|
|
| @@ -145,40 +121,21 @@ bool DOMStorageHost::ClearArea(int connection_id, const GURL& page_url) {
|
| if (!area->Clear())
|
| return false;
|
| context_->NotifyAreaCleared(area, page_url);
|
| - MaybeLogTransaction(connection_id,
|
| - DOMStorageNamespace::TRANSACTION_CLEAR,
|
| - area->origin(), page_url, base::string16(),
|
| - base::NullableString16());
|
| return true;
|
| }
|
|
|
| bool DOMStorageHost::HasAreaOpen(
|
| - int64 namespace_id, const GURL& origin, int64* alias_namespace_id) const {
|
| + int namespace_id, const GURL& origin) const {
|
| AreaMap::const_iterator it = connections_.begin();
|
| for (; it != connections_.end(); ++it) {
|
| - if (namespace_id == it->second.area_->namespace_id() &&
|
| + if (namespace_id == it->second.namespace_->namespace_id() &&
|
| origin == it->second.area_->origin()) {
|
| - *alias_namespace_id = it->second.namespace_->namespace_id();
|
| return true;
|
| }
|
| }
|
| return false;
|
| }
|
|
|
| -bool DOMStorageHost::ResetOpenAreasForNamespace(int64 namespace_id) {
|
| - bool result = false;
|
| - AreaMap::iterator it = connections_.begin();
|
| - for (; it != connections_.end(); ++it) {
|
| - if (namespace_id == it->second.namespace_->namespace_id()) {
|
| - GURL origin = it->second.area_->origin();
|
| - it->second.namespace_->CloseStorageArea(it->second.area_.get());
|
| - it->second.area_ = it->second.namespace_->OpenStorageArea(origin);
|
| - result = true;
|
| - }
|
| - }
|
| - return result;
|
| -}
|
| -
|
| DOMStorageArea* DOMStorageHost::GetOpenArea(int connection_id) {
|
| AreaMap::iterator found = connections_.find(connection_id);
|
| if (found == connections_.end())
|
| @@ -193,26 +150,6 @@ DOMStorageNamespace* DOMStorageHost::GetNamespace(int connection_id) {
|
| return found->second.namespace_.get();
|
| }
|
|
|
| -void DOMStorageHost::MaybeLogTransaction(
|
| - int connection_id,
|
| - DOMStorageNamespace::LogType transaction_type,
|
| - const GURL& origin,
|
| - const GURL& page_url,
|
| - const base::string16& key,
|
| - const base::NullableString16& value) {
|
| - DOMStorageNamespace* ns = GetNamespace(connection_id);
|
| - DCHECK(ns);
|
| - if (!ns->IsLoggingRenderer(render_process_id_))
|
| - return;
|
| - DOMStorageNamespace::TransactionRecord transaction;
|
| - transaction.transaction_type = transaction_type;
|
| - transaction.origin = origin;
|
| - transaction.page_url = page_url;
|
| - transaction.key = key;
|
| - transaction.value = value;
|
| - ns->AddTransaction(render_process_id_, transaction);
|
| -}
|
| -
|
| // NamespaceAndArea
|
|
|
| DOMStorageHost::NamespaceAndArea::NamespaceAndArea() {}
|
|
|