| 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 COMPONENTS_SAFE_JSON_SAFE_JSON_PARSER_MESSAGE_FILTER_H_ | |
| 6 #define COMPONENTS_SAFE_JSON_SAFE_JSON_PARSER_MESSAGE_FILTER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 | |
| 12 namespace IPC { | |
| 13 class Message; | |
| 14 } // namespace IPC | |
| 15 | |
| 16 namespace safe_json { | |
| 17 | |
| 18 // A Handler for the ParseJSON IPC message that does the actual JSON parsing | |
| 19 // in the sandboxed process. Modelled after IPC::MessageFilter but does not | |
| 20 // directly implement it as it will be used by an adapter class under | |
| 21 // //chrome/utility. | |
| 22 class SafeJsonParserMessageFilter { | |
| 23 public: | |
| 24 SafeJsonParserMessageFilter(); | |
| 25 ~SafeJsonParserMessageFilter(); | |
| 26 // Returns true if it receives a message it could handle (currently | |
| 27 // only SafeJsonParserMsg_ParseJSON), false otherwise. | |
| 28 bool OnMessageReceived(const IPC::Message& message); | |
| 29 | |
| 30 private: | |
| 31 void OnParseJSON(const std::string& json); | |
| 32 | |
| 33 DISALLOW_COPY_AND_ASSIGN(SafeJsonParserMessageFilter); | |
| 34 }; | |
| 35 | |
| 36 } // namespace safe_json | |
| 37 | |
| 38 #endif // COMPONENTS_SAFE_JSON_SAFE_JSON_PARSER_MESSAGE_FILTER_H_ | |
| OLD | NEW |