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

Side by Side Diff: extensions/common/extension_utility_messages.h

Issue 2697463002: Convert utility process extension Unpacker IPC to mojo (Closed)
Patch Set: Take #4, declare the IPC enum traits in the message file, try build fix. Created 3 years, 9 months 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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, so no include guard. 5 // Multiply-included message file, so no include guard.
6 6
7 #include <string> 7 #include <string>
8 #include <tuple>
9 8
9 #include "extensions/common/manifest.h"
10 #include "extensions/common/update_manifest.h" 10 #include "extensions/common/update_manifest.h"
11 #include "ipc/ipc_message_macros.h" 11 #include "ipc/ipc_message_macros.h"
12 #include "third_party/skia/include/core/SkBitmap.h" 12 #include "ipc/param_traits_macros.h"
13 #include "ui/gfx/ipc/skia/gfx_skia_param_traits.h"
14 #include "url/ipc/url_param_traits.h" 13 #include "url/ipc/url_param_traits.h"
15 14
16 #define IPC_MESSAGE_START ExtensionUtilityMsgStart 15 #define IPC_MESSAGE_START ExtensionUtilityMsgStart
17 16
18 #ifndef EXTENSIONS_COMMON_EXTENSION_UTILITY_MESSAGES_H_ 17 IPC_ENUM_TRAITS_MIN_MAX_VALUE(extensions::Manifest::Location,
19 #define EXTENSIONS_COMMON_EXTENSION_UTILITY_MESSAGES_H_ 18 extensions::Manifest::INVALID_LOCATION,
20 19 extensions::Manifest::NUM_LOCATIONS)
dcheng 2017/03/10 02:51:04 Also, this should be NUM_LOCATIONS - 1, since NUM_
21 using DecodedImages = std::vector<std::tuple<SkBitmap, base::FilePath>>;
22
23 #endif // EXTENSIONS_COMMON_EXTENSION_UTILITY_MESSAGES_H_
24 20
25 IPC_STRUCT_TRAITS_BEGIN(UpdateManifest::Result) 21 IPC_STRUCT_TRAITS_BEGIN(UpdateManifest::Result)
26 IPC_STRUCT_TRAITS_MEMBER(extension_id) 22 IPC_STRUCT_TRAITS_MEMBER(extension_id)
27 IPC_STRUCT_TRAITS_MEMBER(version) 23 IPC_STRUCT_TRAITS_MEMBER(version)
28 IPC_STRUCT_TRAITS_MEMBER(browser_min_version) 24 IPC_STRUCT_TRAITS_MEMBER(browser_min_version)
29 IPC_STRUCT_TRAITS_MEMBER(package_hash) 25 IPC_STRUCT_TRAITS_MEMBER(package_hash)
30 IPC_STRUCT_TRAITS_MEMBER(crx_url) 26 IPC_STRUCT_TRAITS_MEMBER(crx_url)
31 IPC_STRUCT_TRAITS_END() 27 IPC_STRUCT_TRAITS_END()
32 28
33 IPC_STRUCT_TRAITS_BEGIN(UpdateManifest::Results) 29 IPC_STRUCT_TRAITS_BEGIN(UpdateManifest::Results)
34 IPC_STRUCT_TRAITS_MEMBER(list) 30 IPC_STRUCT_TRAITS_MEMBER(list)
35 IPC_STRUCT_TRAITS_MEMBER(daystart_elapsed_seconds) 31 IPC_STRUCT_TRAITS_MEMBER(daystart_elapsed_seconds)
36 IPC_STRUCT_TRAITS_END() 32 IPC_STRUCT_TRAITS_END()
37 33
38 //------------------------------------------------------------------------------ 34 //------------------------------------------------------------------------------
39 // Utility process messages: 35 // Utility process messages:
40 // These are messages from the browser to the utility process. 36 // These are messages from the browser to the utility process.
41 37
42 // Tell the utility process to parse the given xml document. 38 // Tell the utility process to parse the given xml document.
43 IPC_MESSAGE_CONTROL1(ExtensionUtilityMsg_ParseUpdateManifest, 39 IPC_MESSAGE_CONTROL1(ExtensionUtilityMsg_ParseUpdateManifest,
44 std::string /* xml document contents */) 40 std::string /* xml document contents */)
45 41
46 // Tell the utility process to unzip the zipfile at a given path into a
47 // directory at the second given path.
48 IPC_MESSAGE_CONTROL2(ExtensionUtilityMsg_UnzipToDir,
49 base::FilePath /* zip_file */,
50 base::FilePath /* dir */)
51
52 // Tells the utility process to validate and sanitize the extension in a
53 // directory.
54 IPC_MESSAGE_CONTROL4(ExtensionUtilityMsg_UnpackExtension,
55 base::FilePath /* directory_path */,
56 std::string /* extension_id */,
57 int /* Manifest::Location */,
58 int /* InitFromValue flags */)
59
60 //------------------------------------------------------------------------------ 42 //------------------------------------------------------------------------------
61 // Utility process host messages: 43 // Utility process host messages:
62 // These are messages from the utility process to the browser. 44 // These are messages from the utility process to the browser.
63 45
64 // Reply when the utility process has succeeded in parsing an update manifest 46 // Reply when the utility process has succeeded in parsing an update manifest
65 // xml document. 47 // xml document.
66 IPC_MESSAGE_CONTROL1(ExtensionUtilityHostMsg_ParseUpdateManifest_Succeeded, 48 IPC_MESSAGE_CONTROL1(ExtensionUtilityHostMsg_ParseUpdateManifest_Succeeded,
67 UpdateManifest::Results /* updates */) 49 UpdateManifest::Results /* updates */)
68 50
69 // Reply when an error occurred parsing the update manifest. |error_message| 51 // Reply when an error occurred parsing the update manifest. |error_message|
70 // is a description of what went wrong suitable for logging. 52 // is a description of what went wrong suitable for logging.
71 IPC_MESSAGE_CONTROL1(ExtensionUtilityHostMsg_ParseUpdateManifest_Failed, 53 IPC_MESSAGE_CONTROL1(ExtensionUtilityHostMsg_ParseUpdateManifest_Failed,
72 std::string /* error_message, if any */) 54 std::string /* error_message, if any */)
73
74 // Reply when the utility process is done unzipping a file. |unpacked_path|
75 // is the directory which contains the unzipped contents.
76 IPC_MESSAGE_CONTROL1(ExtensionUtilityHostMsg_UnzipToDir_Succeeded,
77 base::FilePath /* unpacked_path */)
78
79 // Reply when the utility process failed to unzip a file. |error| contains
80 // an error string to be reported to the user.
81 IPC_MESSAGE_CONTROL1(ExtensionUtilityHostMsg_UnzipToDir_Failed,
82 std::string /* error */)
83
84 // Reply when the utility process is done unpacking an extension. |manifest|
85 // is the parsed manifest.json file.
86 // The unpacker should also have written out files containing the decoded
87 // images and message catalogs from the extension. The data is written into a
88 // DecodedImages struct into a file named kDecodedImagesFilename in the
89 // directory that was passed in. This is done because the data is too large to
90 // pass over IPC.
91 IPC_MESSAGE_CONTROL1(ExtensionUtilityHostMsg_UnpackExtension_Succeeded,
92 base::DictionaryValue /* manifest */)
93
94 // Reply when the utility process has failed while unpacking an extension.
95 // |error_message| is a user-displayable explanation of what went wrong.
96 IPC_MESSAGE_CONTROL1(ExtensionUtilityHostMsg_UnpackExtension_Failed,
97 base::string16 /* error_message, if any */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698