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

Side by Side Diff: chrome/tools/profile_reset/jtl_compiler_frontend.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // A simple command-line compiler for JTL (JSON Traversal Language). 5 // A simple command-line compiler for JTL (JSON Traversal Language).
6 // 6 //
7 // Translates rules from a text-based, human-readable format to an easy-to-parse 7 // Translates rules from a text-based, human-readable format to an easy-to-parse
8 // byte-code format, which then can be interpreted by JtlInterpreter. 8 // byte-code format, which then can be interpreted by JtlInterpreter.
9 // 9 //
10 // Example usage: 10 // Example usage:
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 std::cerr << " Line number: " << (error.line_number + 1) << std::endl; 93 std::cerr << " Line number: " << (error.line_number + 1) << std::endl;
94 std::cerr << " Context: " << (error.context.size() > 63 94 std::cerr << " Context: " << (error.context.size() > 63
95 ? error.context.substr(0, 60) + "..." 95 ? error.context.substr(0, 60) + "..."
96 : error.context) << std::endl; 96 : error.context) << std::endl;
97 return -2; 97 return -2;
98 } 98 }
99 99
100 base::FilePath bytecode_path = 100 base::FilePath bytecode_path =
101 MakeAbsoluteFilePath(cmd_line->GetSwitchValuePath(kOutputPath)); 101 MakeAbsoluteFilePath(cmd_line->GetSwitchValuePath(kOutputPath));
102 int bytes_written = 102 int bytes_written =
103 file_util::WriteFile(cmd_line->GetSwitchValuePath(kOutputPath), 103 base::WriteFile(cmd_line->GetSwitchValuePath(kOutputPath),
104 bytecode.data(), 104 bytecode.data(),
105 static_cast<int>(bytecode.size())); 105 static_cast<int>(bytecode.size()));
106 if (bytes_written != static_cast<int>(bytecode.size())) { 106 if (bytes_written != static_cast<int>(bytecode.size())) {
107 std::cerr << "ERROR: Cannot write output file." << std::endl; 107 std::cerr << "ERROR: Cannot write output file." << std::endl;
108 return -3; 108 return -3;
109 } 109 }
110 110
111 return 0; 111 return 0;
112 } 112 }
OLDNEW
« no previous file with comments | « chrome/tools/convert_dict/convert_dict_unittest.cc ('k') | chrome/tools/safe_browsing/sb_sigutil.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698