OLD | NEW |
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 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 176 matching lines...) Loading... |
187 return dict; | 187 return dict; |
188 } | 188 } |
189 | 189 |
190 Value* NetLogSourceParameter::ToValue() const { | 190 Value* NetLogSourceParameter::ToValue() const { |
191 DictionaryValue* dict = new DictionaryValue(); | 191 DictionaryValue* dict = new DictionaryValue(); |
192 | 192 |
193 dict->Set(name_, value_.ToValue()); | 193 dict->Set(name_, value_.ToValue()); |
194 return dict; | 194 return dict; |
195 } | 195 } |
196 | 196 |
| 197 ScopedNetLogEvent::ScopedNetLogEvent( |
| 198 const BoundNetLog& net_log, |
| 199 NetLog::EventType event_type, |
| 200 const scoped_refptr<NetLog::EventParameters>& params) |
| 201 : net_log_(net_log), |
| 202 event_type_(event_type) { |
| 203 net_log_.BeginEvent(event_type, params); |
| 204 } |
| 205 |
| 206 ScopedNetLogEvent::~ScopedNetLogEvent() { |
| 207 net_log_.EndEvent(event_type_, end_event_params_); |
| 208 } |
| 209 |
| 210 void ScopedNetLogEvent::SetEndEventParameters( |
| 211 const scoped_refptr<NetLog::EventParameters>& end_event_params) { |
| 212 DCHECK(!end_event_params_.get()); |
| 213 end_event_params_ = end_event_params; |
| 214 } |
| 215 |
| 216 const BoundNetLog& ScopedNetLogEvent::net_log() const { |
| 217 return net_log_; |
| 218 } |
| 219 |
197 } // namespace net | 220 } // namespace net |
OLD | NEW |