| 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/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/linked_ptr.h" | 8 #include "base/linked_ptr.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 11 #include "base/stats_counters.h" | 11 #include "base/stats_counters.h" |
| 12 #include "base/stl_util-inl.h" | 12 #include "base/stl_util-inl.h" |
| 13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/stringprintf.h" |
| 16 #include "base/time.h" |
| 15 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
| 16 #include "base/time.h" | |
| 17 #include "base/values.h" | 18 #include "base/values.h" |
| 18 #include "net/base/connection_type_histograms.h" | 19 #include "net/base/connection_type_histograms.h" |
| 19 #include "net/base/load_flags.h" | 20 #include "net/base/load_flags.h" |
| 20 #include "net/base/net_log.h" | 21 #include "net/base/net_log.h" |
| 21 #include "net/base/net_util.h" | 22 #include "net/base/net_util.h" |
| 22 #include "net/http/http_network_session.h" | 23 #include "net/http/http_network_session.h" |
| 23 #include "net/socket/client_socket.h" | 24 #include "net/socket/client_socket.h" |
| 24 #include "net/socket/client_socket_factory.h" | 25 #include "net/socket/client_socket_factory.h" |
| 25 #include "net/socket/ssl_client_socket.h" | 26 #include "net/socket/ssl_client_socket.h" |
| 26 #include "net/spdy/spdy_frame_builder.h" | 27 #include "net/spdy/spdy_frame_builder.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 NetLogSpdySynParameter(const linked_ptr<spdy::SpdyHeaderBlock>& headers, | 66 NetLogSpdySynParameter(const linked_ptr<spdy::SpdyHeaderBlock>& headers, |
| 66 spdy::SpdyControlFlags flags, | 67 spdy::SpdyControlFlags flags, |
| 67 spdy::SpdyStreamId id) | 68 spdy::SpdyStreamId id) |
| 68 : headers_(headers), flags_(flags), id_(id) {} | 69 : headers_(headers), flags_(flags), id_(id) {} |
| 69 | 70 |
| 70 Value* ToValue() const { | 71 Value* ToValue() const { |
| 71 DictionaryValue* dict = new DictionaryValue(); | 72 DictionaryValue* dict = new DictionaryValue(); |
| 72 ListValue* headers_list = new ListValue(); | 73 ListValue* headers_list = new ListValue(); |
| 73 for (spdy::SpdyHeaderBlock::const_iterator it = headers_->begin(); | 74 for (spdy::SpdyHeaderBlock::const_iterator it = headers_->begin(); |
| 74 it != headers_->end(); ++it) { | 75 it != headers_->end(); ++it) { |
| 75 headers_list->Append(new StringValue(StringPrintf("%s: %s", | 76 headers_list->Append(new StringValue(base::StringPrintf( |
| 76 it->first.c_str(), | 77 "%s: %s", it->first.c_str(), it->second.c_str()))); |
| 77 it->second.c_str()))); | |
| 78 } | 78 } |
| 79 dict->SetInteger("flags", flags_); | 79 dict->SetInteger("flags", flags_); |
| 80 dict->Set("headers", headers_list); | 80 dict->Set("headers", headers_list); |
| 81 dict->SetInteger("id", id_); | 81 dict->SetInteger("id", id_); |
| 82 return dict; | 82 return dict; |
| 83 } | 83 } |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 ~NetLogSpdySynParameter() {} | 86 ~NetLogSpdySynParameter() {} |
| 87 | 87 |
| 88 const linked_ptr<spdy::SpdyHeaderBlock> headers_; | 88 const linked_ptr<spdy::SpdyHeaderBlock> headers_; |
| 89 const spdy::SpdyControlFlags flags_; | 89 const spdy::SpdyControlFlags flags_; |
| 90 const spdy::SpdyStreamId id_; | 90 const spdy::SpdyStreamId id_; |
| 91 | 91 |
| 92 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySynParameter); | 92 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySynParameter); |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 class NetLogSpdySettingsParameter : public NetLog::EventParameters { | 95 class NetLogSpdySettingsParameter : public NetLog::EventParameters { |
| 96 public: | 96 public: |
| 97 explicit NetLogSpdySettingsParameter(const spdy::SpdySettings& settings) | 97 explicit NetLogSpdySettingsParameter(const spdy::SpdySettings& settings) |
| 98 : settings_(settings) {} | 98 : settings_(settings) {} |
| 99 | 99 |
| 100 Value* ToValue() const { | 100 Value* ToValue() const { |
| 101 DictionaryValue* dict = new DictionaryValue(); | 101 DictionaryValue* dict = new DictionaryValue(); |
| 102 ListValue* settings = new ListValue(); | 102 ListValue* settings = new ListValue(); |
| 103 for (spdy::SpdySettings::const_iterator it = settings_.begin(); | 103 for (spdy::SpdySettings::const_iterator it = settings_.begin(); |
| 104 it != settings_.end(); ++it) { | 104 it != settings_.end(); ++it) { |
| 105 settings->Append(new StringValue( | 105 settings->Append(new StringValue( |
| 106 StringPrintf("[%u:%u]", it->first.id(), it->second))); | 106 base::StringPrintf("[%u:%u]", it->first.id(), it->second))); |
| 107 } | 107 } |
| 108 dict->Set("settings", settings); | 108 dict->Set("settings", settings); |
| 109 return dict; | 109 return dict; |
| 110 } | 110 } |
| 111 | 111 |
| 112 private: | 112 private: |
| 113 ~NetLogSpdySettingsParameter() {} | 113 ~NetLogSpdySettingsParameter() {} |
| 114 const spdy::SpdySettings settings_; | 114 const spdy::SpdySettings settings_; |
| 115 | 115 |
| 116 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySettingsParameter); | 116 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySettingsParameter); |
| (...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1386 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsRetransRate", | 1386 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsRetransRate", |
| 1387 setting.second, | 1387 setting.second, |
| 1388 1, 100, 50); | 1388 1, 100, 50); |
| 1389 break; | 1389 break; |
| 1390 } | 1390 } |
| 1391 } | 1391 } |
| 1392 } | 1392 } |
| 1393 } | 1393 } |
| 1394 | 1394 |
| 1395 } // namespace net | 1395 } // namespace net |
| OLD | NEW |