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> |
(...skipping 26 matching lines...) Expand all Loading... | |
37 #include "net/socket/ssl_client_socket.h" | 37 #include "net/socket/ssl_client_socket.h" |
38 #include "net/socket/tcp_client_socket.h" | 38 #include "net/socket/tcp_client_socket.h" |
39 #include "net/socket_stream/socket_stream_metrics.h" | 39 #include "net/socket_stream/socket_stream_metrics.h" |
40 #include "net/url_request/url_request.h" | 40 #include "net/url_request/url_request.h" |
41 | 41 |
42 static const int kMaxPendingSendAllowed = 32768; // 32 kilobytes. | 42 static const int kMaxPendingSendAllowed = 32768; // 32 kilobytes. |
43 static const int kReadBufferSize = 4096; | 43 static const int kReadBufferSize = 4096; |
44 | 44 |
45 namespace net { | 45 namespace net { |
46 | 46 |
47 int SocketStream::Delegate::OnStartOpenConnection( | |
48 SocketStream* socket, const CompletionCallback& callback) { | |
49 return OK; | |
50 } | |
51 | |
52 void SocketStream::Delegate::OnAuthRequired(SocketStream* socket, | |
53 AuthChallengeInfo* auth_info) { | |
54 // By default, no credential is available and close the connection. | |
55 socket->Close(); | |
56 } | |
57 | |
58 void SocketStream::Delegate::OnSSLCertificateError( | |
59 SocketStream* socket, | |
60 const SSLInfo& ssl_info, | |
61 bool fatal) { | |
62 socket->CancelWithSSLError(ssl_info); | |
63 } | |
64 | |
65 bool SocketStream::Delegate::CanGetCookies(SocketStream* socket, | |
66 const GURL& url) { | |
67 return true; | |
68 } | |
69 | |
70 bool SocketStream::Delegate::CanSetCookie(SocketStream* request, | |
71 const GURL& url, | |
72 const std::string& cookie_line, | |
73 CookieOptions* options) { | |
74 return true; | |
75 } | |
76 | |
77 SocketStream::RequestHeaders::~RequestHeaders() { data_ = NULL; } | |
mmenke
2012/08/09 15:13:35
This should be lower in the file, in the same orde
hans
2012/08/09 15:35:42
Done.
| |
78 | |
47 SocketStream::ResponseHeaders::ResponseHeaders() : IOBuffer() {} | 79 SocketStream::ResponseHeaders::ResponseHeaders() : IOBuffer() {} |
48 | 80 |
49 void SocketStream::ResponseHeaders::Realloc(size_t new_size) { | 81 void SocketStream::ResponseHeaders::Realloc(size_t new_size) { |
50 headers_.reset(static_cast<char*>(realloc(headers_.release(), new_size))); | 82 headers_.reset(static_cast<char*>(realloc(headers_.release(), new_size))); |
51 } | 83 } |
52 | 84 |
53 SocketStream::ResponseHeaders::~ResponseHeaders() { data_ = NULL; } | 85 SocketStream::ResponseHeaders::~ResponseHeaders() { data_ = NULL; } |
54 | 86 |
55 SocketStream::SocketStream(const GURL& url, Delegate* delegate) | 87 SocketStream::SocketStream(const GURL& url, Delegate* delegate) |
56 : delegate_(delegate), | 88 : delegate_(delegate), |
(...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1289 | 1321 |
1290 SSLConfigService* SocketStream::ssl_config_service() const { | 1322 SSLConfigService* SocketStream::ssl_config_service() const { |
1291 return context_->ssl_config_service(); | 1323 return context_->ssl_config_service(); |
1292 } | 1324 } |
1293 | 1325 |
1294 ProxyService* SocketStream::proxy_service() const { | 1326 ProxyService* SocketStream::proxy_service() const { |
1295 return context_->proxy_service(); | 1327 return context_->proxy_service(); |
1296 } | 1328 } |
1297 | 1329 |
1298 } // namespace net | 1330 } // namespace net |
OLD | NEW |