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

Side by Side Diff: chrome/browser/net/websocket_experiment/websocket_experiment_task.cc

Issue 1108002: Implement new websocket handshake based on draft-hixie-thewebsocketprotocol-76 (Closed)
Patch Set: fix for review comments Created 10 years, 9 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
« no previous file with comments | « no previous file | net/net.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/net/websocket_experiment/websocket_experiment_task.h" 5 #include "chrome/browser/net/websocket_experiment/websocket_experiment_task.h"
6 6
7 #include "chrome/browser/chrome_thread.h" 7 #include "chrome/browser/chrome_thread.h"
8 #include "chrome/browser/net/url_request_context_getter.h" 8 #include "chrome/browser/net/url_request_context_getter.h"
9 #include "chrome/browser/profile.h" 9 #include "chrome/browser/profile.h"
10 #include "net/base/load_flags.h" 10 #include "net/base/load_flags.h"
(...skipping 28 matching lines...) Expand all
39 // Profile::GetDefaultRequestContext() is initialized lazily, on the UI 39 // Profile::GetDefaultRequestContext() is initialized lazily, on the UI
40 // thread. So here, where we access it from the IO thread, if the task runs 40 // thread. So here, where we access it from the IO thread, if the task runs
41 // before it has gotten lazily initialized yet. 41 // before it has gotten lazily initialized yet.
42 if (!getter) 42 if (!getter)
43 return NULL; 43 return NULL;
44 net::WebSocket::Request* request( 44 net::WebSocket::Request* request(
45 new net::WebSocket::Request(config.url, 45 new net::WebSocket::Request(config.url,
46 config.ws_protocol, 46 config.ws_protocol,
47 config.ws_origin, 47 config.ws_origin,
48 config.ws_location, 48 config.ws_location,
49 net::WebSocket::DRAFT75,
49 getter->GetURLRequestContext())); 50 getter->GetURLRequestContext()));
50 return new net::WebSocket(request, delegate); 51 return new net::WebSocket(request, delegate);
51 } 52 }
52 53
53 WebSocketExperimentTask::WebSocketExperimentTask( 54 WebSocketExperimentTask::WebSocketExperimentTask(
54 const Config& config, 55 const Config& config,
55 net::CompletionCallback* callback) 56 net::CompletionCallback* callback)
56 : config_(config), 57 : config_(config),
57 context_(ALLOW_THIS_IN_INITIALIZER_LIST(new Context())), 58 context_(ALLOW_THIS_IN_INITIALIZER_LIST(new Context())),
58 method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), 59 method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 void WebSocketExperimentTask::Finish(int result) { 402 void WebSocketExperimentTask::Finish(int result) {
402 url_fetcher_.reset(); 403 url_fetcher_.reset();
403 scoped_refptr<net::WebSocket> websocket = websocket_; 404 scoped_refptr<net::WebSocket> websocket = websocket_;
404 websocket_ = NULL; 405 websocket_ = NULL;
405 callback_->Run(result); 406 callback_->Run(result);
406 if (websocket) 407 if (websocket)
407 websocket->DetachDelegate(); 408 websocket->DetachDelegate();
408 } 409 }
409 410
410 } // namespace chrome_browser_net 411 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « no previous file | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698