| Index: components/safe_json/safe_json_parser_impl.h
|
| diff --git a/components/safe_json/safe_json_parser_impl.h b/components/safe_json/safe_json_parser_impl.h
|
| index 7b96c79081064e9f1c2c2ad9457cd8d7bea506ec..b1495dcd806e322200e82cf1b742296390d7e5a2 100644
|
| --- a/components/safe_json/safe_json_parser_impl.h
|
| +++ b/components/safe_json/safe_json_parser_impl.h
|
| @@ -10,6 +10,9 @@
|
| #include "base/macros.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "base/threading/thread_checker.h"
|
| +#include "components/safe_json/public/interfaces/safe_json.mojom.h"
|
| #include "components/safe_json/safe_json_parser.h"
|
| #include "content/public/browser/utility_process_host_client.h"
|
|
|
| @@ -19,6 +22,10 @@ class SequencedTaskRunner;
|
| class Value;
|
| }
|
|
|
| +namespace content {
|
| +class UtilityProcessHost;
|
| +}
|
| +
|
| namespace IPC {
|
| class Message;
|
| }
|
| @@ -37,9 +44,6 @@ class SafeJsonParserImpl : public content::UtilityProcessHostClient,
|
|
|
| void StartWorkOnIOThread();
|
|
|
| - void OnJSONParseSucceeded(const base::ListValue& wrapper);
|
| - void OnJSONParseFailed(const std::string& error_message);
|
| -
|
| void ReportResults();
|
| void ReportResultsOnOriginThread();
|
|
|
| @@ -49,6 +53,9 @@ class SafeJsonParserImpl : public content::UtilityProcessHostClient,
|
| // SafeJsonParser implementation.
|
| void Start() override;
|
|
|
| + // mojom::SafeJsonParser::Parse callback.
|
| + void OnParseDone(const base::ListValue& wrapper, mojo::String error);
|
| +
|
| const std::string unsafe_json_;
|
| SuccessCallback success_callback_;
|
| ErrorCallback error_callback_;
|
| @@ -57,6 +64,14 @@ class SafeJsonParserImpl : public content::UtilityProcessHostClient,
|
| scoped_ptr<base::Value> parsed_json_;
|
| std::string error_;
|
|
|
| + base::WeakPtr<content::UtilityProcessHost> utility_process_host_;
|
| +
|
| + mojom::SafeJsonParserPtr service_;
|
| +
|
| + // To ensure the UtilityProcessHost and Mojo service are only accessed on the
|
| + // IO thread.
|
| + base::ThreadChecker io_thread_checker_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(SafeJsonParserImpl);
|
| };
|
|
|
|
|