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

Unified 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: DetachFromThread 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 side-by-side diff with in-line comments
Download patch
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 45%
rename from chrome/browser/net/chrome_net_log.h
rename to components/net_log/chrome_net_log.h
index 7c4b76e7e047c70a1d240b69d04faedea798a858..e5f5b6823eef79cdf1ab85622fe87080e0619492 100644
--- a/chrome/browser/net/chrome_net_log.h
+++ b/components/net_log/chrome_net_log.h
@@ -2,40 +2,55 @@
// 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 <string>
-#include "base/atomicops.h"
#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 {
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 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 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_

Powered by Google App Engine
This is Rietveld 408576698