Chromium Code Reviews| Index: components/net_log/chrome_net_log.h |
| diff --git a/chrome/browser/net/chrome_net_log.h b/components/net_log/chrome_net_log.h |
| similarity index 41% |
| rename from chrome/browser/net/chrome_net_log.h |
| rename to components/net_log/chrome_net_log.h |
| index 7c4b76e7e047c70a1d240b69d04faedea798a858..f0574075050b48b31d6c9c6994815fae687ba9b6 100644 |
| --- a/chrome/browser/net/chrome_net_log.h |
| +++ b/components/net_log/chrome_net_log.h |
| @@ -2,40 +2,59 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CHROME_BROWSER_NET_CHROME_NET_LOG_H_ |
| -#define CHROME_BROWSER_NET_CHROME_NET_LOG_H_ |
| +#ifndef COMPONENTS_NET_LOG_CHROME_NET_LOG_H_ |
| +#define COMPONENTS_NET_LOG_CHROME_NET_LOG_H_ |
| -#include "base/atomicops.h" |
| +#include <string> |
| + |
| +#include "base/command_line.h" |
|
mmenke
2015/09/17 15:50:51
While you're here, mind including base/macros.h, f
droger
2015/09/18 08:27:58
Done.
|
| #include "base/memory/scoped_ptr.h" |
| -#include "base/observer_list.h" |
| -#include "base/synchronization/lock.h" |
| #include "net/log/net_log.h" |
| +namespace base { |
| +class FilePath; |
| +class Value; |
| +} |
| + |
| namespace net { |
| class WriteToFileNetLogObserver; |
| class TraceNetLogObserver; |
| } |
| +namespace net_log { |
| + |
| class NetLogTempFile; |
| // ChromeNetLog is an implementation of NetLog that adds file loggers |
| // as its observers. |
| class ChromeNetLog : public net::NetLog { |
|
mmenke
2015/09/17 15:50:51
Hrm...I don't think we're in Chrome anymore. Shou
droger
2015/09/17 15:53:23
What about NetLogImpl?
|
| public: |
| - ChromeNetLog(); |
| + // The log is saved to |log_file|. |
| + // |log_file_mode| is the mode used to log in |log_file|. |
| + // If |log_file| is empty, only a temporary log is created, and |
| + // |log_file_mode| is not used. |
| + ChromeNetLog(const base::FilePath& log_file, |
| + net::NetLogCaptureMode log_file_mode, |
| + const base::CommandLine::StringType& command_line_string, |
| + const std::string& channel_string); |
| ~ChromeNetLog() override; |
| - NetLogTempFile* net_log_temp_file() { |
| - return net_log_temp_file_.get(); |
| - } |
| + NetLogTempFile* net_log_temp_file() { return net_log_temp_file_.get(); } |
| + |
| + // Returns a Value containing constants needed to load a log file. |
| + // Safe to call on any thread. Caller takes ownership of the returned Value. |
| + static base::Value* GetConstants( |
| + const base::CommandLine::StringType& command_line_string, |
| + const std::string& channel_string); |
| private: |
| scoped_ptr<net::WriteToFileNetLogObserver> write_to_file_observer_; |
| scoped_ptr<NetLogTempFile> net_log_temp_file_; |
| - |
| scoped_ptr<net::TraceNetLogObserver> trace_net_log_observer_; |
| DISALLOW_COPY_AND_ASSIGN(ChromeNetLog); |
| }; |
| -#endif // CHROME_BROWSER_NET_CHROME_NET_LOG_H_ |
| +} // namespace net_log |
| + |
| +#endif // COMPONENTS_NET_LOG_CHROME_NET_LOG_H_ |