| // Copyright 2018 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. |
| |
| #ifndef CHROME_CHROME_CLEANER_JSON_PARSER_SANDBOXED_JSON_PARSER_H_ |
| #define CHROME_CHROME_CLEANER_JSON_PARSER_SANDBOXED_JSON_PARSER_H_ |
| |
| #include "chrome/chrome_cleaner/interfaces/json_parser.mojom.h" |
| #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h" |
| #include "chrome/chrome_cleaner/json_parser/json_parser_api.h" |
| |
| namespace chrome_cleaner { |
| |
| // An implementation of JsonParserAPI to wrap a MojoTaskRunner and |
| // JsonParserPtr. Parses via |json_parser_ptr_| on the |mojo_task_runner_|. |
| class SandboxedJsonParser : public JsonParserAPI { |
| public: |
| SandboxedJsonParser(MojoTaskRunner* mojo_task_runner, |
| mojom::JsonParserPtr* json_parser_ptr); |
| void Parse(const std::string& json, ParseDoneCallback callback) override; |
| |
| private: |
| MojoTaskRunner* mojo_task_runner_; |
| mojom::JsonParserPtr* json_parser_ptr_; |
| }; |
| |
| } // namespace chrome_cleaner |
| |
| #endif // CHROME_CHROME_CLEANER_JSON_PARSER_SANDBOXED_JSON_PARSER_H_ |