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

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

Issue 6005015: Revert 70618 - First pass at adding http/backend cache events to the NetLog. ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « net/base/net_log.h ('k') | net/base/net_log_event_type_list.h » ('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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/net_log.h" 5 #include "net/base/net_log.h"
6
7 #include "base/logging.h" 6 #include "base/logging.h"
8 #include "base/string_number_conversions.h" 7 #include "base/string_number_conversions.h"
9 #include "base/time.h" 8 #include "base/time.h"
10 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
11 #include "base/values.h" 10 #include "base/values.h"
12 #include "net/base/net_errors.h"
13 11
14 namespace net { 12 namespace net {
15 13
16 Value* NetLog::Source::ToValue() const { 14 Value* NetLog::Source::ToValue() const {
17 DictionaryValue* dict = new DictionaryValue(); 15 DictionaryValue* dict = new DictionaryValue();
18 dict->SetInteger("type", static_cast<int>(type)); 16 dict->SetInteger("type", static_cast<int>(type));
19 dict->SetInteger("id", static_cast<int>(id)); 17 dict->SetInteger("id", static_cast<int>(id));
20 return dict; 18 return dict;
21 } 19 }
22 20
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 const scoped_refptr<NetLog::EventParameters>& params) const { 150 const scoped_refptr<NetLog::EventParameters>& params) const {
153 AddEntry(event_type, NetLog::PHASE_BEGIN, params); 151 AddEntry(event_type, NetLog::PHASE_BEGIN, params);
154 } 152 }
155 153
156 void BoundNetLog::EndEvent( 154 void BoundNetLog::EndEvent(
157 NetLog::EventType event_type, 155 NetLog::EventType event_type,
158 const scoped_refptr<NetLog::EventParameters>& params) const { 156 const scoped_refptr<NetLog::EventParameters>& params) const {
159 AddEntry(event_type, NetLog::PHASE_END, params); 157 AddEntry(event_type, NetLog::PHASE_END, params);
160 } 158 }
161 159
162 void BoundNetLog::EndEventWithNetErrorCode(NetLog::EventType event_type,
163 int net_error) const {
164 DCHECK_NE(net_error, net::ERR_IO_PENDING);
165 if (net_error >= 0) {
166 EndEvent(event_type, NULL);
167 } else {
168 EndEvent(
169 event_type,
170 make_scoped_refptr(new NetLogIntegerParameter("net_error", net_error)));
171 }
172 }
173
174 // static 160 // static
175 BoundNetLog BoundNetLog::Make(NetLog* net_log, 161 BoundNetLog BoundNetLog::Make(NetLog* net_log,
176 NetLog::SourceType source_type) { 162 NetLog::SourceType source_type) {
177 if (!net_log) 163 if (!net_log)
178 return BoundNetLog(); 164 return BoundNetLog();
179 165
180 NetLog::Source source(source_type, net_log->NextID()); 166 NetLog::Source source(source_type, net_log->NextID());
181 return BoundNetLog(source, net_log); 167 return BoundNetLog(source, net_log);
182 } 168 }
183 169
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 const scoped_refptr<NetLog::EventParameters>& end_event_params) { 211 const scoped_refptr<NetLog::EventParameters>& end_event_params) {
226 DCHECK(!end_event_params_.get()); 212 DCHECK(!end_event_params_.get());
227 end_event_params_ = end_event_params; 213 end_event_params_ = end_event_params;
228 } 214 }
229 215
230 const BoundNetLog& ScopedNetLogEvent::net_log() const { 216 const BoundNetLog& ScopedNetLogEvent::net_log() const {
231 return net_log_; 217 return net_log_;
232 } 218 }
233 219
234 } // namespace net 220 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_log.h ('k') | net/base/net_log_event_type_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698