1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Multiply-included message file, no traditional include guard.
6 #include "content/common/dom_storage/dom_storage_types.h"
7 #include "content/public/common/common_param_traits.h"
8 #include "ipc/ipc_message_macros.h"
9 #include "ipc/ipc_param_traits.h"
10 #include "third_party/WebKit/public/platform/WebStorageArea.h"
13 #define IPC_MESSAGE_START DOMStorageMsgStart
15 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebStorageArea::Result
,
16 blink::WebStorageArea::ResultLast
)
18 // Signals a local storage event.
19 IPC_STRUCT_BEGIN(DOMStorageMsg_Event_Params
)
20 // The key that generated the storage event. Null if clear() was called.
21 IPC_STRUCT_MEMBER(base::NullableString16
, key
)
23 // The old value of this key. Null on clear() or if it didn't have a value.
24 IPC_STRUCT_MEMBER(base::NullableString16
, old_value
)
26 // The new value of this key. Null on removeItem() or clear().
27 IPC_STRUCT_MEMBER(base::NullableString16
, new_value
)
29 // The origin this is associated with.
30 IPC_STRUCT_MEMBER(GURL
, origin
)
32 // The URL of the page that caused the storage event.
33 IPC_STRUCT_MEMBER(GURL
, page_url
)
35 // The non-zero connection_id which caused the event or 0 if the event
36 // was not caused by the target renderer process.
37 IPC_STRUCT_MEMBER(int, connection_id
)
39 // The non-zero session namespace_id associated with the event or 0 if
40 // this is a local storage event.
41 IPC_STRUCT_MEMBER(int64
, namespace_id
)
44 // DOM Storage messages sent from the browser to the renderer.
46 // Storage events are broadcast to all renderer processes.
47 IPC_MESSAGE_CONTROL1(DOMStorageMsg_Event
,
48 DOMStorageMsg_Event_Params
)
50 // Completion notification sent in response to each async
51 // load, set, remove, and clear operation.
52 // Used to maintain the integrity of the renderer-side cache.
53 IPC_MESSAGE_CONTROL1(DOMStorageMsg_AsyncOperationComplete
,
56 // DOM Storage messages sent from the renderer to the browser.
57 // Note: The 'connection_id' must be the first parameter in these message.
59 // Open the storage area for a particular origin within a namespace.
60 IPC_MESSAGE_CONTROL3(DOMStorageHostMsg_OpenStorageArea
,
61 int /* connection_id */,
62 int64
/* namespace_id */,
65 // Close a previously opened storage area.
66 IPC_MESSAGE_CONTROL1(DOMStorageHostMsg_CloseStorageArea
,
67 int /* connection_id */)
69 // Retrieves the set of key/value pairs for the area. Used to prime
70 // the renderer-side cache. A completion notification is sent in response.
71 IPC_SYNC_MESSAGE_CONTROL1_1(DOMStorageHostMsg_LoadStorageArea
,
72 int /* connection_id */,
73 content::DOMStorageValuesMap
)
75 // Set a value that's associated with a key in a storage area.
76 // A completion notification is sent in response.
77 IPC_MESSAGE_CONTROL4(DOMStorageHostMsg_SetItem
,
78 int /* connection_id */,
79 base::string16
/* key */,
80 base::string16
/* value */,
83 // Remove the value associated with a key in a storage area.
84 // A completion notification is sent in response.
85 IPC_MESSAGE_CONTROL3(DOMStorageHostMsg_RemoveItem
,
86 int /* connection_id */,
87 base::string16
/* key */,
90 // Clear the storage area. A completion notification is sent in response.
91 IPC_MESSAGE_CONTROL2(DOMStorageHostMsg_Clear
,
92 int /* connection_id */,
95 // Used to flush the ipc message queue.
96 IPC_SYNC_MESSAGE_CONTROL0_0(DOMStorageHostMsg_FlushMessages
)