Index: shell/application_manager/network_fetcher.h |
diff --git a/shell/application_manager/network_fetcher.h b/shell/application_manager/network_fetcher.h |
index 887aa7ce3926acda439876d261ae0e97983e4f2f..4285b066ca34e70bd1ff492a22358e07e13e4a17 100644 |
--- a/shell/application_manager/network_fetcher.h |
+++ b/shell/application_manager/network_fetcher.h |
@@ -28,31 +28,12 @@ class NetworkFetcher : public Fetcher { |
~NetworkFetcher() override; |
private: |
- // TODO(hansmuller): Revisit this when a real peek operation is available. |
- static const MojoDeadline kPeekTimeout = MOJO_DEADLINE_INDEFINITE; |
- |
- // The network fetcher will first try to request an application from the |
- // network. If that request fails, it will then try to request the application |
- // from the cache. |
- enum RequestType { |
- FROM_NETWORK, |
- FROM_CACHE, |
- }; |
- |
const GURL& GetURL() const override; |
GURL GetRedirectURL() const override; |
mojo::URLResponsePtr AsURLResponse(base::TaskRunner* task_runner, |
uint32_t skip) override; |
- static void RecordCacheToURLMapping(const base::FilePath& path, |
- const GURL& url); |
- |
- void OnFileRetrievedFromCache( |
- base::Callback<void(const base::FilePath&, bool)> callback, |
- mojo::Array<uint8_t> path_as_array, |
- mojo::Array<uint8_t> cache_dir); |
- |
void AsPath( |
base::TaskRunner* task_runner, |
base::Callback<void(const base::FilePath&, bool)> callback) override; |
@@ -63,9 +44,26 @@ class NetworkFetcher : public Fetcher { |
bool PeekFirstLine(std::string* line) override; |
- void StartNetworkRequest(RequestType request_type); |
+ // Returns whether the content can be loaded directly from cache. Local hosts |
+ // are not loaded from cache to allow effective development. |
+ bool CanLoadDirectlyFromCache(); |
+ |
+ void LoadFromCache(bool scheduleUpdate); |
ppi
2015/09/16 12:32:27
Good catch with the spelling, but I meant casing -
qsr
2015/09/16 13:52:12
Done.
|
- void OnLoadComplete(RequestType request_type, mojo::URLResponsePtr response); |
+ void OnCachedResponseReceived(bool sheduleUpdate, |
+ mojo::URLResponsePtr response, |
+ mojo::Array<uint8_t> path_as_array, |
+ mojo::Array<uint8_t> cache_dir); |
+ |
+ void StartNetworkRequest(); |
+ |
+ void OnLoadComplete(mojo::URLResponsePtr response); |
+ |
+ void OnFileSavedToCache(mojo::Array<uint8_t> path_as_array, |
+ mojo::Array<uint8_t> cache_dir); |
+ |
+ static void RecordCacheToURLMapping(const base::FilePath& path, |
+ const GURL& url); |
const bool disable_cache_; |
const GURL url_; |