blob: 11c05e8ff9b83ba632041fa4c734500e89ca919f [file] [log] [blame]
Ben Murdochbb1529c2013-08-08 10:24:53 +01001// Copyright 2013 The Chromium Authors. All rights reserved.
Torne (Richard Coles)58218062012-11-14 11:43:16 +00002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Multiply-included message file, no traditional include guard.
Ben Murdochbb1529c2013-08-08 10:24:53 +01006#include "content/common/dom_storage/dom_storage_types.h"
Torne (Richard Coles)58218062012-11-14 11:43:16 +00007#include "content/public/common/common_param_traits.h"
Torne (Richard Coles)58218062012-11-14 11:43:16 +00008#include "ipc/ipc_message_macros.h"
9#include "ipc/ipc_param_traits.h"
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +010010#include "third_party/WebKit/public/platform/WebStorageArea.h"
Ben Murdoch7dbb3d52013-07-17 14:55:54 +010011#include "url/gurl.h"
Torne (Richard Coles)58218062012-11-14 11:43:16 +000012
13#define IPC_MESSAGE_START DOMStorageMsgStart
14
15// Signals a local storage event.
16IPC_STRUCT_BEGIN(DOMStorageMsg_Event_Params)
17 // The key that generated the storage event. Null if clear() was called.
Torne (Richard Coles)7d4cd472013-06-19 11:58:07 +010018 IPC_STRUCT_MEMBER(base::NullableString16, key)
Torne (Richard Coles)58218062012-11-14 11:43:16 +000019
20 // The old value of this key. Null on clear() or if it didn't have a value.
Torne (Richard Coles)7d4cd472013-06-19 11:58:07 +010021 IPC_STRUCT_MEMBER(base::NullableString16, old_value)
Torne (Richard Coles)58218062012-11-14 11:43:16 +000022
23 // The new value of this key. Null on removeItem() or clear().
Torne (Richard Coles)7d4cd472013-06-19 11:58:07 +010024 IPC_STRUCT_MEMBER(base::NullableString16, new_value)
Torne (Richard Coles)58218062012-11-14 11:43:16 +000025
26 // The origin this is associated with.
27 IPC_STRUCT_MEMBER(GURL, origin)
28
29 // The URL of the page that caused the storage event.
30 IPC_STRUCT_MEMBER(GURL, page_url)
31
32 // The non-zero connection_id which caused the event or 0 if the event
33 // was not caused by the target renderer process.
34 IPC_STRUCT_MEMBER(int, connection_id)
35
36 // The non-zero session namespace_id associated with the event or 0 if
37 // this is a local storage event.
38 IPC_STRUCT_MEMBER(int64, namespace_id)
39IPC_STRUCT_END()
40
41IPC_ENUM_TRAITS(WebKit::WebStorageArea::Result)
42
43// DOM Storage messages sent from the browser to the renderer.
44
45// Storage events are broadcast to all renderer processes.
46IPC_MESSAGE_CONTROL1(DOMStorageMsg_Event,
47 DOMStorageMsg_Event_Params)
48
49// Completion notification sent in response to each async
50// load, set, remove, and clear operation.
51// Used to maintain the integrity of the renderer-side cache.
52IPC_MESSAGE_CONTROL1(DOMStorageMsg_AsyncOperationComplete,
53 bool /* success */)
54
55// DOM Storage messages sent from the renderer to the browser.
56// Note: The 'connection_id' must be the first parameter in these message.
57
58// Open the storage area for a particular origin within a namespace.
59IPC_MESSAGE_CONTROL3(DOMStorageHostMsg_OpenStorageArea,
60 int /* connection_id */,
61 int64 /* namespace_id */,
62 GURL /* origin */)
63
64// Close a previously opened storage area.
65IPC_MESSAGE_CONTROL1(DOMStorageHostMsg_CloseStorageArea,
66 int /* connection_id */)
67
68// Retrieves the set of key/value pairs for the area. Used to prime
69// the renderer-side cache. A completion notification is sent in response.
70IPC_SYNC_MESSAGE_CONTROL1_1(DOMStorageHostMsg_LoadStorageArea,
71 int /* connection_id */,
Ben Murdochbb1529c2013-08-08 10:24:53 +010072 content::DOMStorageValuesMap)
Torne (Richard Coles)58218062012-11-14 11:43:16 +000073
74// Set a value that's associated with a key in a storage area.
75// A completion notification is sent in response.
76IPC_MESSAGE_CONTROL4(DOMStorageHostMsg_SetItem,
77 int /* connection_id */,
78 string16 /* key */,
79 string16 /* value */,
80 GURL /* page_url */)
81
82// Remove the value associated with a key in a storage area.
83// A completion notification is sent in response.
84IPC_MESSAGE_CONTROL3(DOMStorageHostMsg_RemoveItem,
85 int /* connection_id */,
86 string16 /* key */,
87 GURL /* page_url */)
88
89// Clear the storage area. A completion notification is sent in response.
90IPC_MESSAGE_CONTROL2(DOMStorageHostMsg_Clear,
91 int /* connection_id */,
92 GURL /* page_url */)
93
94// Used to flush the ipc message queue.
95IPC_SYNC_MESSAGE_CONTROL0_0(DOMStorageHostMsg_FlushMessages)