Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Side by Side Diff: chrome/browser/web_resource/chrome_web_resource_service.cc

Issue 1140053003: Refactoring: Moving the SafeJsonParser to its own component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Catching up with WebstoreInstallHelper changes Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "chrome/browser/safe_json_parser.h"
12 #include "chrome/common/chrome_switches.h" 11 #include "chrome/common/chrome_switches.h"
12 #include "components/safe_json_parser/safe_json_parser.h"
13 #include "url/gurl.h" 13 #include "url/gurl.h"
14 14
15 ChromeWebResourceService::ChromeWebResourceService( 15 ChromeWebResourceService::ChromeWebResourceService(
16 PrefService* prefs, 16 PrefService* prefs,
17 const GURL& web_resource_server, 17 const GURL& web_resource_server,
18 bool apply_locale_to_url, 18 bool apply_locale_to_url,
19 const char* last_update_time_pref_name, 19 const char* last_update_time_pref_name,
20 int start_fetch_delay_ms, 20 int start_fetch_delay_ms,
21 int cache_update_delay_ms) 21 int cache_update_delay_ms)
22 : web_resource::WebResourceService( 22 : web_resource::WebResourceService(
23 prefs, 23 prefs,
24 web_resource_server, 24 web_resource_server,
25 apply_locale_to_url ? g_browser_process->GetApplicationLocale() 25 apply_locale_to_url ? g_browser_process->GetApplicationLocale()
26 : std::string(), 26 : std::string(),
27 last_update_time_pref_name, 27 last_update_time_pref_name,
28 start_fetch_delay_ms, 28 start_fetch_delay_ms,
29 cache_update_delay_ms, 29 cache_update_delay_ms,
30 g_browser_process->system_request_context(), 30 g_browser_process->system_request_context(),
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 // SafeJsonParser releases itself on completion.
42 scoped_refptr<SafeJsonParser> json_parser( 42 scoped_refptr<safe_json_parser::SafeJsonParser> json_parser(
43 new SafeJsonParser(data, success_callback, error_callback)); 43 new safe_json_parser::SafeJsonParser(data, success_callback,
44 error_callback));
44 json_parser->Start(); 45 json_parser->Start();
45 } 46 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/search/common/json_response_fetcher.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698