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/bind.h" | 10 #include "base/bind.h" |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 const BoundNetLog& stream_net_log) { | 455 const BoundNetLog& stream_net_log) { |
456 CHECK_NE(state_, CLOSED); | 456 CHECK_NE(state_, CLOSED); |
457 | 457 |
458 *stream = NULL; | 458 *stream = NULL; |
459 | 459 |
460 // Don't allow access to secure push streams over an unauthenticated, but | 460 // Don't allow access to secure push streams over an unauthenticated, but |
461 // encrypted SSL socket. | 461 // encrypted SSL socket. |
462 if (is_secure_ && certificate_error_code_ != OK && | 462 if (is_secure_ && certificate_error_code_ != OK && |
463 (url.SchemeIs("https") || url.SchemeIs("wss"))) { | 463 (url.SchemeIs("https") || url.SchemeIs("wss"))) { |
464 RecordProtocolErrorHistogram( | 464 RecordProtocolErrorHistogram( |
465 PROTOCOL_ERROR_REQUST_FOR_SECURE_CONTENT_OVER_INSECURE_SESSION); | 465 PROTOCOL_ERROR_REQUEST_FOR_SECURE_CONTENT_OVER_INSECURE_SESSION); |
466 CloseSessionOnError( | 466 CloseSessionOnError( |
467 static_cast<net::Error>(certificate_error_code_), | 467 static_cast<net::Error>(certificate_error_code_), |
468 true, | 468 true, |
469 "Tried to get SPDY stream for secure content over an unauthenticated " | 469 "Tried to get SPDY stream for secure content over an unauthenticated " |
470 "session."); | 470 "session."); |
471 return ERR_SPDY_PROTOCOL_ERROR; | 471 return ERR_SPDY_PROTOCOL_ERROR; |
472 } | 472 } |
473 | 473 |
474 *stream = GetActivePushStream(url.spec()); | 474 *stream = GetActivePushStream(url.spec()); |
475 if (stream->get()) { | 475 if (stream->get()) { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 scoped_refptr<SpdyStream>* spdy_stream, | 560 scoped_refptr<SpdyStream>* spdy_stream, |
561 const BoundNetLog& stream_net_log) { | 561 const BoundNetLog& stream_net_log) { |
562 DCHECK_GE(priority, MINIMUM_PRIORITY); | 562 DCHECK_GE(priority, MINIMUM_PRIORITY); |
563 DCHECK_LT(priority, NUM_PRIORITIES); | 563 DCHECK_LT(priority, NUM_PRIORITIES); |
564 | 564 |
565 // Make sure that we don't try to send https/wss over an unauthenticated, but | 565 // Make sure that we don't try to send https/wss over an unauthenticated, but |
566 // encrypted SSL socket. | 566 // encrypted SSL socket. |
567 if (is_secure_ && certificate_error_code_ != OK && | 567 if (is_secure_ && certificate_error_code_ != OK && |
568 (url.SchemeIs("https") || url.SchemeIs("wss"))) { | 568 (url.SchemeIs("https") || url.SchemeIs("wss"))) { |
569 RecordProtocolErrorHistogram( | 569 RecordProtocolErrorHistogram( |
570 PROTOCOL_ERROR_REQUST_FOR_SECURE_CONTENT_OVER_INSECURE_SESSION); | 570 PROTOCOL_ERROR_REQUEST_FOR_SECURE_CONTENT_OVER_INSECURE_SESSION); |
571 CloseSessionOnError( | 571 CloseSessionOnError( |
572 static_cast<net::Error>(certificate_error_code_), | 572 static_cast<net::Error>(certificate_error_code_), |
573 true, | 573 true, |
574 "Tried to create SPDY stream for secure content over an " | 574 "Tried to create SPDY stream for secure content over an " |
575 "unauthenticated session."); | 575 "unauthenticated session."); |
576 return ERR_SPDY_PROTOCOL_ERROR; | 576 return ERR_SPDY_PROTOCOL_ERROR; |
577 } | 577 } |
578 | 578 |
579 const std::string& path = url.PathForRequest(); | 579 const std::string& path = url.PathForRequest(); |
580 | 580 |
(...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2002 SSLClientSocket* SpdySession::GetSSLClientSocket() const { | 2002 SSLClientSocket* SpdySession::GetSSLClientSocket() const { |
2003 if (!is_secure_) | 2003 if (!is_secure_) |
2004 return NULL; | 2004 return NULL; |
2005 SSLClientSocket* ssl_socket = | 2005 SSLClientSocket* ssl_socket = |
2006 reinterpret_cast<SSLClientSocket*>(connection_->socket()); | 2006 reinterpret_cast<SSLClientSocket*>(connection_->socket()); |
2007 DCHECK(ssl_socket); | 2007 DCHECK(ssl_socket); |
2008 return ssl_socket; | 2008 return ssl_socket; |
2009 } | 2009 } |
2010 | 2010 |
2011 } // namespace net | 2011 } // namespace net |
OLD | NEW |