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

Side by Side Diff: net/tools/fetch/fetch_server.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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) 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 #include "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/metrics/stats_counters.h" 9 #include "base/metrics/stats_counters.h"
10 #include "net/base/completion_callback.h" 10 #include "net/base/completion_callback.h"
(...skipping 18 matching lines...) Expand all
29 29
30 #if defined(OS_WIN) 30 #if defined(OS_WIN)
31 net::EnsureWinsockInit(); 31 net::EnsureWinsockInit();
32 #endif // defined(OS_WIN) 32 #endif // defined(OS_WIN)
33 33
34 CommandLine::Init(0, NULL); 34 CommandLine::Init(0, NULL);
35 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); 35 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
36 36
37 // Do work here. 37 // Do work here.
38 MessageLoop loop; 38 MessageLoop loop;
39 HttpServer server("", 80); // TODO(mbelshe): make port configurable 39 HttpServer server(std::string(),
40 80); // TODO(mbelshe): make port configurable
40 MessageLoop::current()->Run(); 41 MessageLoop::current()->Run();
41 42
42 if (parsed_command_line.HasSwitch("stats")) { 43 if (parsed_command_line.HasSwitch("stats")) {
43 // Dump the stats table. 44 // Dump the stats table.
44 printf("<stats>\n"); 45 printf("<stats>\n");
45 int counter_max = table.GetMaxCounters(); 46 int counter_max = table.GetMaxCounters();
46 for (int index=0; index < counter_max; index++) { 47 for (int index=0; index < counter_max; index++) {
47 std::string name(table.GetRowName(index)); 48 std::string name(table.GetRowName(index));
48 if (name.length() > 0) { 49 if (name.length() > 0) {
49 int value = table.GetRowValue(index); 50 int value = table.GetRowValue(index);
50 printf("%s:\t%d\n", name.c_str(), value); 51 printf("%s:\t%d\n", name.c_str(), value);
51 } 52 }
52 } 53 }
53 printf("</stats>\n"); 54 printf("</stats>\n");
54 } 55 }
55 56
56 } 57 }
OLDNEW
« no previous file with comments | « net/tools/dump_cache/url_to_filename_encoder_unittest.cc ('k') | net/tools/flip_server/acceptor_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698