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

Side by Side Diff: content/browser/websockets/websocket_manager.cc

Issue 2851173004: Eliminate bind callback that doesn't take a BindSourceInfo parameter. (Closed)
Patch Set: . Created 3 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/websockets/websocket_manager.h" 5 #include "content/browser/websockets/websocket_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 47 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
48 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, manager_); 48 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, manager_);
49 manager_ = nullptr; 49 manager_ = nullptr;
50 } 50 }
51 51
52 private: 52 private:
53 WebSocketManager* manager_; 53 WebSocketManager* manager_;
54 }; 54 };
55 55
56 // static 56 // static
57 void WebSocketManager::CreateWebSocket(int process_id, int frame_id, 57 void WebSocketManager::CreateWebSocket(
58 blink::mojom::WebSocketRequest request) { 58 int process_id,
59 int frame_id,
60 const service_manager::BindSourceInfo& source_info,
61 blink::mojom::WebSocketRequest request) {
59 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 62 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
60 63
61 RenderProcessHost* host = RenderProcessHost::FromID(process_id); 64 RenderProcessHost* host = RenderProcessHost::FromID(process_id);
62 DCHECK(host); 65 DCHECK(host);
63 66
64 // Maintain a WebSocketManager per RenderProcessHost. While the instance of 67 // Maintain a WebSocketManager per RenderProcessHost. While the instance of
65 // WebSocketManager is allocated on the UI thread, it must only be used and 68 // WebSocketManager is allocated on the UI thread, it must only be used and
66 // deleted from the IO thread. 69 // deleted from the IO thread.
67 70
68 Handle* handle = 71 Handle* handle =
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 239 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
237 if (!url_request_context_getter_->GetURLRequestContext()) { 240 if (!url_request_context_getter_->GetURLRequestContext()) {
238 context_destroyed_ = true; 241 context_destroyed_ = true;
239 url_request_context_getter_ = nullptr; 242 url_request_context_getter_ = nullptr;
240 return; 243 return;
241 } 244 }
242 url_request_context_getter_->AddObserver(this); 245 url_request_context_getter_->AddObserver(this);
243 } 246 }
244 247
245 } // namespace content 248 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/websockets/websocket_manager.h ('k') | content/browser/webui/web_ui_mojo_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698