OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef NET_TOOLS_FLIP_SERVER_LOADTIME_MEASUREMENT_H_ | 5 #ifndef NET_TOOLS_FLIP_SERVER_LOADTIME_MEASUREMENT_H_ |
6 #define NET_TOOLS_FLIP_SERVER_LOADTIME_MEASUREMENT_H_ | 6 #define NET_TOOLS_FLIP_SERVER_LOADTIME_MEASUREMENT_H_ |
7 | 7 |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
11 #include <sys/types.h> | 11 #include <sys/types.h> |
12 #include <unistd.h> | 12 #include <unistd.h> |
13 | 13 |
14 #include <map> | 14 #include <map> |
15 #include <string> | 15 #include <string> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "base/file_util.h" | 18 #include "base/files/file_util.h" |
19 #include "base/strings/string_split.h" | 19 #include "base/strings/string_split.h" |
20 | 20 |
21 // Class to handle loadtime measure related urls, which all start with testing | 21 // Class to handle loadtime measure related urls, which all start with testing |
22 // The in memory server has a singleton object of this class. It includes a | 22 // The in memory server has a singleton object of this class. It includes a |
23 // html file containing javascript to go through a list of urls and upload the | 23 // html file containing javascript to go through a list of urls and upload the |
24 // loadtime. The users can modify urls.txt to define the urls they want to | 24 // loadtime. The users can modify urls.txt to define the urls they want to |
25 // measure and start with downloading the html file from browser. | 25 // measure and start with downloading the html file from browser. |
26 class LoadtimeMeasurement { | 26 class LoadtimeMeasurement { |
27 public: | 27 public: |
28 LoadtimeMeasurement(const std::string& urls_file, | 28 LoadtimeMeasurement(const std::string& urls_file, |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 87 } |
88 | 88 |
89 private: | 89 private: |
90 int num_urls_; | 90 int num_urls_; |
91 std::vector<std::string> urls_; | 91 std::vector<std::string> urls_; |
92 std::map<std::string, int> loadtimes_; | 92 std::map<std::string, int> loadtimes_; |
93 const std::string pageload_html_file_; | 93 const std::string pageload_html_file_; |
94 }; | 94 }; |
95 | 95 |
96 #endif // NET_TOOLS_FLIP_SERVER_LOADTIME_MEASUREMENT_H_ | 96 #endif // NET_TOOLS_FLIP_SERVER_LOADTIME_MEASUREMENT_H_ |
OLD | NEW |