Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: chrome/common/utility_messages_internal.h

Issue 5526008: Simplify the magic required to create IPC message headers a bit. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/utility_messages.cc ('k') | chrome/common/worker_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 // This header is meant to be included in multiple passes, hence no traditional
9 // header guard. It is included by utility_messages_internal.h
10 // See ipc_message_macros.h for explanation of the macros and passes.
11
12 // This file needs to be included again, even though we're actually included
13 // from it via utility_messages.h.
14 #include "ipc/ipc_message_macros.h"
15
16 #include "base/platform_file.h" 8 #include "base/platform_file.h"
17 #include "gfx/rect.h" 9 #include "gfx/rect.h"
10 #include "ipc/ipc_message_macros.h"
18 #include "printing/page_range.h" 11 #include "printing/page_range.h"
12 #include "third_party/skia/include/core/SkBitmap.h"
13
14 #define IPC_MESSAGE_START NaClMsgStart
19 15
20 class FilePath; 16 class FilePath;
21 class IndexedDBKey; 17 class IndexedDBKey;
22 class SerializedScriptValue; 18 class SerializedScriptValue;
23 class SkBitmap; 19 class SkBitmap;
24 20
25 //------------------------------------------------------------------------------ 21 //------------------------------------------------------------------------------
26 // Utility process messages: 22 // Utility process messages:
27 // These are messages from the browser to the utility process. 23 // These are messages from the browser to the utility process.
28 IPC_BEGIN_MESSAGES(Utility) 24 // Tell the utility process to unpack the given extension file in its
25 // directory and verify that it is valid.
26 IPC_MESSAGE_CONTROL1(UtilityMsg_UnpackExtension,
27 FilePath /* extension_filename */)
29 28
30 // Tell the utility process to unpack the given extension file in its 29 // Tell the utility process to parse the given JSON data and verify its
31 // directory and verify that it is valid. 30 // validity.
32 IPC_MESSAGE_CONTROL1(UtilityMsg_UnpackExtension, 31 IPC_MESSAGE_CONTROL1(UtilityMsg_UnpackWebResource,
33 FilePath /* extension_filename */) 32 std::string /* JSON data */)
34 33
35 // Tell the utility process to parse the given JSON data and verify its 34 // Tell the utility process to parse the given xml document.
36 // validity. 35 IPC_MESSAGE_CONTROL1(UtilityMsg_ParseUpdateManifest,
37 IPC_MESSAGE_CONTROL1(UtilityMsg_UnpackWebResource, 36 std::string /* xml document contents */)
38 std::string /* JSON data */)
39 37
40 // Tell the utility process to parse the given xml document. 38 // Tell the utility process to decode the given image data.
41 IPC_MESSAGE_CONTROL1(UtilityMsg_ParseUpdateManifest, 39 IPC_MESSAGE_CONTROL1(UtilityMsg_DecodeImage,
42 std::string /* xml document contents */) 40 std::vector<unsigned char>) // encoded image contents
43 41
44 // Tell the utility process to decode the given image data. 42 // Tell the utility process to render the given PDF into a metafile.
45 IPC_MESSAGE_CONTROL1(UtilityMsg_DecodeImage, 43 IPC_MESSAGE_CONTROL5(UtilityMsg_RenderPDFPagesToMetafile,
46 std::vector<unsigned char>) // encoded image contents 44 base::PlatformFile, // PDF file
45 FilePath, // Location for output metafile
46 gfx::Rect, // Render Area
47 int, // DPI
48 std::vector<printing::PageRange>)
47 49
48 // Tell the utility process to render the given PDF into a metafile. 50 // Tell the utility process to extract the given IDBKeyPath from the
49 IPC_MESSAGE_CONTROL5(UtilityMsg_RenderPDFPagesToMetafile, 51 // SerializedScriptValue vector and reply with the corresponding IDBKeys.
50 base::PlatformFile, // PDF file 52 IPC_MESSAGE_CONTROL3(UtilityMsg_IDBKeysFromValuesAndKeyPath,
51 FilePath, // Location for output metafile 53 int, // id
52 gfx::Rect, // Render Area 54 std::vector<SerializedScriptValue>,
53 int, // DPI 55 string16) // IDBKeyPath
54 std::vector<printing::PageRange>)
55 56
56 // Tell the utility process to extract the given IDBKeyPath from the 57 // Tells the utility process that it's running in batch mode.
57 // SerializedScriptValue vector and reply with the corresponding IDBKeys. 58 IPC_MESSAGE_CONTROL0(UtilityMsg_BatchMode_Started)
58 IPC_MESSAGE_CONTROL3(UtilityMsg_IDBKeysFromValuesAndKeyPath,
59 int, // id
60 std::vector<SerializedScriptValue>,
61 string16) // IDBKeyPath
62 59
63 // Tells the utility process that it's running in batch mode. 60 // Tells the utility process that it can shutdown.
64 IPC_MESSAGE_CONTROL0(UtilityMsg_BatchMode_Started) 61 IPC_MESSAGE_CONTROL0(UtilityMsg_BatchMode_Finished)
65
66 // Tells the utility process that it can shutdown.
67 IPC_MESSAGE_CONTROL0(UtilityMsg_BatchMode_Finished)
68
69 IPC_END_MESSAGES(Utility)
70 62
71 //------------------------------------------------------------------------------ 63 //------------------------------------------------------------------------------
72 // Utility process host messages: 64 // Utility process host messages:
73 // These are messages from the utility process to the browser. 65 // These are messages from the utility process to the browser.
74 IPC_BEGIN_MESSAGES(UtilityHost) 66 // Reply when the utility process is done unpacking an extension. |manifest|
67 // is the parsed manifest.json file.
68 // The unpacker should also have written out files containing the decoded
69 // images and message catalogs from the extension. See ExtensionUnpacker for
70 // details.
71 IPC_MESSAGE_CONTROL1(UtilityHostMsg_UnpackExtension_Succeeded,
72 DictionaryValue /* manifest */)
75 73
76 // Reply when the utility process is done unpacking an extension. |manifest| 74 // Reply when the utility process has failed while unpacking an extension.
77 // is the parsed manifest.json file. 75 // |error_message| is a user-displayable explanation of what went wrong.
78 // The unpacker should also have written out files containing the decoded 76 IPC_MESSAGE_CONTROL1(UtilityHostMsg_UnpackExtension_Failed,
79 // images and message catalogs from the extension. See ExtensionUnpacker for 77 std::string /* error_message, if any */)
80 // details.
81 IPC_MESSAGE_CONTROL1(UtilityHostMsg_UnpackExtension_Succeeded,
82 DictionaryValue /* manifest */)
83 78
84 // Reply when the utility process has failed while unpacking an extension. 79 // Reply when the utility process is done unpacking and parsing JSON data
85 // |error_message| is a user-displayable explanation of what went wrong. 80 // from a web resource.
86 IPC_MESSAGE_CONTROL1(UtilityHostMsg_UnpackExtension_Failed, 81 IPC_MESSAGE_CONTROL1(UtilityHostMsg_UnpackWebResource_Succeeded,
87 std::string /* error_message, if any */) 82 DictionaryValue /* json data */)
88 83
89 // Reply when the utility process is done unpacking and parsing JSON data 84 // Reply when the utility process has failed while unpacking and parsing a
90 // from a web resource. 85 // web resource. |error_message| is a user-readable explanation of what
91 IPC_MESSAGE_CONTROL1(UtilityHostMsg_UnpackWebResource_Succeeded, 86 // went wrong.
92 DictionaryValue /* json data */) 87 IPC_MESSAGE_CONTROL1(UtilityHostMsg_UnpackWebResource_Failed,
88 std::string /* error_message, if any */)
93 89
94 // Reply when the utility process has failed while unpacking and parsing a 90 // Reply when the utility process has succeeded in parsing an update manifest
95 // web resource. |error_message| is a user-readable explanation of what 91 // xml document.
96 // went wrong. 92 IPC_MESSAGE_CONTROL1(UtilityHostMsg_ParseUpdateManifest_Succeeded,
97 IPC_MESSAGE_CONTROL1(UtilityHostMsg_UnpackWebResource_Failed, 93 UpdateManifest::Results /* updates */)
98 std::string /* error_message, if any */)
99 94
100 // Reply when the utility process has succeeded in parsing an update manifest 95 // Reply when an error occured parsing the update manifest. |error_message|
101 // xml document. 96 // is a description of what went wrong suitable for logging.
102 IPC_MESSAGE_CONTROL1(UtilityHostMsg_ParseUpdateManifest_Succeeded, 97 IPC_MESSAGE_CONTROL1(UtilityHostMsg_ParseUpdateManifest_Failed,
103 UpdateManifest::Results /* updates */) 98 std::string /* error_message, if any */)
104 99
105 // Reply when an error occured parsing the update manifest. |error_message| 100 // Reply when the utility process has succeeded in decoding the image.
106 // is a description of what went wrong suitable for logging. 101 IPC_MESSAGE_CONTROL1(UtilityHostMsg_DecodeImage_Succeeded,
107 IPC_MESSAGE_CONTROL1(UtilityHostMsg_ParseUpdateManifest_Failed, 102 SkBitmap) // decoded image
108 std::string /* error_message, if any */)
109 103
110 // Reply when the utility process has succeeded in decoding the image. 104 // Reply when an error occured decoding the image.
111 IPC_MESSAGE_CONTROL1(UtilityHostMsg_DecodeImage_Succeeded, 105 IPC_MESSAGE_CONTROL0(UtilityHostMsg_DecodeImage_Failed)
112 SkBitmap) // decoded image
113 106
114 // Reply when an error occured decoding the image. 107 // Reply when the utility process has succeeded in rendering the PDF.
115 IPC_MESSAGE_CONTROL0(UtilityHostMsg_DecodeImage_Failed) 108 IPC_MESSAGE_CONTROL1(UtilityHostMsg_RenderPDFPagesToMetafile_Succeeded,
109 int) // Highest rendered page number
116 110
117 // Reply when the utility process has succeeded in rendering the PDF. 111 // Reply when an error occured rendering the PDF.
118 IPC_MESSAGE_CONTROL1(UtilityHostMsg_RenderPDFPagesToMetafile_Succeeded, 112 IPC_MESSAGE_CONTROL0(UtilityHostMsg_RenderPDFPagesToMetafile_Failed)
119 int) // Highest rendered page number
120
121 // Reply when an error occured rendering the PDF.
122 IPC_MESSAGE_CONTROL0(UtilityHostMsg_RenderPDFPagesToMetafile_Failed)
123 113
124 #if defined(OS_WIN) 114 #if defined(OS_WIN)
125 // Request that the given font be loaded by the host so it's cached by the 115 // Request that the given font be loaded by the host so it's cached by the
126 // OS. Please see ChildProcessHost::PreCacheFont for details. 116 // OS. Please see ChildProcessHost::PreCacheFont for details.
127 IPC_SYNC_MESSAGE_CONTROL1_0(UtilityHostMsg_PreCacheFont, 117 IPC_SYNC_MESSAGE_CONTROL1_0(UtilityHostMsg_PreCacheFont,
128 LOGFONT /* font data */) 118 LOGFONT /* font data */)
129 #endif // defined(OS_WIN) 119 #endif // defined(OS_WIN)
130 120
131 // Reply when the utility process has succeeded in obtaining the value for 121 // Reply when the utility process has succeeded in obtaining the value for
132 // IDBKeyPath. 122 // IDBKeyPath.
133 IPC_MESSAGE_CONTROL2(UtilityHostMsg_IDBKeysFromValuesAndKeyPath_Succeeded, 123 IPC_MESSAGE_CONTROL2(UtilityHostMsg_IDBKeysFromValuesAndKeyPath_Succeeded,
134 int /* id */, 124 int /* id */,
135 std::vector<IndexedDBKey> /* value */) 125 std::vector<IndexedDBKey> /* value */)
136 126
137 // Reply when the utility process has failed in obtaining the value for 127 // Reply when the utility process has failed in obtaining the value for
138 // IDBKeyPath. 128 // IDBKeyPath.
139 IPC_MESSAGE_CONTROL1(UtilityHostMsg_IDBKeysFromValuesAndKeyPath_Failed, 129 IPC_MESSAGE_CONTROL1(UtilityHostMsg_IDBKeysFromValuesAndKeyPath_Failed,
140 int /* id */) 130 int /* id */)
141
142 IPC_END_MESSAGES(UtilityHost)
OLDNEW
« no previous file with comments | « chrome/common/utility_messages.cc ('k') | chrome/common/worker_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698