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

Side by Side Diff: tools/gn/command_gyp.cc

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include <fstream> 5 #include <fstream>
6 6
7 #include "base/atomicops.h" 7 #include "base/atomicops.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 subninjas->insert(filename); 62 subninjas->insert(filename);
63 63
64 next_subninja = line_end; 64 next_subninja = line_end;
65 } 65 }
66 return *first_subninja_offset != std::string::npos; 66 return *first_subninja_offset != std::string::npos;
67 } 67 }
68 68
69 bool FixupBuildNinja(const BuildSettings* build_settings, 69 bool FixupBuildNinja(const BuildSettings* build_settings,
70 const base::FilePath& buildfile) { 70 const base::FilePath& buildfile) {
71 std::string contents; 71 std::string contents;
72 if (!file_util::ReadFileToString(buildfile, &contents)) { 72 if (!base::ReadFileToString(buildfile, &contents)) {
73 Err(Location(), "Could not load " + FilePathToUTF8(buildfile)) 73 Err(Location(), "Could not load " + FilePathToUTF8(buildfile))
74 .PrintToStdout(); 74 .PrintToStdout();
75 return false; 75 return false;
76 } 76 }
77 77
78 std::set<std::string> subninjas; 78 std::set<std::string> subninjas;
79 size_t first_subninja_offset = 0; 79 size_t first_subninja_offset = 0;
80 if (!SimpleNinjaParse(contents, &subninjas, &first_subninja_offset)) { 80 if (!SimpleNinjaParse(contents, &subninjas, &first_subninja_offset)) {
81 Err(Location(), "Could not parse " + FilePathToUTF8(buildfile)) 81 Err(Location(), "Could not parse " + FilePathToUTF8(buildfile))
82 .PrintToStdout(); 82 .PrintToStdout();
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 base::IntToString((end_gyp_time - begin_time).InMilliseconds()) + 236 base::IntToString((end_gyp_time - begin_time).InMilliseconds()) +
237 "ms)\n"; 237 "ms)\n";
238 238
239 OutputString(stats); 239 OutputString(stats);
240 } 240 }
241 241
242 return 0; 242 return 0;
243 } 243 }
244 244
245 } // namespace commands 245 } // namespace commands
OLDNEW
« no previous file with comments | « tools/android/device_stats_monitor/device_stats_monitor.cc ('k') | tools/gn/function_read_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698