[email protected] | 37666cf | 2011-03-13 21:51:42 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | 26a9acf | 2010-12-13 19:35:05 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | 83719972 | 2011-03-03 18:15:18 | [diff] [blame] | 5 | // Multiply-included message file, no include guard. |
[email protected] | 26a9acf | 2010-12-13 19:35:05 | [diff] [blame] | 6 | |
| 7 | #include "ipc/ipc_message_macros.h" |
| 8 | #include "ipc/ipc_param_traits.h" |
| 9 | #include "ipc/ipc_platform_file.h" |
| 10 | |
| 11 | #define IPC_MESSAGE_START DatabaseMsgStart |
| 12 | |
| 13 | // Database messages sent from the browser to the renderer. |
| 14 | |
| 15 | // Notifies the child process of the new database size |
[email protected] | db4d4981 | 2011-05-25 00:34:32 | [diff] [blame] | 16 | IPC_MESSAGE_CONTROL3(DatabaseMsg_UpdateSize, |
[email protected] | 5e30159 | 2013-06-18 06:36:05 | [diff] [blame] | 17 | std::string /* the origin */, |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 18 | base::string16 /* the database name */, |
[email protected] | db4d4981 | 2011-05-25 00:34:32 | [diff] [blame] | 19 | int64 /* the new database size */) |
| 20 | |
| 21 | // Notifies the child process of the new space available |
| 22 | IPC_MESSAGE_CONTROL2(DatabaseMsg_UpdateSpaceAvailable, |
[email protected] | 5e30159 | 2013-06-18 06:36:05 | [diff] [blame] | 23 | std::string /* the origin */, |
[email protected] | 26a9acf | 2010-12-13 19:35:05 | [diff] [blame] | 24 | int64 /* space available to origin */) |
| 25 | |
[email protected] | db4d4981 | 2011-05-25 00:34:32 | [diff] [blame] | 26 | // Notifies the child process to reset it's cached value for the origin. |
| 27 | IPC_MESSAGE_CONTROL1(DatabaseMsg_ResetSpaceAvailable, |
[email protected] | 5e30159 | 2013-06-18 06:36:05 | [diff] [blame] | 28 | std::string /* the origin */) |
[email protected] | db4d4981 | 2011-05-25 00:34:32 | [diff] [blame] | 29 | |
[email protected] | 26a9acf | 2010-12-13 19:35:05 | [diff] [blame] | 30 | // Asks the child process to close a database immediately |
| 31 | IPC_MESSAGE_CONTROL2(DatabaseMsg_CloseImmediately, |
[email protected] | 5e30159 | 2013-06-18 06:36:05 | [diff] [blame] | 32 | std::string /* the origin */, |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 33 | base::string16 /* the database name */) |
[email protected] | 26a9acf | 2010-12-13 19:35:05 | [diff] [blame] | 34 | |
| 35 | // Database messages sent from the renderer to the browser. |
| 36 | |
[email protected] | 26a9acf | 2010-12-13 19:35:05 | [diff] [blame] | 37 | // Asks the browser process to open a DB file with the given name. |
| 38 | IPC_SYNC_MESSAGE_CONTROL2_1(DatabaseHostMsg_OpenFile, |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 39 | base::string16 /* vfs file name */, |
[email protected] | 26a9acf | 2010-12-13 19:35:05 | [diff] [blame] | 40 | int /* desired flags */, |
| 41 | IPC::PlatformFileForTransit /* file_handle */) |
| 42 | |
| 43 | // Asks the browser process to delete a DB file |
| 44 | IPC_SYNC_MESSAGE_CONTROL2_1(DatabaseHostMsg_DeleteFile, |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 45 | base::string16 /* vfs file name */, |
[email protected] | 26a9acf | 2010-12-13 19:35:05 | [diff] [blame] | 46 | bool /* whether or not to sync the directory */, |
| 47 | int /* SQLite error code */) |
| 48 | |
| 49 | // Asks the browser process to return the attributes of a DB file |
| 50 | IPC_SYNC_MESSAGE_CONTROL1_1(DatabaseHostMsg_GetFileAttributes, |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 51 | base::string16 /* vfs file name */, |
[email protected] | 26a9acf | 2010-12-13 19:35:05 | [diff] [blame] | 52 | int32 /* the attributes for the given DB file */) |
| 53 | |
| 54 | // Asks the browser process to return the size of a DB file |
| 55 | IPC_SYNC_MESSAGE_CONTROL1_1(DatabaseHostMsg_GetFileSize, |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 56 | base::string16 /* vfs file name */, |
[email protected] | 26a9acf | 2010-12-13 19:35:05 | [diff] [blame] | 57 | int64 /* the size of the given DB file */) |
| 58 | |
[email protected] | db4d4981 | 2011-05-25 00:34:32 | [diff] [blame] | 59 | // Asks the browser process for the amount of space available to an origin |
| 60 | IPC_SYNC_MESSAGE_CONTROL1_1(DatabaseHostMsg_GetSpaceAvailable, |
[email protected] | 5e30159 | 2013-06-18 06:36:05 | [diff] [blame] | 61 | std::string /* origin identifier */, |
[email protected] | db4d4981 | 2011-05-25 00:34:32 | [diff] [blame] | 62 | int64 /* remaining space available */) |
| 63 | |
shess | 10ce3cc | 2015-04-06 18:52:16 | [diff] [blame] | 64 | // Asks the browser set the size of a DB file |
| 65 | IPC_SYNC_MESSAGE_CONTROL2_1(DatabaseHostMsg_SetFileSize, |
| 66 | base::string16 /* vfs file name */, |
| 67 | int64 /* expected size of the given DB file */, |
| 68 | bool /* indicates success */) |
| 69 | |
[email protected] | 26a9acf | 2010-12-13 19:35:05 | [diff] [blame] | 70 | // Notifies the browser process that a new database has been opened |
| 71 | IPC_MESSAGE_CONTROL4(DatabaseHostMsg_Opened, |
[email protected] | 5e30159 | 2013-06-18 06:36:05 | [diff] [blame] | 72 | std::string /* origin identifier */, |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 73 | base::string16 /* database name */, |
| 74 | base::string16 /* database description */, |
[email protected] | 26a9acf | 2010-12-13 19:35:05 | [diff] [blame] | 75 | int64 /* estimated size */) |
| 76 | |
| 77 | // Notifies the browser process that a database might have been modified |
| 78 | IPC_MESSAGE_CONTROL2(DatabaseHostMsg_Modified, |
[email protected] | 5e30159 | 2013-06-18 06:36:05 | [diff] [blame] | 79 | std::string /* origin identifier */, |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 80 | base::string16 /* database name */) |
[email protected] | 26a9acf | 2010-12-13 19:35:05 | [diff] [blame] | 81 | |
| 82 | // Notifies the browser process that a database is about to close |
| 83 | IPC_MESSAGE_CONTROL2(DatabaseHostMsg_Closed, |
[email protected] | 5e30159 | 2013-06-18 06:36:05 | [diff] [blame] | 84 | std::string /* origin identifier */, |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 85 | base::string16 /* database name */) |
[email protected] | 26a9acf | 2010-12-13 19:35:05 | [diff] [blame] | 86 | |
[email protected] | 1f1db25 | 2012-02-18 01:04:14 | [diff] [blame] | 87 | // Sent when a sqlite error indicates the database is corrupt. |
| 88 | IPC_MESSAGE_CONTROL3(DatabaseHostMsg_HandleSqliteError, |
[email protected] | 5e30159 | 2013-06-18 06:36:05 | [diff] [blame] | 89 | std::string /* origin identifier */, |
[email protected] | fcf75d4 | 2013-12-03 20:11:26 | [diff] [blame] | 90 | base::string16 /* database name */, |
[email protected] | 1f1db25 | 2012-02-18 01:04:14 | [diff] [blame] | 91 | int /* error */) |