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

Side by Side Diff: tools/android/md5sum/md5sum.cc

Issue 1847373005: Fix IWYU violators that don't include scoped_ptr.h in Android build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « media/base/android/provision_fetcher.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Md5sum implementation for Android. This version handles files as well as 5 // Md5sum implementation for Android. This version handles files as well as
6 // directories. Its output is sorted by file path. 6 // directories. Its output is sorted by file path.
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <fstream> 10 #include <fstream>
11 #include <iostream> 11 #include <iostream>
12 #include <set> 12 #include <set>
13 #include <string> 13 #include <string>
14 14
15 #include "base/files/file_enumerator.h" 15 #include "base/files/file_enumerator.h"
16 #include "base/files/file_path.h" 16 #include "base/files/file_path.h"
17 #include "base/files/file_util.h" 17 #include "base/files/file_util.h"
18 #include "base/logging.h" 18 #include "base/logging.h"
19 #include "base/md5.h" 19 #include "base/md5.h"
20 #include "base/memory/scoped_ptr.h"
20 21
21 namespace { 22 namespace {
22 23
23 // Returns whether |path|'s MD5 was successfully written to |digest_string|. 24 // Returns whether |path|'s MD5 was successfully written to |digest_string|.
24 bool MD5Sum(const char* path, std::string* digest_string) { 25 bool MD5Sum(const char* path, std::string* digest_string) {
25 base::ScopedFILE file(fopen(path, "rb")); 26 base::ScopedFILE file(fopen(path, "rb"));
26 if (!file) { 27 if (!file) {
27 LOG(ERROR) << "Could not open file " << path; 28 LOG(ERROR) << "Could not open file " << path;
28 return false; 29 return false;
29 } 30 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 for (std::set<std::string>::const_iterator it = files.begin(); 82 for (std::set<std::string>::const_iterator it = files.begin();
82 it != files.end(); ++it) { 83 it != files.end(); ++it) {
83 if (!MD5Sum(it->c_str(), &digest)) { 84 if (!MD5Sum(it->c_str(), &digest)) {
84 failed = true; 85 failed = true;
85 } else { 86 } else {
86 std::cout << digest << " " << *it << std::endl; 87 std::cout << digest << " " << *it << std::endl;
87 } 88 }
88 } 89 }
89 return failed; 90 return failed;
90 } 91 }
OLDNEW
« no previous file with comments | « media/base/android/provision_fetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698