OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <map> | 7 #include <map> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 const int kReadBufferSize = 8 * 1024; | 106 const int kReadBufferSize = 8 * 1024; |
107 const int kDefaultConnectionAtRiskOfLossSeconds = 10; | 107 const int kDefaultConnectionAtRiskOfLossSeconds = 10; |
108 const int kTrailingPingDelayTimeSeconds = 1; | 108 const int kTrailingPingDelayTimeSeconds = 1; |
109 const int kHungIntervalSeconds = 10; | 109 const int kHungIntervalSeconds = 10; |
110 | 110 |
111 class NetLogSpdySessionParameter : public NetLog::EventParameters { | 111 class NetLogSpdySessionParameter : public NetLog::EventParameters { |
112 public: | 112 public: |
113 NetLogSpdySessionParameter(const HostPortProxyPair& host_pair) | 113 NetLogSpdySessionParameter(const HostPortProxyPair& host_pair) |
114 : host_pair_(host_pair) {} | 114 : host_pair_(host_pair) {} |
| 115 |
115 virtual Value* ToValue() const { | 116 virtual Value* ToValue() const { |
116 DictionaryValue* dict = new DictionaryValue(); | 117 DictionaryValue* dict = new DictionaryValue(); |
117 dict->Set("host", new StringValue(host_pair_.first.ToString())); | 118 dict->Set("host", new StringValue(host_pair_.first.ToString())); |
118 dict->Set("proxy", new StringValue(host_pair_.second.ToPacString())); | 119 dict->Set("proxy", new StringValue(host_pair_.second.ToPacString())); |
119 return dict; | 120 return dict; |
120 } | 121 } |
| 122 |
121 private: | 123 private: |
| 124 virtual ~NetLogSpdySessionParameter() {} |
| 125 |
122 const HostPortProxyPair host_pair_; | 126 const HostPortProxyPair host_pair_; |
123 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySessionParameter); | 127 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySessionParameter); |
124 }; | 128 }; |
125 | 129 |
126 class NetLogSpdySettingParameter : public NetLog::EventParameters { | 130 class NetLogSpdySettingParameter : public NetLog::EventParameters { |
127 public: | 131 public: |
128 explicit NetLogSpdySettingParameter(SpdySettingsIds id, | 132 explicit NetLogSpdySettingParameter(SpdySettingsIds id, |
129 SpdySettingsFlags flags, | 133 SpdySettingsFlags flags, |
130 uint32 value) | 134 uint32 value) |
131 : id_(id), | 135 : id_(id), |
132 flags_(flags), | 136 flags_(flags), |
133 value_(value) { | 137 value_(value) { |
134 } | 138 } |
135 | 139 |
136 virtual Value* ToValue() const { | 140 virtual Value* ToValue() const { |
137 DictionaryValue* dict = new DictionaryValue(); | 141 DictionaryValue* dict = new DictionaryValue(); |
138 dict->SetInteger("id", id_); | 142 dict->SetInteger("id", id_); |
139 dict->SetInteger("flags", flags_); | 143 dict->SetInteger("flags", flags_); |
140 dict->SetInteger("value", value_); | 144 dict->SetInteger("value", value_); |
141 return dict; | 145 return dict; |
142 } | 146 } |
143 | 147 |
144 private: | 148 private: |
145 ~NetLogSpdySettingParameter() {} | 149 virtual ~NetLogSpdySettingParameter() {} |
| 150 |
146 const SpdySettingsIds id_; | 151 const SpdySettingsIds id_; |
147 const SpdySettingsFlags flags_; | 152 const SpdySettingsFlags flags_; |
148 const uint32 value_; | 153 const uint32 value_; |
149 | 154 |
150 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySettingParameter); | 155 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySettingParameter); |
151 }; | 156 }; |
152 | 157 |
153 class NetLogSpdySettingsParameter : public NetLog::EventParameters { | 158 class NetLogSpdySettingsParameter : public NetLog::EventParameters { |
154 public: | 159 public: |
155 explicit NetLogSpdySettingsParameter(const SpdySettings& settings) | 160 explicit NetLogSpdySettingsParameter(const SpdySettings& settings) |
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1960 SSLClientSocket* SpdySession::GetSSLClientSocket() const { | 1965 SSLClientSocket* SpdySession::GetSSLClientSocket() const { |
1961 if (!is_secure_) | 1966 if (!is_secure_) |
1962 return NULL; | 1967 return NULL; |
1963 SSLClientSocket* ssl_socket = | 1968 SSLClientSocket* ssl_socket = |
1964 reinterpret_cast<SSLClientSocket*>(connection_->socket()); | 1969 reinterpret_cast<SSLClientSocket*>(connection_->socket()); |
1965 DCHECK(ssl_socket); | 1970 DCHECK(ssl_socket); |
1966 return ssl_socket; | 1971 return ssl_socket; |
1967 } | 1972 } |
1968 | 1973 |
1969 } // namespace net | 1974 } // namespace net |
OLD | NEW |