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

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

Issue 10823224: Update JingleThreadWrapper to allow it to be created using task runner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/media/media_stream_impl.cc ('k') | jingle/glue/pseudotcp_adapter_unittest.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/p2p_transport_impl.h" 5 #include "content/renderer/p2p/p2p_transport_impl.h"
6 6
7 #include "content/renderer/p2p/ipc_network_manager.h" 7 #include "content/renderer/p2p/ipc_network_manager.h"
8 #include "content/renderer/p2p/ipc_socket_factory.h" 8 #include "content/renderer/p2p/ipc_socket_factory.h"
9 #include "content/renderer/p2p/port_allocator.h" 9 #include "content/renderer/p2p/port_allocator.h"
10 #include "jingle/glue/channel_socket_adapter.h" 10 #include "jingle/glue/channel_socket_adapter.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 bool P2PTransportImpl::Init(WebKit::WebFrame* web_frame, 52 bool P2PTransportImpl::Init(WebKit::WebFrame* web_frame,
53 const std::string& name, 53 const std::string& name,
54 Protocol protocol, 54 Protocol protocol,
55 const Config& config, 55 const Config& config,
56 EventHandler* event_handler) { 56 EventHandler* event_handler) {
57 DCHECK(event_handler); 57 DCHECK(event_handler);
58 58
59 // Before proceeding, ensure we have libjingle thread wrapper for 59 // Before proceeding, ensure we have libjingle thread wrapper for
60 // the current thread. 60 // the current thread.
61 jingle_glue::JingleThreadWrapper::EnsureForCurrentThread(); 61 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();
62 62
63 name_ = name; 63 name_ = name;
64 event_handler_ = event_handler; 64 event_handler_ = event_handler;
65 65
66 if (socket_dispatcher_) { 66 if (socket_dispatcher_) {
67 DCHECK(web_frame); 67 DCHECK(web_frame);
68 allocator_.reset(new P2PPortAllocator( 68 allocator_.reset(new P2PPortAllocator(
69 web_frame, socket_dispatcher_, network_manager_.get(), 69 web_frame, socket_dispatcher_, network_manager_.get(),
70 socket_factory_.get(), config)); 70 socket_factory_.get(), config));
71 } else { 71 } else {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 void P2PTransportImpl::OnTcpConnected(int result) { 165 void P2PTransportImpl::OnTcpConnected(int result) {
166 if (result < 0) { 166 if (result < 0) {
167 event_handler_->OnError(result); 167 event_handler_->OnError(result);
168 return; 168 return;
169 } 169 }
170 state_ = static_cast<State>(STATE_READABLE | STATE_WRITABLE); 170 state_ = static_cast<State>(STATE_READABLE | STATE_WRITABLE);
171 event_handler_->OnStateChange(state_); 171 event_handler_->OnStateChange(state_);
172 } 172 }
173 173
174 } // namespace content 174 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_impl.cc ('k') | jingle/glue/pseudotcp_adapter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698