summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 05:44:40 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 05:44:40 +0000
commitc61cc652f61fe89b5b1ccb7156896ba11cc0c7f1 (patch)
tree8f159443ffcb4cfad6ab1b64a6cdf70b297428c9 /chrome/common
parentf244388daae810a179fe229a6da4a33344b68fa3 (diff)
downloadchromium_src-c61cc652f61fe89b5b1ccb7156896ba11cc0c7f1.zip
chromium_src-c61cc652f61fe89b5b1ccb7156896ba11cc0c7f1.tar.gz
chromium_src-c61cc652f61fe89b5b1ccb7156896ba11cc0c7f1.tar.bz2
First half of http://codereview.chromium.org/274014/show
This fixes storage events in single process mode, fixes a bug due to the glue/webkitclient_impl not being updated when I introduced quota support, introduces a params struct for storage events, and is general cleanup. Submitting this first since the change to add the url param made things bigger than I liked. TBR=darin TEST=none BUG=25427 Review URL: http://codereview.chromium.org/348071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30945 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/render_messages.h52
-rw-r--r--chrome/common/render_messages_internal.h8
2 files changed, 54 insertions, 6 deletions
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 87fc773..2e4bd89 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -495,6 +495,24 @@ struct ViewHostMsg_ScriptedPrint_Params {
bool has_selection;
};
+// Signals a storage event.
+struct ViewMsg_DOMStorageEvent_Params {
+ // The key that generated the storage event. Null if clear() was called.
+ NullableString16 key_;
+
+ // The old value of this key. Null on clear() or if it didn't have a value.
+ NullableString16 old_value_;
+
+ // The new value of this key. Null on removeItem() or clear().
+ NullableString16 new_value_;
+
+ // The origin this is associated with.
+ string16 origin_;
+
+ // The storage type of this event.
+ DOMStorageType storage_type_;
+};
+
namespace IPC {
template <>
@@ -2204,6 +2222,40 @@ struct ParamTraits<DOMStorageType> {
}
};
+// Traits for ViewMsg_DOMStorageEvent_Params.
+template <>
+struct ParamTraits<ViewMsg_DOMStorageEvent_Params> {
+ typedef ViewMsg_DOMStorageEvent_Params param_type;
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.key_);
+ WriteParam(m, p.old_value_);
+ WriteParam(m, p.new_value_);
+ WriteParam(m, p.origin_);
+ WriteParam(m, p.storage_type_);
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->key_) &&
+ ReadParam(m, iter, &p->old_value_) &&
+ ReadParam(m, iter, &p->new_value_) &&
+ ReadParam(m, iter, &p->origin_) &&
+ ReadParam(m, iter, &p->storage_type_);
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.key_, l);
+ l->append(L", ");
+ LogParam(p.old_value_, l);
+ l->append(L", ");
+ LogParam(p.new_value_, l);
+ l->append(L", ");
+ LogParam(p.origin_, l);
+ l->append(L", ");
+ LogParam(p.storage_type_, l);
+ l->append(L")");
+ }
+};
+
// Traits for WebCookie
template <>
struct ParamTraits<webkit_glue::WebCookie> {
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index f3887f0..2ff15ed 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -768,12 +768,8 @@ IPC_BEGIN_MESSAGES(View)
int64 /* space available to origin */)
// Storage events are broadcast to renderer processes.
- IPC_MESSAGE_CONTROL5(ViewMsg_DOMStorageEvent,
- string16 /* key */,
- NullableString16 /* old_value */,
- NullableString16 /* new_value */,
- string16 /* origin */,
- DOMStorageType /* dom_storage_type */)
+ IPC_MESSAGE_CONTROL1(ViewMsg_DOMStorageEvent,
+ ViewMsg_DOMStorageEvent_Params)
#if defined(IPC_MESSAGE_LOG_ENABLED)
// Tell the renderer process to begin or end IPC message logging.