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

Unified Diff: chrome/browser/in_process_webkit/dom_storage_message_filter.cc

Issue 6342011: No longer terminating the renderer on bad storage session messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « chrome/browser/in_process_webkit/dom_storage_message_filter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/in_process_webkit/dom_storage_message_filter.cc
===================================================================
--- chrome/browser/in_process_webkit/dom_storage_message_filter.cc (revision 71193)
+++ chrome/browser/in_process_webkit/dom_storage_message_filter.cc (working copy)
@@ -102,11 +102,6 @@
return handled;
}
-void DOMStorageMessageFilter::BadMessageReceived() {
- UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_DSMF"));
- BrowserMessageFilter::BadMessageReceived();
-}
-
void DOMStorageMessageFilter::OverrideThreadForMessage(
const IPC::Message& message,
BrowserThread::ID* thread) {
@@ -122,7 +117,7 @@
DOMStorageNamespace* storage_namespace =
Context()->GetStorageNamespace(namespace_id, true);
if (!storage_namespace) {
- BadMessageReceived();
+ *storage_area_id = DOMStorageContext::kInvalidStorageId;
return;
}
DOMStorageArea* storage_area = storage_namespace->GetStorageArea(
@@ -135,10 +130,10 @@
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
DOMStorageArea* storage_area = Context()->GetStorageArea(storage_area_id);
if (!storage_area) {
- BadMessageReceived();
- return;
+ *length = 0;
+ } else {
+ *length = storage_area->Length();
}
- *length = storage_area->Length();
}
void DOMStorageMessageFilter::OnKey(int64 storage_area_id, unsigned index,
@@ -146,10 +141,10 @@
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
DOMStorageArea* storage_area = Context()->GetStorageArea(storage_area_id);
if (!storage_area) {
- BadMessageReceived();
- return;
+ *key = NullableString16(true);
+ } else {
+ *key = storage_area->Key(index);
}
- *key = storage_area->Key(index);
}
void DOMStorageMessageFilter::OnGetItem(int64 storage_area_id,
@@ -158,10 +153,10 @@
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
DOMStorageArea* storage_area = Context()->GetStorageArea(storage_area_id);
if (!storage_area) {
- BadMessageReceived();
- return;
+ *value = NullableString16(true);
+ } else {
+ *value = storage_area->GetItem(key);
}
- *value = storage_area->GetItem(key);
}
void DOMStorageMessageFilter::OnSetItem(
@@ -171,7 +166,8 @@
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
DOMStorageArea* storage_area = Context()->GetStorageArea(storage_area_id);
if (!storage_area) {
- BadMessageReceived();
+ *old_value = NullableString16(true);
+ *result = WebKit::WebStorageArea::ResultOK;
return;
}
@@ -196,7 +192,7 @@
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
DOMStorageArea* storage_area = Context()->GetStorageArea(storage_area_id);
if (!storage_area) {
- BadMessageReceived();
+ *old_value = NullableString16(true);
return;
}
@@ -209,7 +205,7 @@
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
DOMStorageArea* storage_area = Context()->GetStorageArea(storage_area_id);
if (!storage_area) {
- BadMessageReceived();
+ *something_cleared = false;
return;
}
« no previous file with comments | « chrome/browser/in_process_webkit/dom_storage_message_filter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698