OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_UTILITY_SAFE_JSON_PARSER_HANDLER_H_ | |
6 #define CHROME_UTILITY_SAFE_JSON_PARSER_HANDLER_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "base/macros.h" | |
11 #include "chrome/utility/utility_message_handler.h" | |
12 | |
13 namespace safe_json { | |
14 class SafeJsonParserMessageFilter; | |
15 } // namespace safe_json | |
16 | |
17 // Dispatches IPCs for out of process JSON parsing. This is an adapter class | |
18 // that delegates to safe_json::SafeJsonParserMessageFilter, since the | |
19 // SafeJsonParserMessageFilter in //components/safe_json can't directly | |
20 // depend on //chrome/utility. | |
21 class SafeJsonParserHandler : public UtilityMessageHandler { | |
22 public: | |
23 SafeJsonParserHandler(); | |
24 ~SafeJsonParserHandler() override; | |
25 | |
26 // UtilityMessageHandler | |
27 bool OnMessageReceived(const IPC::Message& message) override; | |
28 | |
29 private: | |
30 std::unique_ptr<safe_json::SafeJsonParserMessageFilter> handler_; | |
31 | |
32 DISALLOW_COPY_AND_ASSIGN(SafeJsonParserHandler); | |
33 }; | |
34 | |
35 #endif // CHROME_UTILITY_SAFE_JSON_PARSER_HANDLER_H_ | |
OLD | NEW |