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

Side by Side Diff: net/tools/gdig/gdig.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
« no previous file with comments | « net/tools/dns_fuzz_stub/dns_fuzz_stub.cc ('k') | net/tools/quic/quic_in_memory_cache.cc » ('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) 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 #include <stdio.h> 5 #include <stdio.h>
6 #include <string> 6 #include <string>
7 7
8 #include "base/at_exit.h" 8 #include "base/at_exit.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/cancelable_callback.h" 10 #include "base/cancelable_callback.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 // The replay log is a text file where each line contains 109 // The replay log is a text file where each line contains
110 // 110 //
111 // timestamp_in_milliseconds domain_name 111 // timestamp_in_milliseconds domain_name
112 // 112 //
113 // The timestamp_in_milliseconds needs to be an integral delta from start of 113 // The timestamp_in_milliseconds needs to be an integral delta from start of
114 // resolution and is in milliseconds. domain_name is the name to be resolved. 114 // resolution and is in milliseconds. domain_name is the name to be resolved.
115 // 115 //
116 // The file should be sorted by timestamp in ascending time. 116 // The file should be sorted by timestamp in ascending time.
117 bool LoadReplayLog(const base::FilePath& file_path, ReplayLog* replay_log) { 117 bool LoadReplayLog(const base::FilePath& file_path, ReplayLog* replay_log) {
118 std::string original_replay_log_contents; 118 std::string original_replay_log_contents;
119 if (!file_util::ReadFileToString(file_path, &original_replay_log_contents)) { 119 if (!base::ReadFileToString(file_path, &original_replay_log_contents)) {
120 fprintf(stderr, "Unable to open replay file %s\n", 120 fprintf(stderr, "Unable to open replay file %s\n",
121 file_path.MaybeAsASCII().c_str()); 121 file_path.MaybeAsASCII().c_str());
122 return false; 122 return false;
123 } 123 }
124 124
125 // Strip out \r characters for Windows files. This isn't as efficient as a 125 // Strip out \r characters for Windows files. This isn't as efficient as a
126 // smarter line splitter, but this particular use does not need to target 126 // smarter line splitter, but this particular use does not need to target
127 // efficiency. 127 // efficiency.
128 std::string replay_log_contents; 128 std::string replay_log_contents;
129 RemoveChars(original_replay_log_contents, "\r", &replay_log_contents); 129 RemoveChars(original_replay_log_contents, "\r", &replay_log_contents);
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 } 506 }
507 507
508 } // empty namespace 508 } // empty namespace
509 509
510 } // namespace net 510 } // namespace net
511 511
512 int main(int argc, const char* argv[]) { 512 int main(int argc, const char* argv[]) {
513 net::GDig dig; 513 net::GDig dig;
514 return dig.Main(argc, argv); 514 return dig.Main(argc, argv);
515 } 515 }
OLDNEW
« no previous file with comments | « net/tools/dns_fuzz_stub/dns_fuzz_stub.cc ('k') | net/tools/quic/quic_in_memory_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698