| 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 "chrome/browser/web_resource/chrome_web_resource_service.h" | 5 #include "chrome/browser/web_resource/chrome_web_resource_service.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 switches::kDisableBackgroundNetworking) { | 31 switches::kDisableBackgroundNetworking) { |
| 32 } | 32 } |
| 33 | 33 |
| 34 ChromeWebResourceService::~ChromeWebResourceService() { | 34 ChromeWebResourceService::~ChromeWebResourceService() { |
| 35 } | 35 } |
| 36 | 36 |
| 37 void ChromeWebResourceService::ParseJSON( | 37 void ChromeWebResourceService::ParseJSON( |
| 38 const std::string& data, | 38 const std::string& data, |
| 39 const SuccessCallback& success_callback, | 39 const SuccessCallback& success_callback, |
| 40 const ErrorCallback& error_callback) { | 40 const ErrorCallback& error_callback) { |
| 41 // SafeJsonParser releases itself on completion. | 41 safe_json::SafeJsonParser::Parse(data, success_callback, error_callback); |
| 42 scoped_refptr<safe_json::SafeJsonParser> json_parser( | |
| 43 new safe_json::SafeJsonParser(data, success_callback, | |
| 44 error_callback)); | |
| 45 json_parser->Start(); | |
| 46 } | 42 } |
| OLD | NEW |