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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/linked_ptr.h" | 9 #include "base/memory/linked_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
546 | 546 |
547 DCHECK_EQ(active_streams_[stream_id].get(), stream.get()); | 547 DCHECK_EQ(active_streams_[stream_id].get(), stream.get()); |
548 return OK; | 548 return OK; |
549 } | 549 } |
550 | 550 |
551 bool SpdySession::NeedsCredentials(const HostPortPair& origin) const { | 551 bool SpdySession::NeedsCredentials(const HostPortPair& origin) const { |
552 if (!is_secure_) | 552 if (!is_secure_) |
553 return false; | 553 return false; |
554 SSLClientSocket* ssl_socket = | 554 SSLClientSocket* ssl_socket = |
555 reinterpret_cast<SSLClientSocket*>(connection_->socket()); | 555 reinterpret_cast<SSLClientSocket*>(connection_->socket()); |
556 if (ssl_socket->protocol_negotiated() <= SSLClientSocket::kProtoSPDY21) | |
wtc
2012/02/14 00:57:36
Nit: it's safer to test < SSLClientSocket:: kProto
Ryan Hamilton
2012/02/14 00:58:55
Done.
| |
557 return false; | |
556 if (!ssl_socket->WasOriginBoundCertSent()) | 558 if (!ssl_socket->WasOriginBoundCertSent()) |
557 return false; | 559 return false; |
558 return !credential_state_.HasCredential(origin); | 560 return !credential_state_.HasCredential(origin); |
559 } | 561 } |
560 | 562 |
561 int SpdySession::WriteSynStream( | 563 int SpdySession::WriteSynStream( |
562 spdy::SpdyStreamId stream_id, | 564 spdy::SpdyStreamId stream_id, |
563 RequestPriority priority, | 565 RequestPriority priority, |
564 spdy::SpdyControlFlags flags, | 566 spdy::SpdyControlFlags flags, |
565 const linked_ptr<spdy::SpdyHeaderBlock>& headers) { | 567 const linked_ptr<spdy::SpdyHeaderBlock>& headers) { |
(...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1916 if (it == pending_callback_map_.end()) | 1918 if (it == pending_callback_map_.end()) |
1917 return; | 1919 return; |
1918 | 1920 |
1919 CompletionCallback callback = it->second.callback; | 1921 CompletionCallback callback = it->second.callback; |
1920 int result = it->second.result; | 1922 int result = it->second.result; |
1921 pending_callback_map_.erase(it); | 1923 pending_callback_map_.erase(it); |
1922 callback.Run(result); | 1924 callback.Run(result); |
1923 } | 1925 } |
1924 | 1926 |
1925 } // namespace net | 1927 } // namespace net |
OLD | NEW |