| 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/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 if (use_ssl_) { | 472 if (use_ssl_) { |
| 473 // Add a SSL socket on top of our existing transport socket. | 473 // Add a SSL socket on top of our existing transport socket. |
| 474 ClientSocket* socket = connection_->release_socket(); | 474 ClientSocket* socket = connection_->release_socket(); |
| 475 // TODO(mbelshe): Fix the hostname. This is BROKEN without having | 475 // TODO(mbelshe): Fix the hostname. This is BROKEN without having |
| 476 // a real hostname. | 476 // a real hostname. |
| 477 socket = session_->socket_factory()->CreateSSLClientSocket( | 477 socket = session_->socket_factory()->CreateSSLClientSocket( |
| 478 socket, "" /* request_->url.HostNoBrackets() */ , ssl_config_); | 478 socket, "" /* request_->url.HostNoBrackets() */ , ssl_config_); |
| 479 connection_->set_socket(socket); | 479 connection_->set_socket(socket); |
| 480 is_secure_ = true; | 480 is_secure_ = true; |
| 481 // TODO(willchan): Plumb NetLog into SPDY code. | 481 // TODO(willchan): Plumb NetLog into SPDY code. |
| 482 int status = connection_->socket()->Connect(&ssl_connect_callback_, NULL); | 482 int status = connection_->socket()->Connect(&ssl_connect_callback_); |
| 483 if (status != ERR_IO_PENDING) | 483 if (status != ERR_IO_PENDING) |
| 484 OnSSLConnect(status); | 484 OnSSLConnect(status); |
| 485 } else { | 485 } else { |
| 486 DCHECK_EQ(state_, CONNECTING); | 486 DCHECK_EQ(state_, CONNECTING); |
| 487 state_ = CONNECTED; | 487 state_ = CONNECTED; |
| 488 | 488 |
| 489 // Make sure we get any pending data sent. | 489 // Make sure we get any pending data sent. |
| 490 WriteSocketLater(); | 490 WriteSocketLater(); |
| 491 // Start reading | 491 // Start reading |
| 492 ReadSocket(); | 492 ReadSocket(); |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1126 if (settings.empty()) | 1126 if (settings.empty()) |
| 1127 return; | 1127 return; |
| 1128 | 1128 |
| 1129 // Create the SETTINGS frame and send it. | 1129 // Create the SETTINGS frame and send it. |
| 1130 scoped_ptr<spdy::SpdySettingsControlFrame> settings_frame( | 1130 scoped_ptr<spdy::SpdySettingsControlFrame> settings_frame( |
| 1131 spdy_framer_.CreateSettings(settings)); | 1131 spdy_framer_.CreateSettings(settings)); |
| 1132 QueueFrame(settings_frame.get(), 0, NULL); | 1132 QueueFrame(settings_frame.get(), 0, NULL); |
| 1133 } | 1133 } |
| 1134 | 1134 |
| 1135 } // namespace net | 1135 } // namespace net |
| OLD | NEW |