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 // TODO(ukai): code is similar with http_network_transaction.cc. We should | 5 // TODO(ukai): code is similar with http_network_transaction.cc. We should |
6 // think about ways to share code, if possible. | 6 // think about ways to share code, if possible. |
7 | 7 |
8 #include "net/socket_stream/socket_stream.h" | 8 #include "net/socket_stream/socket_stream.h" |
9 | 9 |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/bind.h" | 14 #include "base/bind.h" |
15 #include "base/bind_helpers.h" | 15 #include "base/bind_helpers.h" |
16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/message_loop/message_loop.h" | 18 #include "base/message_loop/message_loop.h" |
19 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
20 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
22 #include "net/base/auth.h" | 22 #include "net/base/auth.h" |
23 #include "net/base/io_buffer.h" | 23 #include "net/base/io_buffer.h" |
| 24 #include "net/base/load_flags.h" |
24 #include "net/base/net_errors.h" | 25 #include "net/base/net_errors.h" |
25 #include "net/base/net_util.h" | 26 #include "net/base/net_util.h" |
26 #include "net/dns/host_resolver.h" | 27 #include "net/dns/host_resolver.h" |
27 #include "net/http/http_auth_controller.h" | 28 #include "net/http/http_auth_controller.h" |
28 #include "net/http/http_network_session.h" | 29 #include "net/http/http_network_session.h" |
29 #include "net/http/http_request_headers.h" | 30 #include "net/http/http_request_headers.h" |
30 #include "net/http/http_request_info.h" | 31 #include "net/http/http_request_info.h" |
31 #include "net/http/http_response_headers.h" | 32 #include "net/http/http_response_headers.h" |
32 #include "net/http/http_stream_factory.h" | 33 #include "net/http/http_stream_factory.h" |
33 #include "net/http/http_transaction_factory.h" | 34 #include "net/http/http_transaction_factory.h" |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 | 624 |
624 // TODO(toyoshim): Check server advertisement of SPDY through the HTTP | 625 // TODO(toyoshim): Check server advertisement of SPDY through the HTTP |
625 // Alternate-Protocol header, then switch to SPDY if SPDY is available. | 626 // Alternate-Protocol header, then switch to SPDY if SPDY is available. |
626 // Usually we already have a session to the SPDY server because JavaScript | 627 // Usually we already have a session to the SPDY server because JavaScript |
627 // running WebSocket itself would be served by SPDY. But, in some situation | 628 // running WebSocket itself would be served by SPDY. But, in some situation |
628 // (E.g. Used by Chrome Extensions or used for cross origin connection), this | 629 // (E.g. Used by Chrome Extensions or used for cross origin connection), this |
629 // connection might be the first one. At that time, we should check | 630 // connection might be the first one. At that time, we should check |
630 // Alternate-Protocol header here for ws:// or TLS NPN extension for wss:// . | 631 // Alternate-Protocol header here for ws:// or TLS NPN extension for wss:// . |
631 | 632 |
632 return context_->proxy_service()->ResolveProxy( | 633 return context_->proxy_service()->ResolveProxy( |
633 proxy_url_, &proxy_info_, io_callback_, &pac_request_, net_log_); | 634 proxy_url_, net::LOAD_NORMAL, &proxy_info_, io_callback_, &pac_request_, |
| 635 NULL, net_log_); |
634 } | 636 } |
635 | 637 |
636 int SocketStream::DoResolveProxyComplete(int result) { | 638 int SocketStream::DoResolveProxyComplete(int result) { |
637 pac_request_ = NULL; | 639 pac_request_ = NULL; |
638 if (result != OK) { | 640 if (result != OK) { |
639 DVLOG(1) << "Failed to resolve proxy: " << result; | 641 DVLOG(1) << "Failed to resolve proxy: " << result; |
640 if (delegate_) | 642 if (delegate_) |
641 delegate_->OnError(this, result); | 643 delegate_->OnError(this, result); |
642 proxy_info_.UseDirect(); | 644 proxy_info_.UseDirect(); |
643 } | 645 } |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1346 | 1348 |
1347 delegate_->OnSSLCertificateError(this, ssl_info, fatal); | 1349 delegate_->OnSSLCertificateError(this, ssl_info, fatal); |
1348 return ERR_IO_PENDING; | 1350 return ERR_IO_PENDING; |
1349 } | 1351 } |
1350 | 1352 |
1351 CookieStore* SocketStream::cookie_store() const { | 1353 CookieStore* SocketStream::cookie_store() const { |
1352 return cookie_store_; | 1354 return cookie_store_; |
1353 } | 1355 } |
1354 | 1356 |
1355 } // namespace net | 1357 } // namespace net |
OLD | NEW |