| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/safe_json/json_sanitizer.h" | 5 #include "components/safe_json/json_sanitizer.h" |
| 6 | 6 |
| 7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 12 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 13 #include "base/threading/sequenced_task_runner_handle.h" | 14 #include "base/threading/sequenced_task_runner_handle.h" |
| 14 #include "jni/JsonSanitizer_jni.h" | 15 #include "jni/JsonSanitizer_jni.h" |
| 15 | 16 |
| 16 namespace safe_json { | 17 namespace safe_json { |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 // An implementation of JsonSanitizer that calls into Java. It deals with | 21 // An implementation of JsonSanitizer that calls into Java. It deals with |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 JsonSanitizerAndroid sanitizer(success_callback, error_callback); | 114 JsonSanitizerAndroid sanitizer(success_callback, error_callback); |
| 114 sanitizer.Sanitize(unsafe_json); | 115 sanitizer.Sanitize(unsafe_json); |
| 115 } | 116 } |
| 116 | 117 |
| 117 // static | 118 // static |
| 118 bool JsonSanitizer::Register(JNIEnv* env) { | 119 bool JsonSanitizer::Register(JNIEnv* env) { |
| 119 return RegisterNativesImpl(env); | 120 return RegisterNativesImpl(env); |
| 120 } | 121 } |
| 121 | 122 |
| 122 } // namespace safe_json | 123 } // namespace safe_json |
| OLD | NEW |