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

Side by Side Diff: chrome/tools/safe_browsing/sb_sigutil.cc

Issue 2733343002: Move chrome/common/safe_browsing/csd.proto to components/safe_browsing (Closed)
Patch Set: rebase again Created 3 years, 9 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 | « chrome/tools/safe_browsing/DEPS ('k') | chrome/utility/safe_browsing/mac/BUILD.gn » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Simple tool that uses the SignatureUtil class to extract signature 5 // Simple tool that uses the SignatureUtil class to extract signature
6 // information from an executable. The output is an encoded 6 // information from an executable. The output is an encoded
7 // ClientDownloadRequest_SignatureInfo protocol buffer. 7 // ClientDownloadRequest_SignatureInfo protocol buffer.
8 // 8 //
9 // Example usage: sb_sigutil --executable=blah.exe --output=siginfo.pb 9 // Example usage: sb_sigutil --executable=blah.exe --output=siginfo.pb
10 10
11 #include <string> 11 #include <string>
12 12
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "base/files/file_util.h" 15 #include "base/files/file_util.h"
16 #include "base/logging.h" 16 #include "base/logging.h"
17 #include "base/memory/ref_counted.h" 17 #include "base/memory/ref_counted.h"
18 #include "chrome/common/safe_browsing/binary_feature_extractor.h" 18 #include "chrome/common/safe_browsing/binary_feature_extractor.h"
19 #include "chrome/common/safe_browsing/csd.pb.h" 19 #include "components/safe_browsing/csd.pb.h"
20 20
21 // Command-line switch for the executable to extract a signature from. 21 // Command-line switch for the executable to extract a signature from.
22 static const char kExecutable[] = "executable"; 22 static const char kExecutable[] = "executable";
23 23
24 // File to write the output protocol buffer to. 24 // File to write the output protocol buffer to.
25 static const char kOutputFile[] = "output"; 25 static const char kOutputFile[] = "output";
26 26
27 int main(int argc, char* argv[]) { 27 int main(int argc, char* argv[]) {
28 base::CommandLine::Init(argc, argv); 28 base::CommandLine::Init(argc, argv);
29 29
(...skipping 18 matching lines...) Expand all
48 cmd_line->GetSwitchValuePath(kOutputFile), 48 cmd_line->GetSwitchValuePath(kOutputFile),
49 serialized_info.data(), 49 serialized_info.data(),
50 serialized_info.size()); 50 serialized_info.size());
51 if (bytes_written != static_cast<int>(serialized_info.size())) { 51 if (bytes_written != static_cast<int>(serialized_info.size())) {
52 LOG(ERROR) << "Error writing output file"; 52 LOG(ERROR) << "Error writing output file";
53 return 1; 53 return 1;
54 } 54 }
55 55
56 return 0; 56 return 0;
57 } 57 }
OLDNEW
« no previous file with comments | « chrome/tools/safe_browsing/DEPS ('k') | chrome/utility/safe_browsing/mac/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698