Index: components/safe_json_parser/safe_json_parser_messages.h |
diff --git a/components/safe_json_parser/safe_json_parser_messages.h b/components/safe_json_parser/safe_json_parser_messages.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3c1e25d910318459346c776aef61cb1951b6cea2 |
--- /dev/null |
+++ b/components/safe_json_parser/safe_json_parser_messages.h |
@@ -0,0 +1,37 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// Message definition file, included multiple times, hence no include guard. |
+ |
+#include <string> |
+#include <vector> |
+ |
+#include "base/strings/string16.h" |
+#include "content/public/common/common_param_traits.h" |
+#include "content/public/common/common_param_traits_macros.h" |
+#include "ipc/ipc_message_macros.h" |
+#include "ipc/ipc_message_utils.h" |
+ |
+//#ifndef COMPONENTS_SAFE_JSON_PARSER_SAFE_JSON_PARSER_MESSAGES_H_ |
Robert Sesek
2015/05/14 20:12:34
Remove.
Eran Messeri
2015/05/15 12:52:41
Done.
|
+//#define COMPONENTS_SAFE_JSON_PARSER_SAFE_JSON_PARSER_MESSAGES_H_ |
+ |
+#define IPC_MESSAGE_START SafeJsonParserMsgStart |
+ |
+// Tell the utility process to parse a JSON string into a Value object. |
+IPC_MESSAGE_CONTROL1(SafeJsonParserMsg_ParseJSON, |
+ std::string /* JSON to parse */) |
+ |
Robert Sesek
2015/05/14 20:12:34
Put a banner comment here, to separate request fro
Eran Messeri
2015/05/15 12:52:41
Done.
|
+// Reply when the utility process successfully parsed a JSON string. |
+// |
+// WARNING: The result can be of any Value subclass type, but we can't easily |
+// pass indeterminate value types by const object reference with our IPC macros, |
+// so we put the result Value into a ListValue. Handlers should examine the |
+// first (and only) element of the ListValue for the actual result. |
+IPC_MESSAGE_CONTROL1(SafeJsonParserHostMsg_ParseJSON_Succeeded, base::ListValue) |
+ |
+// Reply when the utility process failed in parsing a JSON string. |
+IPC_MESSAGE_CONTROL1(SafeJsonParserHostMsg_ParseJSON_Failed, |
+ std::string /* error message, if any*/) |
+ |
+//#endif |