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

Side by Side Diff: chrome/browser/renderer_host/socket_stream_host.cc

Issue 6338002: net: Remove typedef net::URLRequestContext URLRequestContext; (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for real Created 9 years, 11 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) 2010 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 "chrome/browser/renderer_host/socket_stream_host.h" 5 #include "chrome/browser/renderer_host/socket_stream_host.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/common/net/socket_stream.h" 8 #include "chrome/common/net/socket_stream.h"
9 #include "net/socket_stream/socket_stream_job.h" 9 #include "net/socket_stream/socket_stream_job.h"
10 10
11 static const char* kSocketIdKey = "socketId"; 11 static const char* kSocketIdKey = "socketId";
(...skipping 26 matching lines...) Expand all
38 } 38 }
39 return chrome_common_net::kNoSocketId; 39 return chrome_common_net::kNoSocketId;
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 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(url, delegate_);
51 socket_->set_context(request_context); 51 socket_->set_context(request_context);
52 socket_->SetUserData(kSocketIdKey, new SocketStreamId(socket_id_)); 52 socket_->SetUserData(kSocketIdKey, new SocketStreamId(socket_id_));
53 socket_->Connect(); 53 socket_->Connect();
54 } 54 }
55 55
56 bool SocketStreamHost::SendData(const std::vector<char>& data) { 56 bool SocketStreamHost::SendData(const std::vector<char>& data) {
57 VLOG(1) << "SocketStreamHost::SendData"; 57 VLOG(1) << "SocketStreamHost::SendData";
58 return socket_ && socket_->SendData(&data[0], data.size()); 58 return socket_ && socket_->SendData(&data[0], data.size());
59 } 59 }
60 60
61 void SocketStreamHost::Close() { 61 void SocketStreamHost::Close() {
62 VLOG(1) << "SocketStreamHost::Close"; 62 VLOG(1) << "SocketStreamHost::Close";
63 if (!socket_) 63 if (!socket_)
64 return; 64 return;
65 socket_->Close(); 65 socket_->Close();
66 } 66 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698