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 28 matching lines...) Expand all Loading... |
39 uint32_t skip) override; | 39 uint32_t skip) override; |
40 | 40 |
41 static void RecordCacheToURLMapping(const base::FilePath& path, | 41 static void RecordCacheToURLMapping(const base::FilePath& path, |
42 const GURL& url); | 42 const GURL& url); |
43 | 43 |
44 // AppIds should be be both predictable and unique, but any hash would work. | 44 // AppIds should be be both predictable and unique, but any hash would work. |
45 // Currently we use sha256 from crypto/secure_hash.h | 45 // Currently we use sha256 from crypto/secure_hash.h |
46 static bool ComputeAppId(const base::FilePath& path, | 46 static bool ComputeAppId(const base::FilePath& path, |
47 std::string* digest_string); | 47 std::string* digest_string); |
48 | 48 |
49 static bool RenameToAppId(const base::FilePath& old_path, | 49 static bool RenameToAppId(const GURL& url, |
| 50 const base::FilePath& old_path, |
50 base::FilePath* new_path); | 51 base::FilePath* new_path); |
51 | 52 |
52 void CopyCompleted(base::Callback<void(const base::FilePath&, bool)> callback, | 53 void CopyCompleted(base::Callback<void(const base::FilePath&, bool)> callback, |
53 bool success); | 54 bool success); |
54 | 55 |
55 void AsPath( | 56 void AsPath( |
56 base::TaskRunner* task_runner, | 57 base::TaskRunner* task_runner, |
57 base::Callback<void(const base::FilePath&, bool)> callback) override; | 58 base::Callback<void(const base::FilePath&, bool)> callback) override; |
58 | 59 |
59 std::string MimeType() override; | 60 std::string MimeType() override; |
(...skipping 13 matching lines...) Expand all Loading... |
73 base::FilePath path_; | 74 base::FilePath path_; |
74 base::WeakPtrFactory<NetworkFetcher> weak_ptr_factory_; | 75 base::WeakPtrFactory<NetworkFetcher> weak_ptr_factory_; |
75 | 76 |
76 DISALLOW_COPY_AND_ASSIGN(NetworkFetcher); | 77 DISALLOW_COPY_AND_ASSIGN(NetworkFetcher); |
77 }; | 78 }; |
78 | 79 |
79 } // namespace shell | 80 } // namespace shell |
80 } // namespace mojo | 81 } // namespace mojo |
81 | 82 |
82 #endif // SHELL_APPLICATION_MANAGER_NETWORK_FETCHER_H_ | 83 #endif // SHELL_APPLICATION_MANAGER_NETWORK_FETCHER_H_ |
OLD | NEW |