OLD | NEW |
| (Empty) |
1 // Copyright (c) 2010 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. | |
4 | |
5 // Multiply-included message file, no traditional include guard. | |
6 #include "chrome/common/dom_storage_common.h" | |
7 #include "googleurl/src/gurl.h" | |
8 #include "ipc/ipc_message_macros.h" | |
9 #include "ipc/ipc_param_traits.h" | |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageArea.h" | |
11 | |
12 #define IPC_MESSAGE_START DOMStorageMsgStart | |
13 | |
14 // Signals a storage event. | |
15 IPC_STRUCT_BEGIN(DOMStorageMsg_Event_Params) | |
16 // The key that generated the storage event. Null if clear() was called. | |
17 IPC_STRUCT_MEMBER(NullableString16, key) | |
18 | |
19 // The old value of this key. Null on clear() or if it didn't have a value. | |
20 IPC_STRUCT_MEMBER(NullableString16, old_value) | |
21 | |
22 // The new value of this key. Null on removeItem() or clear(). | |
23 IPC_STRUCT_MEMBER(NullableString16, new_value) | |
24 | |
25 // The origin this is associated with. | |
26 IPC_STRUCT_MEMBER(string16, origin) | |
27 | |
28 // The URL of the page that caused the storage event. | |
29 IPC_STRUCT_MEMBER(GURL, url) | |
30 | |
31 // The storage type of this event. | |
32 IPC_STRUCT_MEMBER(DOMStorageType, storage_type) | |
33 IPC_STRUCT_END() | |
34 | |
35 IPC_ENUM_TRAITS(DOMStorageType) | |
36 IPC_ENUM_TRAITS(WebKit::WebStorageArea::Result) | |
37 | |
38 // DOM Storage messages sent from the browser to the renderer. | |
39 | |
40 // Storage events are broadcast to renderer processes. | |
41 IPC_MESSAGE_CONTROL1(DOMStorageMsg_Event, | |
42 DOMStorageMsg_Event_Params) | |
43 | |
44 | |
45 // DOM Storage messages sent from the renderer to the browser. | |
46 | |
47 | |
48 // Get the storage area id for a particular origin within a namespace. | |
49 IPC_SYNC_MESSAGE_CONTROL2_1(DOMStorageHostMsg_StorageAreaId, | |
50 int64 /* namespace_id */, | |
51 string16 /* origin */, | |
52 int64 /* storage_area_id */) | |
53 | |
54 // Get the length of a storage area. | |
55 IPC_SYNC_MESSAGE_CONTROL1_1(DOMStorageHostMsg_Length, | |
56 int64 /* storage_area_id */, | |
57 unsigned /* length */) | |
58 | |
59 // Get a the ith key within a storage area. | |
60 IPC_SYNC_MESSAGE_CONTROL2_1(DOMStorageHostMsg_Key, | |
61 int64 /* storage_area_id */, | |
62 unsigned /* index */, | |
63 NullableString16 /* key */) | |
64 | |
65 // Get a value based on a key from a storage area. | |
66 IPC_SYNC_MESSAGE_CONTROL2_1(DOMStorageHostMsg_GetItem, | |
67 int64 /* storage_area_id */, | |
68 string16 /* key */, | |
69 NullableString16 /* value */) | |
70 | |
71 // Set a value that's associated with a key in a storage area. | |
72 IPC_SYNC_MESSAGE_CONTROL5_2(DOMStorageHostMsg_SetItem, | |
73 int /* routing_id */, | |
74 int64 /* storage_area_id */, | |
75 string16 /* key */, | |
76 string16 /* value */, | |
77 GURL /* url */, | |
78 WebKit::WebStorageArea::Result /* result */, | |
79 NullableString16 /* old_value */) | |
80 | |
81 // Remove the value associated with a key in a storage area. | |
82 IPC_SYNC_MESSAGE_CONTROL3_1(DOMStorageHostMsg_RemoveItem, | |
83 int64 /* storage_area_id */, | |
84 string16 /* key */, | |
85 GURL /* url */, | |
86 NullableString16 /* old_value */) | |
87 | |
88 // Clear the storage area. | |
89 IPC_SYNC_MESSAGE_CONTROL2_1(DOMStorageHostMsg_Clear, | |
90 int64 /* storage_area_id */, | |
91 GURL /* url */, | |
92 bool /* something_cleared */) | |
93 | |
OLD | NEW |