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

Unified Diff: components/safe_json_parser/safe_json_parser.h

Issue 1140053003: Refactoring: Moving the SafeJsonParser to its own component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Localized string, build fixes 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
Index: components/safe_json_parser/safe_json_parser.h
diff --git a/chrome/browser/safe_json_parser.h b/components/safe_json_parser/safe_json_parser.h
similarity index 80%
rename from chrome/browser/safe_json_parser.h
rename to components/safe_json_parser/safe_json_parser.h
index 67ca5479adc5f5f71bd2551d7c804685ef624520..94736dfbb8fcea1668d792dd63a06840c4779702 100644
--- a/chrome/browser/safe_json_parser.h
+++ b/components/safe_json_parser/safe_json_parser.h
@@ -2,14 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_SAFE_JSON_PARSER_H_
-#define CHROME_BROWSER_SAFE_JSON_PARSER_H_
+#ifndef COMPONENTS_SAFE_JSON_PARSER_SAFE_JSON_PARSER_H_
+#define COMPONENTS_SAFE_JSON_PARSER_SAFE_JSON_PARSER_H_
#include <string>
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
+#include "components/safe_json_parser/safe_json_parser_export.h"
#include "content/public/browser/utility_process_host_client.h"
namespace base {
@@ -21,10 +22,13 @@ namespace IPC {
class Message;
}
+namespace safe_json_parser {
+
// SafeJsonParser parses a given JSON safely via a utility process. The object
// is ref-counted and kept alive after Start() is called until one of the two
// callbacks is called.
-class SafeJsonParser : public content::UtilityProcessHostClient {
+class SafeJsonParser
Robert Sesek 2015/05/26 19:39:27 Does this need the EXPORT macro?
Eran Messeri 2015/05/28 13:54:27 No - compiles fine on Windows without it (it's a s
+ : public content::UtilityProcessHostClient {
public:
typedef base::Callback<void(scoped_ptr<base::Value>)> SuccessCallback;
typedef base::Callback<void(const std::string&)> ErrorCallback;
@@ -59,4 +63,6 @@ class SafeJsonParser : public content::UtilityProcessHostClient {
DISALLOW_COPY_AND_ASSIGN(SafeJsonParser);
};
-#endif // CHROME_BROWSER_SAFE_JSON_PARSER_H_
+} // namespace safe_json_parser
+
+#endif // COMPONENTS_SAFE_JSON_PARSER_SAFE_JSON_PARSER_H_

Powered by Google App Engine
This is Rietveld 408576698