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

Unified Diff: net/websockets/websocket_stream.cc

Issue 2842263003: Switch SupportsUserData uses to use unique_ptr. (Closed)
Patch Set: clean Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_stream.cc
diff --git a/net/websockets/websocket_stream.cc b/net/websockets/websocket_stream.cc
index b700519a3c3b898734c7c94b617c3908f1594e37..a03606e276bd311a72df44493744b1657de3e719 100644
--- a/net/websockets/websocket_stream.cc
+++ b/net/websockets/websocket_stream.cc
@@ -93,9 +93,8 @@ class WebSocketStreamRequestImpl : public WebSocketStreamRequest {
url_request_(
context->CreateRequest(url, DEFAULT_PRIORITY, delegate_.get())),
connect_delegate_(std::move(connect_delegate)),
- handshake_stream_create_helper_(create_helper.release()),
handshake_stream_(nullptr) {
- handshake_stream_create_helper_->set_stream_request(this);
+ create_helper->set_stream_request(this);
HttpRequestHeaders headers;
headers.SetHeader(websockets::kUpgrade, websockets::kWebSocketLowercase);
headers.SetHeader(HttpRequestHeaders::kConnection, websockets::kUpgrade);
@@ -109,11 +108,9 @@ class WebSocketStreamRequestImpl : public WebSocketStreamRequest {
url_request_->set_initiator(origin);
url_request_->set_first_party_for_cookies(first_party_for_cookies);
- // This passes the ownership of |handshake_stream_create_helper_| to
- // |url_request_|.
url_request_->SetUserData(
WebSocketHandshakeStreamBase::CreateHelper::DataKey(),
- handshake_stream_create_helper_);
+ std::move(create_helper));
url_request_->SetLoadFlags(LOAD_DISABLE_CACHE | LOAD_BYPASS_CACHE);
connect_delegate_->OnCreateRequest(url_request_.get());
}
@@ -222,9 +219,6 @@ class WebSocketStreamRequestImpl : public WebSocketStreamRequest {
std::unique_ptr<WebSocketStream::ConnectDelegate> connect_delegate_;
- // Owned by the URLRequest.
- WebSocketHandshakeStreamCreateHelper* handshake_stream_create_helper_;
-
// This is owned by the caller of CreateBaseStream() or
// CreateSpdyStream() of WebsocketHandshakeStreamCreateHelper. Both the
// stream and this object will be destroyed during the destruction of the
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698