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

Side by Side Diff: content/browser/renderer_host/socket_stream_host.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 "content/browser/renderer_host/socket_stream_host.h" 5 #include "content/browser/renderer_host/socket_stream_host.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/common/socket_stream.h" 8 #include "content/common/socket_stream.h"
9 #include "net/socket_stream/socket_stream_job.h" 9 #include "net/socket_stream/socket_stream_job.h"
10 10
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 SocketStreamHost::~SocketStreamHost() { 42 SocketStreamHost::~SocketStreamHost() {
43 VLOG(1) << "SocketStreamHost destructed socket_id=" << socket_id_; 43 VLOG(1) << "SocketStreamHost destructed socket_id=" << socket_id_;
44 socket_->DetachDelegate(); 44 socket_->DetachDelegate();
45 } 45 }
46 46
47 void SocketStreamHost::Connect(const GURL& url, 47 void SocketStreamHost::Connect(const GURL& url,
48 net::URLRequestContext* request_context) { 48 net::URLRequestContext* request_context) {
49 VLOG(1) << "SocketStreamHost::Connect url=" << url; 49 VLOG(1) << "SocketStreamHost::Connect url=" << url;
50 socket_ = net::SocketStreamJob::CreateSocketStreamJob(url, delegate_); 50 socket_ = net::SocketStreamJob::CreateSocketStreamJob(
51 url, delegate_, *request_context);
51 socket_->set_context(request_context); 52 socket_->set_context(request_context);
52 socket_->SetUserData(kSocketIdKey, new SocketStreamId(socket_id_)); 53 socket_->SetUserData(kSocketIdKey, new SocketStreamId(socket_id_));
53 socket_->Connect(); 54 socket_->Connect();
54 } 55 }
55 56
56 bool SocketStreamHost::SendData(const std::vector<char>& data) { 57 bool SocketStreamHost::SendData(const std::vector<char>& data) {
57 VLOG(1) << "SocketStreamHost::SendData"; 58 VLOG(1) << "SocketStreamHost::SendData";
58 return socket_ && socket_->SendData(&data[0], data.size()); 59 return socket_ && socket_->SendData(&data[0], data.size());
59 } 60 }
60 61
61 void SocketStreamHost::Close() { 62 void SocketStreamHost::Close() {
62 VLOG(1) << "SocketStreamHost::Close"; 63 VLOG(1) << "SocketStreamHost::Close";
63 if (!socket_) 64 if (!socket_)
64 return; 65 return;
65 socket_->Close(); 66 socket_->Close();
66 } 67 }
OLDNEW
« no previous file with comments | « no previous file | net/socket_stream/socket_stream_job.h » ('j') | net/socket_stream/socket_stream_job.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698