| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "webkit/tools/test_shell/simple_socket_stream_bridge.h" | 7 #include "webkit/tools/test_shell/simple_socket_stream_bridge.h" |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 socket_ = NULL; | 150 socket_ = NULL; |
| 151 socket_id_ = kNoSocketId; | 151 socket_id_ = kNoSocketId; |
| 152 message_loop_->PostTask( | 152 message_loop_->PostTask( |
| 153 FROM_HERE, | 153 FROM_HERE, |
| 154 NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoOnClose)); | 154 NewRunnableMethod(this, &WebSocketStreamHandleBridgeImpl::DoOnClose)); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void WebSocketStreamHandleBridgeImpl::DoConnect(const GURL& url) { | 157 void WebSocketStreamHandleBridgeImpl::DoConnect(const GURL& url) { |
| 158 DCHECK(MessageLoop::current() == g_io_thread); | 158 DCHECK(MessageLoop::current() == g_io_thread); |
| 159 socket_ = net::SocketStreamJob::CreateSocketStreamJob( | 159 socket_ = net::SocketStreamJob::CreateSocketStreamJob( |
| 160 url, this, *g_request_context); | 160 url, this, g_request_context->transport_security_state(), |
| 161 g_request_context->ssl_config_service()); |
| 161 socket_->set_context(g_request_context); | 162 socket_->set_context(g_request_context); |
| 162 socket_->Connect(); | 163 socket_->Connect(); |
| 163 } | 164 } |
| 164 | 165 |
| 165 void WebSocketStreamHandleBridgeImpl::DoSend(std::vector<char>* data) { | 166 void WebSocketStreamHandleBridgeImpl::DoSend(std::vector<char>* data) { |
| 166 DCHECK(MessageLoop::current() == g_io_thread); | 167 DCHECK(MessageLoop::current() == g_io_thread); |
| 167 scoped_ptr<std::vector<char> > scoped_data(data); | 168 scoped_ptr<std::vector<char> > scoped_data(data); |
| 168 if (!socket_) | 169 if (!socket_) |
| 169 return; | 170 return; |
| 170 if (!socket_->SendData(&(data->at(0)), data->size())) | 171 if (!socket_->SendData(&(data->at(0)), data->size())) |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 namespace webkit_glue { | 234 namespace webkit_glue { |
| 234 | 235 |
| 235 /* static */ | 236 /* static */ |
| 236 WebSocketStreamHandleBridge* WebSocketStreamHandleBridge::Create( | 237 WebSocketStreamHandleBridge* WebSocketStreamHandleBridge::Create( |
| 237 WebKit::WebSocketStreamHandle* handle, | 238 WebKit::WebSocketStreamHandle* handle, |
| 238 WebSocketStreamHandleDelegate* delegate) { | 239 WebSocketStreamHandleDelegate* delegate) { |
| 239 return new WebSocketStreamHandleBridgeImpl(handle, delegate); | 240 return new WebSocketStreamHandleBridgeImpl(handle, delegate); |
| 240 } | 241 } |
| 241 | 242 |
| 242 } // namespace webkit_glue | 243 } // namespace webkit_glue |
| OLD | NEW |