OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "extensions/browser/content_hash_fetcher.h" | 5 #include "extensions/browser/content_hash_fetcher.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // exists but is invalid, it will return false. Also, any invalid | 90 // exists but is invalid, it will return false. Also, any invalid |
91 // file will be removed from disk and | 91 // file will be removed from disk and |
92 bool LoadVerifiedContents(const base::FilePath& path); | 92 bool LoadVerifiedContents(const base::FilePath& path); |
93 | 93 |
94 // Callback for when we're done doing file I/O to see if we already have | 94 // Callback for when we're done doing file I/O to see if we already have |
95 // a verified contents file. If we don't, this will kick off a network | 95 // a verified contents file. If we don't, this will kick off a network |
96 // request to get one. | 96 // request to get one. |
97 void DoneCheckingForVerifiedContents(bool found); | 97 void DoneCheckingForVerifiedContents(bool found); |
98 | 98 |
99 // URLFetcherDelegate interface | 99 // URLFetcherDelegate interface |
100 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 100 virtual void OnURLFetchComplete(const net::URLFetcher* source) override; |
101 | 101 |
102 // Callback for when we're done ensuring we have verified contents, and are | 102 // Callback for when we're done ensuring we have verified contents, and are |
103 // ready to move on to MaybeCreateHashes. | 103 // ready to move on to MaybeCreateHashes. |
104 void DoneFetchingVerifiedContents(bool success); | 104 void DoneFetchingVerifiedContents(bool success); |
105 | 105 |
106 // Callback for the job to write the verified contents to the filesystem. | 106 // Callback for the job to write the verified contents to the filesystem. |
107 void OnVerifiedContentsWritten(size_t expected_size, int write_result); | 107 void OnVerifiedContentsWritten(size_t expected_size, int write_result); |
108 | 108 |
109 // The verified contents file from the webstore only contains the treehash | 109 // The verified contents file from the webstore only contains the treehash |
110 // root hash, but for performance we want to cache the individual block level | 110 // root hash, but for performance we want to cache the individual block level |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 | 496 |
497 for (JobMap::iterator i = jobs_.begin(); i != jobs_.end(); ++i) { | 497 for (JobMap::iterator i = jobs_.begin(); i != jobs_.end(); ++i) { |
498 if (i->second.get() == job) { | 498 if (i->second.get() == job) { |
499 jobs_.erase(i); | 499 jobs_.erase(i); |
500 break; | 500 break; |
501 } | 501 } |
502 } | 502 } |
503 } | 503 } |
504 | 504 |
505 } // namespace extensions | 505 } // namespace extensions |
OLD | NEW |