| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/safe_json_parser_impl.h" | 5 #include "components/safe_json/safe_json_parser_impl.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/sequenced_task_runner.h" | 8 #include "base/sequenced_task_runner.h" |
| 9 #include "base/threading/sequenced_task_runner_handle.h" | 9 #include "base/threading/sequenced_task_runner_handle.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 #include "components/strings/grit/components_strings.h" |
| 11 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 12 #include "grit/components_strings.h" | |
| 13 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
| 14 | 14 |
| 15 namespace safe_json { | 15 namespace safe_json { |
| 16 | 16 |
| 17 SafeJsonParserImpl::SafeJsonParserImpl(const std::string& unsafe_json, | 17 SafeJsonParserImpl::SafeJsonParserImpl(const std::string& unsafe_json, |
| 18 const SuccessCallback& success_callback, | 18 const SuccessCallback& success_callback, |
| 19 const ErrorCallback& error_callback) | 19 const ErrorCallback& error_callback) |
| 20 : unsafe_json_(unsafe_json), | 20 : unsafe_json_(unsafe_json), |
| 21 success_callback_(success_callback), | 21 success_callback_(success_callback), |
| 22 error_callback_(error_callback) { | 22 error_callback_(error_callback) { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 if (!error_callback_.is_null()) | 85 if (!error_callback_.is_null()) |
| 86 error_callback_.Run(error); | 86 error_callback_.Run(error); |
| 87 } | 87 } |
| 88 | 88 |
| 89 // The parsing is done whether an error occured or not, so this instance can | 89 // The parsing is done whether an error occured or not, so this instance can |
| 90 // be cleaned up. | 90 // be cleaned up. |
| 91 delete this; | 91 delete this; |
| 92 } | 92 } |
| 93 | 93 |
| 94 } // namespace safe_json | 94 } // namespace safe_json |
| OLD | NEW |