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

Unified Diff: chrome/utility/chrome_content_utility_client.cc

Issue 1140053003: Refactoring: Moving the SafeJsonParser to its own component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Catching up with WebstoreInstallHelper changes Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/utility/chrome_content_utility_client.h ('k') | chrome/utility/safe_json_parser_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/chrome_content_utility_client.cc
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc
index 6b92765c242ba42799f61c81fc3c35829522738e..700e6a0d67bf4c1183e3c5261c5b001164d516e7 100644
--- a/chrome/utility/chrome_content_utility_client.cc
+++ b/chrome/utility/chrome_content_utility_client.cc
@@ -6,13 +6,13 @@
#include "base/command_line.h"
#include "base/files/file_path.h"
-#include "base/json/json_reader.h"
#include "base/memory/ref_counted.h"
#include "base/time/time.h"
#include "chrome/common/chrome_utility_messages.h"
#include "chrome/common/safe_browsing/zip_analyzer.h"
#include "chrome/common/safe_browsing/zip_analyzer_results.h"
#include "chrome/utility/chrome_content_utility_ipc_whitelist.h"
+#include "chrome/utility/safe_json_parser_handler.h"
#include "chrome/utility/utility_message_handler.h"
#include "content/public/child/image_decoder_utils.h"
#include "content/public/common/content_switches.h"
@@ -154,6 +154,8 @@ ChromeContentUtilityClient::ChromeContentUtilityClient()
handlers_.push_back(new ShellHandler());
handlers_.push_back(new FontCacheHandler());
#endif
+
+ handlers_.push_back(new SafeJsonParserHandler());
}
ChromeContentUtilityClient::~ChromeContentUtilityClient() {
@@ -186,7 +188,6 @@ bool ChromeContentUtilityClient::OnMessageReceived(
IPC_MESSAGE_HANDLER(ChromeUtilityMsg_RobustJPEGDecodeImage,
OnRobustJPEGDecodeImage)
#endif // defined(OS_CHROMEOS)
- IPC_MESSAGE_HANDLER(ChromeUtilityMsg_ParseJSON, OnParseJSON)
IPC_MESSAGE_HANDLER(ChromeUtilityMsg_PatchFileBsdiff,
OnPatchFileBsdiff)
IPC_MESSAGE_HANDLER(ChromeUtilityMsg_PatchFileCourgette,
@@ -369,21 +370,6 @@ void ChromeContentUtilityClient::OnRobustJPEGDecodeImage(
}
#endif // defined(OS_CHROMEOS)
-void ChromeContentUtilityClient::OnParseJSON(const std::string& json) {
- int error_code;
- std::string error;
- scoped_ptr<base::Value> value = base::JSONReader::ReadAndReturnError(
- json, base::JSON_PARSE_RFC, &error_code, &error);
- if (value) {
- base::ListValue wrapper;
- wrapper.Append(value.Pass());
- Send(new ChromeUtilityHostMsg_ParseJSON_Succeeded(wrapper));
- } else {
- Send(new ChromeUtilityHostMsg_ParseJSON_Failed(error));
- }
- ReleaseProcessIfNeeded();
-}
-
void ChromeContentUtilityClient::OnPatchFileBsdiff(
const base::FilePath& input_file,
const base::FilePath& patch_file,
« no previous file with comments | « chrome/utility/chrome_content_utility_client.h ('k') | chrome/utility/safe_json_parser_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698