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

Side by Side Diff: net/base/trace_net_log_observer.cc

Issue 935723002: Promote "netlog" tracing category to a default category (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test Created 5 years, 10 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
« no previous file with comments | « no previous file | net/base/trace_net_log_observer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "net/base/trace_net_log_observer.h" 5 #include "net/base/trace_net_log_observer.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/json/json_writer.h" 11 #include "base/json/json_writer.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/trace_event/trace_event.h" 14 #include "base/trace_event/trace_event.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "net/base/net_log.h" 16 #include "net/base/net_log.h"
17 17
18 namespace net { 18 namespace net {
19 19
20 namespace { 20 namespace {
21 21
22 // TraceLog category for NetLog events. 22 // TraceLog category for NetLog events.
23 const char kNetLogTracingCategory[] = TRACE_DISABLED_BY_DEFAULT("netlog"); 23 const char kNetLogTracingCategory[] = "netlog";
24 24
25 class TracedValue : public base::trace_event::ConvertableToTraceFormat { 25 class TracedValue : public base::trace_event::ConvertableToTraceFormat {
26 public: 26 public:
27 explicit TracedValue(scoped_ptr<base::Value> value) : value_(value.Pass()) {} 27 explicit TracedValue(scoped_ptr<base::Value> value) : value_(value.Pass()) {}
28 28
29 private: 29 private:
30 ~TracedValue() override {} 30 ~TracedValue() override {}
31 31
32 void AppendAsTraceFormat(std::string* out) const override { 32 void AppendAsTraceFormat(std::string* out) const override {
33 if (value_) { 33 if (value_) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 net_log_to_watch_->AddThreadSafeObserver(this, 103 net_log_to_watch_->AddThreadSafeObserver(this,
104 NetLog::LOG_STRIP_PRIVATE_DATA); 104 NetLog::LOG_STRIP_PRIVATE_DATA);
105 } 105 }
106 106
107 void TraceNetLogObserver::OnTraceLogDisabled() { 107 void TraceNetLogObserver::OnTraceLogDisabled() {
108 if (net_log()) 108 if (net_log())
109 net_log()->RemoveThreadSafeObserver(this); 109 net_log()->RemoveThreadSafeObserver(this);
110 } 110 }
111 111
112 } // namespace net 112 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/base/trace_net_log_observer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698