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

Unified Diff: net/tools/gdig/file_net_log.cc

Issue 16137008: Refactor net::NetLog to provide implementation of observer pattern, not just the interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 7 years, 6 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
« no previous file with comments | « net/tools/gdig/file_net_log.h ('k') | net/tools/gdig/gdig.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/gdig/file_net_log.cc
diff --git a/net/tools/gdig/file_net_log.cc b/net/tools/gdig/file_net_log.cc
index 51cf78d60e0f8b8949c37f32a0dbace2e3b5e8b6..7c755c855fe129fc1247958526b2fb6aea74e9f4 100644
--- a/net/tools/gdig/file_net_log.cc
+++ b/net/tools/gdig/file_net_log.cc
@@ -12,24 +12,20 @@
namespace net {
-FileNetLog::FileNetLog(FILE* destination, LogLevel level)
- : log_level_(level),
- destination_(destination) {
+FileNetLogObserver::FileNetLogObserver(FILE* destination)
+ : destination_(destination) {
DCHECK(destination != NULL);
- // Without calling GetNext() once here, the first GetNext will return 0
- // that is not a valid id.
- sequence_number_.GetNext();
}
-FileNetLog::~FileNetLog() {
+FileNetLogObserver::~FileNetLogObserver() {
}
-void FileNetLog::OnAddEntry(const net::NetLog::Entry& entry) {
+void FileNetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) {
// Only BoundNetLogs without a NetLog should have an invalid source.
DCHECK(entry.source().IsValid());
- const char* source = SourceTypeToString(entry.source().type);
- const char* type = EventTypeToString(entry.type());
+ const char* source = NetLog::SourceTypeToString(entry.source().type);
+ const char* type = NetLog::EventTypeToString(entry.type());
scoped_ptr<Value> param_value(entry.ParametersToValue());
std::string params;
@@ -49,28 +45,4 @@ void FileNetLog::OnAddEntry(const net::NetLog::Entry& entry) {
entry.source().id, source, type, params.c_str());
}
-uint32 FileNetLog::NextID() {
- return sequence_number_.GetNext();
-}
-
-NetLog::LogLevel FileNetLog::GetLogLevel() const {
- return log_level_;
-}
-
-void FileNetLog::AddThreadSafeObserver(
- NetLog::ThreadSafeObserver* observer,
- NetLog::LogLevel log_level) {
- NOTIMPLEMENTED() << "Not currently used by gdig.";
-}
-
-void FileNetLog::SetObserverLogLevel(ThreadSafeObserver* observer,
- LogLevel log_level) {
- NOTIMPLEMENTED() << "Not currently used by gdig.";
-}
-
-void FileNetLog::RemoveThreadSafeObserver(
- NetLog::ThreadSafeObserver* observer) {
- NOTIMPLEMENTED() << "Not currently used by gdig.";
-}
-
} // namespace net
« no previous file with comments | « net/tools/gdig/file_net_log.h ('k') | net/tools/gdig/gdig.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698