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

Side by Side Diff: content/renderer/p2p/socket_dispatcher.cc

Issue 7583053: Add MessageLoopProxy::current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No need for MessageLoopProxy destruction observer. Created 9 years, 4 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
« no previous file with comments | « content/renderer/p2p/socket_client.cc ('k') | content/renderer/pepper_plugin_delegate_impl.cc » ('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) 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/renderer/p2p/socket_dispatcher.h" 5 #include "content/renderer/p2p/socket_dispatcher.h"
6 6
7 #include "base/message_loop_proxy.h" 7 #include "base/message_loop_proxy.h"
8 #include "content/common/p2p_messages.h" 8 #include "content/common/p2p_messages.h"
9 #include "content/renderer/p2p/host_address_request.h" 9 #include "content/renderer/p2p/host_address_request.h"
10 #include "content/renderer/p2p/socket_client.h" 10 #include "content/renderer/p2p/socket_client.h"
11 11
12 P2PSocketDispatcher::P2PSocketDispatcher(RenderView* render_view) 12 P2PSocketDispatcher::P2PSocketDispatcher(RenderView* render_view)
13 : RenderViewObserver(render_view), 13 : RenderViewObserver(render_view),
14 message_loop_(base::MessageLoopProxy::CreateForCurrentThread()), 14 message_loop_(base::MessageLoopProxy::current()),
15 network_notifications_started_(false), 15 network_notifications_started_(false),
16 network_list_observers_( 16 network_list_observers_(
17 new ObserverListThreadSafe<NetworkListObserver>()) { 17 new ObserverListThreadSafe<NetworkListObserver>()) {
18 } 18 }
19 19
20 P2PSocketDispatcher::~P2PSocketDispatcher() { 20 P2PSocketDispatcher::~P2PSocketDispatcher() {
21 if (network_notifications_started_) 21 if (network_notifications_started_)
22 Send(new P2PHostMsg_StopNetworkNotifications(routing_id())); 22 Send(new P2PHostMsg_StopNetworkNotifications(routing_id()));
23 for (IDMap<P2PSocketClient>::iterator i(&clients_); !i.IsAtEnd(); 23 for (IDMap<P2PSocketClient>::iterator i(&clients_); !i.IsAtEnd();
24 i.Advance()) { 24 i.Advance()) {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 if (client == NULL) { 135 if (client == NULL) {
136 // This may happen if the socket was closed, but the browser side 136 // This may happen if the socket was closed, but the browser side
137 // hasn't processed the close message by the time it sends the 137 // hasn't processed the close message by the time it sends the
138 // message to the renderer. 138 // message to the renderer.
139 VLOG(1) << "Received P2P message for socket that doesn't exist."; 139 VLOG(1) << "Received P2P message for socket that doesn't exist.";
140 return NULL; 140 return NULL;
141 } 141 }
142 142
143 return client; 143 return client;
144 } 144 }
OLDNEW
« no previous file with comments | « content/renderer/p2p/socket_client.cc ('k') | content/renderer/pepper_plugin_delegate_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698