OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 include guard. | 5 // Multiply-included message file, no include guard. |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "ipc/ipc_message_macros.h" | 9 #include "ipc/ipc_message_macros.h" |
10 #include "ipc/ipc_param_traits.h" | 10 #include "ipc/ipc_param_traits.h" |
11 #include "ipc/ipc_platform_file.h" | 11 #include "ipc/ipc_platform_file.h" |
| 12 #include "url/origin.h" |
12 | 13 |
13 #define IPC_MESSAGE_START DatabaseMsgStart | 14 #define IPC_MESSAGE_START DatabaseMsgStart |
14 | 15 |
15 // Database messages sent from the browser to the renderer. | 16 // Database messages sent from the browser to the renderer. |
16 | 17 |
17 // Notifies the child process of the new database size | 18 // Notifies the child process of the new database size |
18 IPC_MESSAGE_CONTROL3(DatabaseMsg_UpdateSize, | 19 IPC_MESSAGE_CONTROL3(DatabaseMsg_UpdateSize, |
19 std::string /* the origin */, | 20 url::Origin /* the origin */, |
20 base::string16 /* the database name */, | 21 base::string16 /* the database name */, |
21 int64_t /* the new database size */) | 22 int64_t /* the new database size */) |
22 | 23 |
23 // Notifies the child process of the new space available | 24 // Notifies the child process of the new space available |
24 IPC_MESSAGE_CONTROL2(DatabaseMsg_UpdateSpaceAvailable, | 25 IPC_MESSAGE_CONTROL2(DatabaseMsg_UpdateSpaceAvailable, |
25 std::string /* the origin */, | 26 url::Origin /* the origin */, |
26 int64_t /* space available to origin */) | 27 int64_t /* space available to origin */) |
27 | 28 |
28 // Notifies the child process to reset it's cached value for the origin. | 29 // Notifies the child process to reset it's cached value for the origin. |
29 IPC_MESSAGE_CONTROL1(DatabaseMsg_ResetSpaceAvailable, | 30 IPC_MESSAGE_CONTROL1(DatabaseMsg_ResetSpaceAvailable, |
30 std::string /* the origin */) | 31 url::Origin /* the origin */) |
31 | 32 |
32 // Asks the child process to close a database immediately | 33 // Asks the child process to close a database immediately |
33 IPC_MESSAGE_CONTROL2(DatabaseMsg_CloseImmediately, | 34 IPC_MESSAGE_CONTROL2(DatabaseMsg_CloseImmediately, |
34 std::string /* the origin */, | 35 url::Origin /* the origin */, |
35 base::string16 /* the database name */) | 36 base::string16 /* the database name */) |
36 | 37 |
37 // Database messages sent from the renderer to the browser. | 38 // Database messages sent from the renderer to the browser. |
38 | 39 |
39 // Asks the browser process to open a DB file with the given name. | 40 // Asks the browser process to open a DB file with the given name. |
40 IPC_SYNC_MESSAGE_CONTROL2_1(DatabaseHostMsg_OpenFile, | 41 IPC_SYNC_MESSAGE_CONTROL2_1(DatabaseHostMsg_OpenFile, |
41 base::string16 /* vfs file name */, | 42 base::string16 /* vfs file name */, |
42 int /* desired flags */, | 43 int /* desired flags */, |
43 IPC::PlatformFileForTransit /* file_handle */) | 44 IPC::PlatformFileForTransit /* file_handle */) |
44 | 45 |
45 // Asks the browser process to delete a DB file | 46 // Asks the browser process to delete a DB file |
46 IPC_SYNC_MESSAGE_CONTROL2_1(DatabaseHostMsg_DeleteFile, | 47 IPC_SYNC_MESSAGE_CONTROL2_1(DatabaseHostMsg_DeleteFile, |
47 base::string16 /* vfs file name */, | 48 base::string16 /* vfs file name */, |
48 bool /* whether or not to sync the directory */, | 49 bool /* whether or not to sync the directory */, |
49 int /* SQLite error code */) | 50 int /* SQLite error code */) |
50 | 51 |
51 // Asks the browser process to return the attributes of a DB file | 52 // Asks the browser process to return the attributes of a DB file |
52 IPC_SYNC_MESSAGE_CONTROL1_1(DatabaseHostMsg_GetFileAttributes, | 53 IPC_SYNC_MESSAGE_CONTROL1_1(DatabaseHostMsg_GetFileAttributes, |
53 base::string16 /* vfs file name */, | 54 base::string16 /* vfs file name */, |
54 int32_t /* the attributes for the given DB file */) | 55 int32_t /* the attributes for the given DB file */) |
55 | 56 |
56 // Asks the browser process to return the size of a DB file | 57 // Asks the browser process to return the size of a DB file |
57 IPC_SYNC_MESSAGE_CONTROL1_1(DatabaseHostMsg_GetFileSize, | 58 IPC_SYNC_MESSAGE_CONTROL1_1(DatabaseHostMsg_GetFileSize, |
58 base::string16 /* vfs file name */, | 59 base::string16 /* vfs file name */, |
59 int64_t /* the size of the given DB file */) | 60 int64_t /* the size of the given DB file */) |
60 | 61 |
61 // Asks the browser process for the amount of space available to an origin | 62 // Asks the browser process for the amount of space available to an origin |
62 IPC_SYNC_MESSAGE_CONTROL1_1(DatabaseHostMsg_GetSpaceAvailable, | 63 IPC_SYNC_MESSAGE_CONTROL1_1(DatabaseHostMsg_GetSpaceAvailable, |
63 std::string /* origin identifier */, | 64 url::Origin /* origin */, |
64 int64_t /* remaining space available */) | 65 int64_t /* remaining space available */) |
65 | 66 |
66 // Asks the browser set the size of a DB file | 67 // Asks the browser set the size of a DB file |
67 IPC_SYNC_MESSAGE_CONTROL2_1(DatabaseHostMsg_SetFileSize, | 68 IPC_SYNC_MESSAGE_CONTROL2_1(DatabaseHostMsg_SetFileSize, |
68 base::string16 /* vfs file name */, | 69 base::string16 /* vfs file name */, |
69 int64_t /* expected size of the given DB file */, | 70 int64_t /* expected size of the given DB file */, |
70 bool /* indicates success */) | 71 bool /* indicates success */) |
71 | 72 |
72 // Notifies the browser process that a new database has been opened | 73 // Notifies the browser process that a new database has been opened |
73 IPC_MESSAGE_CONTROL4(DatabaseHostMsg_Opened, | 74 IPC_MESSAGE_CONTROL4(DatabaseHostMsg_Opened, |
74 std::string /* origin identifier */, | 75 url::Origin /* origin */, |
75 base::string16 /* database name */, | 76 base::string16 /* database name */, |
76 base::string16 /* database description */, | 77 base::string16 /* database description */, |
77 int64_t /* estimated size */) | 78 int64_t /* estimated size */) |
78 | 79 |
79 // Notifies the browser process that a database might have been modified | 80 // Notifies the browser process that a database might have been modified |
80 IPC_MESSAGE_CONTROL2(DatabaseHostMsg_Modified, | 81 IPC_MESSAGE_CONTROL2(DatabaseHostMsg_Modified, |
81 std::string /* origin identifier */, | 82 url::Origin /* origin */, |
82 base::string16 /* database name */) | 83 base::string16 /* database name */) |
83 | 84 |
84 // Notifies the browser process that a database is about to close | 85 // Notifies the browser process that a database is about to close |
85 IPC_MESSAGE_CONTROL2(DatabaseHostMsg_Closed, | 86 IPC_MESSAGE_CONTROL2(DatabaseHostMsg_Closed, |
86 std::string /* origin identifier */, | 87 url::Origin /* origin */, |
87 base::string16 /* database name */) | 88 base::string16 /* database name */) |
88 | 89 |
89 // Sent when a sqlite error indicates the database is corrupt. | 90 // Sent when a sqlite error indicates the database is corrupt. |
90 IPC_MESSAGE_CONTROL3(DatabaseHostMsg_HandleSqliteError, | 91 IPC_MESSAGE_CONTROL3(DatabaseHostMsg_HandleSqliteError, |
91 std::string /* origin identifier */, | 92 url::Origin /* origin */, |
92 base::string16 /* database name */, | 93 base::string16 /* database name */, |
93 int /* error */) | 94 int /* error */) |
OLD | NEW |