OLD | NEW |
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 #ifndef CHROME_BROWSER_NET_NET_LOG_TEMP_FILE_H_ | 5 #ifndef CHROME_BROWSER_NET_NET_LOG_TEMP_FILE_H_ |
6 #define CHROME_BROWSER_NET_NET_LOG_TEMP_FILE_H_ | 6 #define CHROME_BROWSER_NET_NET_LOG_TEMP_FILE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "net/log/net_log.h" | 14 #include "net/log/net_log.h" |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class DictionaryValue; | 17 class DictionaryValue; |
18 } | 18 } |
19 | 19 |
20 namespace net { | 20 namespace net { |
21 class NetLogLogger; | 21 class WriteToFileNetLogObserver; |
22 } | 22 } |
23 | 23 |
24 class ChromeNetLog; | 24 class ChromeNetLog; |
25 | 25 |
26 // NetLogTempFile logs all the NetLog entries into a temporary file | 26 // NetLogTempFile logs all the NetLog entries into a temporary file |
27 // "chrome-net-export-log.json" created in base::GetTempDir() directory. | 27 // "chrome-net-export-log.json" created in base::GetTempDir() directory. |
28 // | 28 // |
29 // NetLogTempFile maintains the current logging state (state_) and log file type | 29 // NetLogTempFile maintains the current logging state (state_) and log file type |
30 // (log_type_) of the logging into a chrome-net-export-log.json file. | 30 // (log_type_) of the logging into a chrome-net-export-log.json file. |
31 // | 31 // |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 LogType log_type_; // Type of current log file on disk. | 145 LogType log_type_; // Type of current log file on disk. |
146 | 146 |
147 // Name of the file. It defaults to chrome-net-export-log.json, but can be | 147 // Name of the file. It defaults to chrome-net-export-log.json, but can be |
148 // overwritten by unit tests. | 148 // overwritten by unit tests. |
149 base::FilePath::StringType log_filename_; | 149 base::FilePath::StringType log_filename_; |
150 | 150 |
151 base::FilePath log_path_; // base::FilePath to the temporary file. | 151 base::FilePath log_path_; // base::FilePath to the temporary file. |
152 | 152 |
153 // |net_log_logger_| watches the NetLog event stream, and sends all entries to | 153 // |net_log_logger_| watches the NetLog event stream, and sends all entries to |
154 // the file created in StartNetLog(). | 154 // the file created in StartNetLog(). |
155 scoped_ptr<net::NetLogLogger> net_log_logger_; | 155 scoped_ptr<net::WriteToFileNetLogObserver> net_log_logger_; |
156 | 156 |
157 // The |chrome_net_log_| is owned by the browser process, cached here to avoid | 157 // The |chrome_net_log_| is owned by the browser process, cached here to avoid |
158 // using global (g_browser_process). | 158 // using global (g_browser_process). |
159 ChromeNetLog* chrome_net_log_; | 159 ChromeNetLog* chrome_net_log_; |
160 | 160 |
161 DISALLOW_COPY_AND_ASSIGN(NetLogTempFile); | 161 DISALLOW_COPY_AND_ASSIGN(NetLogTempFile); |
162 }; | 162 }; |
163 | 163 |
164 #endif // CHROME_BROWSER_NET_NET_LOG_TEMP_FILE_H_ | 164 #endif // CHROME_BROWSER_NET_NET_LOG_TEMP_FILE_H_ |
OLD | NEW |