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

Side by Side Diff: ios/chrome/browser/web_resource/ios_web_resource_service.h

Issue 880433002: In-process JSON parsing for web resources on iOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 5 years, 10 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
« no previous file with comments | « no previous file | ios/chrome/browser/web_resource/ios_web_resource_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef IOS_CHROME_BROWSER_WEB_RESOURCE_IOS_WEB_RESOURCE_SERVICE_H_
6 #define IOS_CHROME_BROWSER_WEB_RESOURCE_IOS_WEB_RESOURCE_SERVICE_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "components/web_resource/web_resource_service.h"
13
14 // iOS implementation of WebResourceService.
15 // IOSWebResourceService does not parses JSON out of process, because of
16 // platform limitations.
17 class IOSWebResourceService : public web_resource::WebResourceService {
18 public:
19 IOSWebResourceService(PrefService* prefs,
20 const GURL& web_resource_server,
21 bool apply_locale_to_url,
22 const char* last_update_time_pref_name,
23 int start_fetch_delay_ms,
24 int cache_update_delay_ms);
25
26 protected:
27 ~IOSWebResourceService() override;
28
29 private:
30 // Parses JSON in a background thread.
31 static base::Closure ParseJSONOnBackgroundThread(
32 const std::string& data,
33 const SuccessCallback& success_callback,
34 const ErrorCallback& error_callback);
35
36 // WebResourceService implementation:
37 void ParseJSON(const std::string& data,
38 const SuccessCallback& success_callback,
39 const ErrorCallback& error_callback) override;
40 net::URLRequestContextGetter* GetRequestContext() override;
41
42 DISALLOW_COPY_AND_ASSIGN(IOSWebResourceService);
43 };
44
45 #endif // IOS_CHROME_BROWSER_WEB_RESOURCE_IOS_WEB_RESOURCE_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/web_resource/ios_web_resource_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698