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

Side by Side Diff: components/net_log/chrome_net_log.h

Issue 1347043002: Move ChromeNetLog to //components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 5 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
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 #ifndef CHROME_BROWSER_NET_CHROME_NET_LOG_H_ 5 #ifndef COMPONENTS_NET_LOG_CHROME_NET_LOG_H_
6 #define CHROME_BROWSER_NET_CHROME_NET_LOG_H_ 6 #define COMPONENTS_NET_LOG_CHROME_NET_LOG_H_
7 7
8 #include "base/atomicops.h" 8 #include <string>
9
10 #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.
9 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
10 #include "base/observer_list.h"
11 #include "base/synchronization/lock.h"
12 #include "net/log/net_log.h" 12 #include "net/log/net_log.h"
13 13
14 namespace base {
15 class FilePath;
16 class Value;
17 }
18
14 namespace net { 19 namespace net {
15 class WriteToFileNetLogObserver; 20 class WriteToFileNetLogObserver;
16 class TraceNetLogObserver; 21 class TraceNetLogObserver;
17 } 22 }
18 23
24 namespace net_log {
25
19 class NetLogTempFile; 26 class NetLogTempFile;
20 27
21 // ChromeNetLog is an implementation of NetLog that adds file loggers 28 // ChromeNetLog is an implementation of NetLog that adds file loggers
22 // as its observers. 29 // as its observers.
23 class ChromeNetLog : public net::NetLog { 30 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?
24 public: 31 public:
25 ChromeNetLog(); 32 // The log is saved to |log_file|.
33 // |log_file_mode| is the mode used to log in |log_file|.
34 // If |log_file| is empty, only a temporary log is created, and
35 // |log_file_mode| is not used.
36 ChromeNetLog(const base::FilePath& log_file,
37 net::NetLogCaptureMode log_file_mode,
38 const base::CommandLine::StringType& command_line_string,
39 const std::string& channel_string);
26 ~ChromeNetLog() override; 40 ~ChromeNetLog() override;
27 41
28 NetLogTempFile* net_log_temp_file() { 42 NetLogTempFile* net_log_temp_file() { return net_log_temp_file_.get(); }
29 return net_log_temp_file_.get(); 43
30 } 44 // Returns a Value containing constants needed to load a log file.
45 // Safe to call on any thread. Caller takes ownership of the returned Value.
46 static base::Value* GetConstants(
47 const base::CommandLine::StringType& command_line_string,
48 const std::string& channel_string);
31 49
32 private: 50 private:
33 scoped_ptr<net::WriteToFileNetLogObserver> write_to_file_observer_; 51 scoped_ptr<net::WriteToFileNetLogObserver> write_to_file_observer_;
34 scoped_ptr<NetLogTempFile> net_log_temp_file_; 52 scoped_ptr<NetLogTempFile> net_log_temp_file_;
35
36 scoped_ptr<net::TraceNetLogObserver> trace_net_log_observer_; 53 scoped_ptr<net::TraceNetLogObserver> trace_net_log_observer_;
37 54
38 DISALLOW_COPY_AND_ASSIGN(ChromeNetLog); 55 DISALLOW_COPY_AND_ASSIGN(ChromeNetLog);
39 }; 56 };
40 57
41 #endif // CHROME_BROWSER_NET_CHROME_NET_LOG_H_ 58 } // namespace net_log
59
60 #endif // COMPONENTS_NET_LOG_CHROME_NET_LOG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698