Chromium Code Reviews| 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 #ifndef SHELL_APPLICATION_MANAGER_NETWORK_FETCHER_H_ | 5 #ifndef SHELL_APPLICATION_MANAGER_NETWORK_FETCHER_H_ |
| 6 #define SHELL_APPLICATION_MANAGER_NETWORK_FETCHER_H_ | 6 #define SHELL_APPLICATION_MANAGER_NETWORK_FETCHER_H_ |
| 7 | 7 |
| 8 #include "shell/application_manager/fetcher.h" | 8 #include "shell/application_manager/fetcher.h" |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 std::string MimeType() override; | 42 std::string MimeType() override; |
| 43 | 43 |
| 44 bool HasMojoMagic() override; | 44 bool HasMojoMagic() override; |
| 45 | 45 |
| 46 bool PeekFirstLine(std::string* line) override; | 46 bool PeekFirstLine(std::string* line) override; |
| 47 | 47 |
| 48 // Returns whether the content can be loaded directly from cache. Local hosts | 48 // Returns whether the content can be loaded directly from cache. Local hosts |
| 49 // are not loaded from cache to allow effective development. | 49 // are not loaded from cache to allow effective development. |
| 50 bool CanLoadDirectlyFromCache(); | 50 bool CanLoadDirectlyFromCache(); |
| 51 | 51 |
| 52 void LoadFromCache(bool schedule_update); | 52 void LoadFromCache(); |
|
etiennej
2015/09/22 14:53:29
Some documentation on these methods would be helpf
qsr
2015/09/24 08:08:24
Done.
| |
| 53 | 53 |
| 54 void OnCachedResponseReceived(bool schedule_update, | 54 void OnResponseReceived(bool schedule_update, |
| 55 mojo::URLResponsePtr response, | 55 mojo::URLResponsePtr response, |
| 56 mojo::Array<uint8_t> path_as_array, | 56 mojo::Array<uint8_t> path_as_array, |
| 57 mojo::Array<uint8_t> cache_dir); | 57 mojo::Array<uint8_t> cache_dir); |
| 58 | 58 |
| 59 void StartNetworkRequest(); | 59 void StartNetworkRequest(); |
| 60 | 60 |
| 61 void OnLoadComplete(mojo::URLResponsePtr response); | 61 void OnLoadComplete(mojo::URLResponsePtr response); |
| 62 | 62 |
| 63 void OnFileSavedToCache(mojo::Array<uint8_t> path_as_array, | 63 void OnFileSavedToCache(mojo::URLResponsePtr response, |
| 64 mojo::Array<uint8_t> path_as_array, | |
| 64 mojo::Array<uint8_t> cache_dir); | 65 mojo::Array<uint8_t> cache_dir); |
| 65 | 66 |
| 66 static void RecordCacheToURLMapping(const base::FilePath& path, | 67 static void RecordCacheToURLMapping(const base::FilePath& path, |
| 67 const GURL& url); | 68 const GURL& url); |
| 68 | 69 |
| 69 const bool disable_cache_; | 70 const bool disable_cache_; |
| 70 const bool force_offline_by_default_; | 71 const bool force_offline_by_default_; |
| 71 const GURL url_; | 72 const GURL url_; |
| 72 mojo::URLResponseDiskCache* url_response_disk_cache_; | 73 mojo::URLResponseDiskCache* url_response_disk_cache_; |
| 73 mojo::NetworkService* network_service_; | 74 mojo::NetworkService* network_service_; |
| 74 mojo::URLLoaderPtr url_loader_; | 75 mojo::URLLoaderPtr url_loader_; |
| 75 mojo::URLResponsePtr response_; | 76 mojo::URLResponsePtr response_; |
| 76 base::FilePath path_; | 77 base::FilePath path_; |
| 77 base::WeakPtrFactory<NetworkFetcher> weak_ptr_factory_; | 78 base::WeakPtrFactory<NetworkFetcher> weak_ptr_factory_; |
| 78 | 79 |
| 79 DISALLOW_COPY_AND_ASSIGN(NetworkFetcher); | 80 DISALLOW_COPY_AND_ASSIGN(NetworkFetcher); |
| 80 }; | 81 }; |
| 81 | 82 |
| 82 } // namespace shell | 83 } // namespace shell |
| 83 | 84 |
| 84 #endif // SHELL_APPLICATION_MANAGER_NETWORK_FETCHER_H_ | 85 #endif // SHELL_APPLICATION_MANAGER_NETWORK_FETCHER_H_ |
| OLD | NEW |