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.
5 #ifndef IOS_CHROME_BROWSER_WEB_RESOURCE_IOS_WEB_RESOURCE_SERVICE_H_
6 #define IOS_CHROME_BROWSER_WEB_RESOURCE_IOS_WEB_RESOURCE_SERVICE_H_
10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "components/web_resource/web_resource_service.h"
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
{
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
);
27 ~IOSWebResourceService() override
;
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
);
36 // WebResourceService implementation:
37 void ParseJSON(const std::string
& data
,
38 const SuccessCallback
& success_callback
,
39 const ErrorCallback
& error_callback
) override
;
41 DISALLOW_COPY_AND_ASSIGN(IOSWebResourceService
);
44 #endif // IOS_CHROME_BROWSER_WEB_RESOURCE_IOS_WEB_RESOURCE_SERVICE_H_