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

Unified Diff: content/browser/dom_storage/dom_storage_message_filter.cc

Issue 12398008: Purge in-memory localStorage areas if the # of areas exceeds the limit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/dom_storage/dom_storage_message_filter.h ('k') | content/common/dom_storage_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/dom_storage/dom_storage_message_filter.cc
diff --git a/content/browser/dom_storage/dom_storage_message_filter.cc b/content/browser/dom_storage/dom_storage_message_filter.cc
index 9479cc9ae1e1e5c39a73d44eaa66db75b840ccbc..96606d8537a8e9fd39a170299ff875ae0bb2a1d9 100644
--- a/content/browser/dom_storage/dom_storage_message_filter.cc
+++ b/content/browser/dom_storage/dom_storage_message_filter.cc
@@ -6,6 +6,7 @@
#include "base/auto_reset.h"
#include "base/bind.h"
+#include "base/stringprintf.h"
#include "base/nullable_string16.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/utf_string_conversions.h"
@@ -95,12 +96,14 @@ bool DOMStorageMessageFilter::OnMessageReceived(const IPC::Message& message,
void DOMStorageMessageFilter::OnOpenStorageArea(int connection_id,
int64 namespace_id,
- const GURL& origin) {
+ const GURL& origin,
+ int64* storage_size) {
DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!host_->OpenStorageArea(connection_id, namespace_id, origin)) {
RecordAction(UserMetricsAction("BadMessageTerminate_DSMF_1"));
BadMessageReceived();
}
+ *storage_size = context_->GetInMemoryStorageSize();
}
void DOMStorageMessageFilter::OnCloseStorageArea(int connection_id) {
@@ -208,6 +211,7 @@ void DOMStorageMessageFilter::SendDomStorageEvent(
params.new_value = new_value;
params.old_value = old_value;
params.namespace_id = area->namespace_id();
+ params.storage_size = context_->GetInMemoryStorageSize();
Send(new DOMStorageMsg_Event(params));
}
}
« no previous file with comments | « content/browser/dom_storage/dom_storage_message_filter.h ('k') | content/common/dom_storage_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698