Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Side by Side Diff: extensions/browser/content_hash_fetcher.cc

Issue 664933004: Standardize usage of virtual/override/final in extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/browser/blob_holder.h ('k') | extensions/browser/content_verifier.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 const std::string& extension_id() { return extension_id_; } 76 const std::string& extension_id() { return extension_id_; }
77 77
78 // Returns the set of paths that had a hash mismatch. 78 // Returns the set of paths that had a hash mismatch.
79 const std::set<base::FilePath>& hash_mismatch_paths() { 79 const std::set<base::FilePath>& hash_mismatch_paths() {
80 return hash_mismatch_paths_; 80 return hash_mismatch_paths_;
81 } 81 }
82 82
83 private: 83 private:
84 friend class base::RefCountedThreadSafe<ContentHashFetcherJob>; 84 friend class base::RefCountedThreadSafe<ContentHashFetcherJob>;
85 virtual ~ContentHashFetcherJob(); 85 ~ContentHashFetcherJob() override;
86 86
87 // Tries to load a verified_contents.json file at |path|. On successfully 87 // Tries to load a verified_contents.json file at |path|. On successfully
88 // reading and validing the file, the verified_contents_ member variable will 88 // reading and validing the file, the verified_contents_ member variable will
89 // be set and this function will return true. If the file does not exist, or 89 // be set and this function will return true. If the file does not exist, or
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 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
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
OLDNEW
« no previous file with comments | « extensions/browser/blob_holder.h ('k') | extensions/browser/content_verifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698