Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: webkit/tools/test_shell/simple_socket_stream_bridge.cc

Issue 6873029: Apply HSTS rules to also upgrade ws:// -> wss:// if appropriate. This avoids (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // Release socket_ on IO thread. 149 // Release socket_ on IO thread.
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(url, this); 159 socket_ = net::SocketStreamJob::CreateSocketStreamJob(
160 url, this, *g_request_context);
160 socket_->set_context(g_request_context); 161 socket_->set_context(g_request_context);
161 socket_->Connect(); 162 socket_->Connect();
162 } 163 }
163 164
164 void WebSocketStreamHandleBridgeImpl::DoSend(std::vector<char>* data) { 165 void WebSocketStreamHandleBridgeImpl::DoSend(std::vector<char>* data) {
165 DCHECK(MessageLoop::current() == g_io_thread); 166 DCHECK(MessageLoop::current() == g_io_thread);
166 scoped_ptr<std::vector<char> > scoped_data(data); 167 scoped_ptr<std::vector<char> > scoped_data(data);
167 if (!socket_) 168 if (!socket_)
168 return; 169 return;
169 if (!socket_->SendData(&(data->at(0)), data->size())) 170 if (!socket_->SendData(&(data->at(0)), data->size()))
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 namespace webkit_glue { 233 namespace webkit_glue {
233 234
234 /* static */ 235 /* static */
235 WebSocketStreamHandleBridge* WebSocketStreamHandleBridge::Create( 236 WebSocketStreamHandleBridge* WebSocketStreamHandleBridge::Create(
236 WebKit::WebSocketStreamHandle* handle, 237 WebKit::WebSocketStreamHandle* handle,
237 WebSocketStreamHandleDelegate* delegate) { 238 WebSocketStreamHandleDelegate* delegate) {
238 return new WebSocketStreamHandleBridgeImpl(handle, delegate); 239 return new WebSocketStreamHandleBridgeImpl(handle, delegate);
239 } 240 }
240 241
241 } // namespace webkit_glue 242 } // namespace webkit_glue
OLDNEW
« net/url_request/url_request_context.cc ('K') | « net/websockets/websocket_job_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698