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

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

Issue 587823003: Cleanup: Remove base/file_util.h. Convert remaining references. (try 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
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:
11 // jtl_compiler --input=blah.txt --hash-seed="foobar" --output=blah.dat 11 // jtl_compiler --input=blah.txt --hash-seed="foobar" --output=blah.dat
12 12
13 #include <iostream> 13 #include <iostream>
14 #include <string> 14 #include <string>
15 15
16 #include "base/command_line.h" 16 #include "base/command_line.h"
17 #include "base/file_util.h"
18 #include "base/files/file_path.h" 17 #include "base/files/file_path.h"
18 #include "base/files/file_util.h"
19 #include "chrome/tools/profile_reset/jtl_compiler.h" 19 #include "chrome/tools/profile_reset/jtl_compiler.h"
20 20
21 namespace { 21 namespace {
22 22
23 // Command-line argument name: path to the input text-based JTL source code. 23 // Command-line argument name: path to the input text-based JTL source code.
24 const char kInputPath[] = "input"; 24 const char kInputPath[] = "input";
25 25
26 // Command-line argument name: path to the output byte-code. 26 // Command-line argument name: path to the output byte-code.
27 const char kOutputPath[] = "output"; 27 const char kOutputPath[] = "output";
28 28
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 base::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/browser/profile_resetter/automatic_profile_resetter_mementos.cc ('k') | third_party/leveldatabase/env_chromium.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698