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

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

Issue 361523002: Fix some more problems with windows paths in content verification (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « extensions/browser/computed_hashes_unittest.cc ('k') | extensions/browser/verified_contents.cc » ('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/file_util.h" 10 #include "base/file_util.h"
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 343
344 // Now iterate over all the paths in sorted order and compute the block hashes 344 // Now iterate over all the paths in sorted order and compute the block hashes
345 // for each one. 345 // for each one.
346 ComputedHashes::Writer writer; 346 ComputedHashes::Writer writer;
347 for (SortedFilePathSet::iterator i = paths.begin(); i != paths.end(); ++i) { 347 for (SortedFilePathSet::iterator i = paths.begin(); i != paths.end(); ++i) {
348 if (IsCancelled()) 348 if (IsCancelled())
349 return false; 349 return false;
350 const base::FilePath& full_path = *i; 350 const base::FilePath& full_path = *i;
351 base::FilePath relative_path; 351 base::FilePath relative_path;
352 extension_path_.AppendRelativePath(full_path, &relative_path); 352 extension_path_.AppendRelativePath(full_path, &relative_path);
353 relative_path = relative_path.NormalizePathSeparatorsTo('/');
353 354
354 const std::string* expected_root = 355 const std::string* expected_root =
355 verified_contents.GetTreeHashRoot(relative_path); 356 verified_contents.GetTreeHashRoot(relative_path);
356 if (!expected_root) 357 if (!expected_root)
357 continue; 358 continue;
358 359
359 std::string contents; 360 std::string contents;
360 if (!base::ReadFileToString(full_path, &contents)) { 361 if (!base::ReadFileToString(full_path, &contents)) {
361 LOG(ERROR) << "Could not read " << full_path.MaybeAsASCII(); 362 LOG(ERROR) << "Could not read " << full_path.MaybeAsASCII();
362 continue; 363 continue;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 501
501 for (JobMap::iterator i = jobs_.begin(); i != jobs_.end(); ++i) { 502 for (JobMap::iterator i = jobs_.begin(); i != jobs_.end(); ++i) {
502 if (i->second.get() == job) { 503 if (i->second.get() == job) {
503 jobs_.erase(i); 504 jobs_.erase(i);
504 break; 505 break;
505 } 506 }
506 } 507 }
507 } 508 }
508 509
509 } // namespace extensions 510 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/computed_hashes_unittest.cc ('k') | extensions/browser/verified_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698