Update V8 to version 4.7.21.
[chromium-blink-merge.git] / components / safe_json / safe_json_parser_android.h
blob2058731a1e04876432c16320e14090330092c77a
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.
5 #ifndef COMPONENTS_SAFE_JSON_SAFE_JSON_PARSER_ANDROID_H_
6 #define COMPONENTS_SAFE_JSON_SAFE_JSON_PARSER_ANDROID_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "components/safe_json/safe_json_parser.h"
11 namespace safe_json {
13 class JsonSanitizer;
15 class SafeJsonParserAndroid : public SafeJsonParser {
16 public:
17 SafeJsonParserAndroid(const std::string& unsafe_json,
18 const SuccessCallback& success_callback,
19 const ErrorCallback& error_callback);
21 private:
22 friend struct base::DefaultDeleter<SafeJsonParserAndroid>;
24 ~SafeJsonParserAndroid() override;
26 void OnSanitizationSuccess(const std::string& sanitized_json);
27 void OnSanitizationError(const std::string& error);
29 // SafeJsonParser implementation.
30 void Start() override;
32 const std::string unsafe_json_;
33 SuccessCallback success_callback_;
34 ErrorCallback error_callback_;
36 DISALLOW_COPY_AND_ASSIGN(SafeJsonParserAndroid);
39 } // namespace safe_json
41 #endif // COMPONENTS_SAFE_JSON_SAFE_JSON_PARSER_ANDROID_H_