OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Multiply-included message file, no traditional include guard. | 5 // Multiply-included message file, no traditional include guard. |
6 #include "content/common/dom_storage_common.h" | |
7 #include "content/public/common/common_param_traits.h" | 6 #include "content/public/common/common_param_traits.h" |
8 #include "googleurl/src/gurl.h" | 7 #include "googleurl/src/gurl.h" |
9 #include "ipc/ipc_message_macros.h" | 8 #include "ipc/ipc_message_macros.h" |
10 #include "ipc/ipc_param_traits.h" | 9 #include "ipc/ipc_param_traits.h" |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h" |
| 11 #include "webkit/dom_storage/dom_storage_types.h" |
12 | 12 |
13 #define IPC_MESSAGE_START DOMStorageMsgStart | 13 #define IPC_MESSAGE_START DOMStorageMsgStart |
14 | 14 |
15 IPC_ENUM_TRAITS(DOMStorageType) | |
16 | |
17 // Signals a storage event. | 15 // Signals a storage event. |
18 IPC_STRUCT_BEGIN(DOMStorageMsg_Event_Params) | 16 IPC_STRUCT_BEGIN(DOMStorageMsg_Event_Params) |
19 // The key that generated the storage event. Null if clear() was called. | 17 // The key that generated the storage event. Null if clear() was called. |
20 IPC_STRUCT_MEMBER(NullableString16, key) | 18 IPC_STRUCT_MEMBER(NullableString16, key) |
21 | 19 |
22 // The old value of this key. Null on clear() or if it didn't have a value. | 20 // The old value of this key. Null on clear() or if it didn't have a value. |
23 IPC_STRUCT_MEMBER(NullableString16, old_value) | 21 IPC_STRUCT_MEMBER(NullableString16, old_value) |
24 | 22 |
25 // The new value of this key. Null on removeItem() or clear(). | 23 // The new value of this key. Null on removeItem() or clear(). |
26 IPC_STRUCT_MEMBER(NullableString16, new_value) | 24 IPC_STRUCT_MEMBER(NullableString16, new_value) |
27 | 25 |
28 // The origin this is associated with. | 26 // The origin this is associated with. |
29 IPC_STRUCT_MEMBER(string16, origin) | 27 IPC_STRUCT_MEMBER(string16, origin) |
30 | 28 |
31 // The URL of the page that caused the storage event. | 29 // The URL of the page that caused the storage event. |
32 IPC_STRUCT_MEMBER(GURL, url) | 30 IPC_STRUCT_MEMBER(GURL, page_url) |
33 | 31 |
34 // The storage type of this event. | 32 // The namespace_id this is associated with. |
35 IPC_STRUCT_MEMBER(DOMStorageType, storage_type) | 33 IPC_STRUCT_MEMBER(int64, namespace_id) |
36 IPC_STRUCT_END() | 34 IPC_STRUCT_END() |
37 | 35 |
38 IPC_ENUM_TRAITS(WebKit::WebStorageArea::Result) | 36 IPC_ENUM_TRAITS(WebKit::WebStorageArea::Result) |
39 | 37 |
40 // DOM Storage messages sent from the browser to the renderer. | 38 // DOM Storage messages sent from the browser to the renderer. |
41 | 39 |
42 // Storage events are broadcast to renderer processes. | 40 // Storage events are broadcast to renderer processes. |
43 IPC_MESSAGE_CONTROL1(DOMStorageMsg_Event, | 41 IPC_MESSAGE_CONTROL1(DOMStorageMsg_Event, |
44 DOMStorageMsg_Event_Params) | 42 DOMStorageMsg_Event_Params) |
45 | 43 |
46 | 44 |
47 // DOM Storage messages sent from the renderer to the browser. | 45 // DOM Storage messages sent from the renderer to the browser. |
48 | 46 |
49 // Open the storage area for a particular origin within a namespace. | 47 // Open the storage area for a particular origin within a namespace. |
| 48 // TODO(michaeln): make this async and have the renderer send the connection_id |
50 IPC_SYNC_MESSAGE_CONTROL2_1(DOMStorageHostMsg_OpenStorageArea, | 49 IPC_SYNC_MESSAGE_CONTROL2_1(DOMStorageHostMsg_OpenStorageArea, |
51 int64 /* namespace_id */, | 50 int64 /* namespace_id */, |
52 string16 /* origin */, | 51 string16 /* origin */, |
53 int64 /* storage_area_id */) | 52 int64 /* connection_id */) |
54 | 53 |
55 // Close a previously opened storage area. | 54 // Close a previously opened storage area. |
56 IPC_MESSAGE_CONTROL1(DOMStorageHostMsg_CloseStorageArea, | 55 IPC_MESSAGE_CONTROL1(DOMStorageHostMsg_CloseStorageArea, |
57 int64 /* storage_area_id */) | 56 int64 /* connection_id */) |
58 | 57 |
59 // Get the length of a storage area. | 58 // Get the length of a storage area. |
60 IPC_SYNC_MESSAGE_CONTROL1_1(DOMStorageHostMsg_Length, | 59 IPC_SYNC_MESSAGE_CONTROL1_1(DOMStorageHostMsg_Length, |
61 int64 /* storage_area_id */, | 60 int64 /* connection_id */, |
62 unsigned /* length */) | 61 unsigned /* length */) |
63 | 62 |
64 // Get a the ith key within a storage area. | 63 // Get a the ith key within a storage area. |
65 IPC_SYNC_MESSAGE_CONTROL2_1(DOMStorageHostMsg_Key, | 64 IPC_SYNC_MESSAGE_CONTROL2_1(DOMStorageHostMsg_Key, |
66 int64 /* storage_area_id */, | 65 int64 /* connection_id */, |
67 unsigned /* index */, | 66 unsigned /* index */, |
68 NullableString16 /* key */) | 67 NullableString16 /* key */) |
69 | 68 |
70 // Get a value based on a key from a storage area. | 69 // Get a value based on a key from a storage area. |
71 IPC_SYNC_MESSAGE_CONTROL2_1(DOMStorageHostMsg_GetItem, | 70 IPC_SYNC_MESSAGE_CONTROL2_1(DOMStorageHostMsg_GetItem, |
72 int64 /* storage_area_id */, | 71 int64 /* connection_id */, |
73 string16 /* key */, | 72 string16 /* key */, |
74 NullableString16 /* value */) | 73 NullableString16 /* value */) |
75 | 74 |
76 // Set a value that's associated with a key in a storage area. | 75 // Set a value that's associated with a key in a storage area. |
77 IPC_SYNC_MESSAGE_CONTROL4_2(DOMStorageHostMsg_SetItem, | 76 IPC_SYNC_MESSAGE_CONTROL4_2(DOMStorageHostMsg_SetItem, |
78 int64 /* storage_area_id */, | 77 int64 /* connection_id */, |
79 string16 /* key */, | 78 string16 /* key */, |
80 string16 /* value */, | 79 string16 /* value */, |
81 GURL /* url */, | 80 GURL /* page_url */, |
82 WebKit::WebStorageArea::Result /* result */, | 81 WebKit::WebStorageArea::Result /* result */, |
83 NullableString16 /* old_value */) | 82 NullableString16 /* old_value */) |
84 | 83 |
85 // Remove the value associated with a key in a storage area. | 84 // Remove the value associated with a key in a storage area. |
86 IPC_SYNC_MESSAGE_CONTROL3_1(DOMStorageHostMsg_RemoveItem, | 85 IPC_SYNC_MESSAGE_CONTROL3_1(DOMStorageHostMsg_RemoveItem, |
87 int64 /* storage_area_id */, | 86 int64 /* connection_id */, |
88 string16 /* key */, | 87 string16 /* key */, |
89 GURL /* url */, | 88 GURL /* page_url */, |
90 NullableString16 /* old_value */) | 89 NullableString16 /* old_value */) |
91 | 90 |
92 // Clear the storage area. | 91 // Clear the storage area. |
93 IPC_SYNC_MESSAGE_CONTROL2_1(DOMStorageHostMsg_Clear, | 92 IPC_SYNC_MESSAGE_CONTROL2_1(DOMStorageHostMsg_Clear, |
94 int64 /* storage_area_id */, | 93 int64 /* connection_id */, |
95 GURL /* url */, | 94 GURL /* page_url */, |
96 bool /* something_cleared */) | 95 bool /* something_cleared */) |
97 | 96 |
OLD | NEW |