| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/safe_json_parser/safe_json_parser.h" | 5 #include "components/safe_json/safe_json_parser.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| 11 #include "base/tuple.h" | 11 #include "base/tuple.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "components/safe_json_parser/safe_json_parser_messages.h" | 13 #include "components/safe_json/safe_json_parser_messages.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 #include "content/public/browser/utility_process_host.h" | 15 #include "content/public/browser/utility_process_host.h" |
| 16 #include "grit/components_strings.h" | 16 #include "grit/components_strings.h" |
| 17 #include "ipc/ipc_message_macros.h" | 17 #include "ipc/ipc_message_macros.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| 19 | 19 |
| 20 using content::BrowserThread; | 20 using content::BrowserThread; |
| 21 using content::UtilityProcessHost; | 21 using content::UtilityProcessHost; |
| 22 | 22 |
| 23 namespace safe_json_parser { | 23 namespace safe_json { |
| 24 | 24 |
| 25 SafeJsonParser::SafeJsonParser(const std::string& unsafe_json, | 25 SafeJsonParser::SafeJsonParser(const std::string& unsafe_json, |
| 26 const SuccessCallback& success_callback, | 26 const SuccessCallback& success_callback, |
| 27 const ErrorCallback& error_callback) | 27 const ErrorCallback& error_callback) |
| 28 : unsafe_json_(unsafe_json), | 28 : unsafe_json_(unsafe_json), |
| 29 success_callback_(success_callback), | 29 success_callback_(success_callback), |
| 30 error_callback_(error_callback) { | 30 error_callback_(error_callback) { |
| 31 } | 31 } |
| 32 | 32 |
| 33 void SafeJsonParser::Start() { | 33 void SafeJsonParser::Start() { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 IPC_BEGIN_MESSAGE_MAP(SafeJsonParser, message) | 88 IPC_BEGIN_MESSAGE_MAP(SafeJsonParser, message) |
| 89 IPC_MESSAGE_HANDLER(SafeJsonParserHostMsg_ParseJSON_Succeeded, | 89 IPC_MESSAGE_HANDLER(SafeJsonParserHostMsg_ParseJSON_Succeeded, |
| 90 OnJSONParseSucceeded) | 90 OnJSONParseSucceeded) |
| 91 IPC_MESSAGE_HANDLER(SafeJsonParserHostMsg_ParseJSON_Failed, | 91 IPC_MESSAGE_HANDLER(SafeJsonParserHostMsg_ParseJSON_Failed, |
| 92 OnJSONParseFailed) | 92 OnJSONParseFailed) |
| 93 IPC_MESSAGE_UNHANDLED(handled = false) | 93 IPC_MESSAGE_UNHANDLED(handled = false) |
| 94 IPC_END_MESSAGE_MAP() | 94 IPC_END_MESSAGE_MAP() |
| 95 return handled; | 95 return handled; |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace safe_json_parser | 98 } // namespace safe_json |
| OLD | NEW |