OLD | NEW |
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/host_address_request.h" | 5 #include "content/renderer/p2p/host_address_request.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
11 #include "base/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
12 #include "content/common/p2p_messages.h" | 12 #include "content/common/p2p_messages.h" |
13 #include "content/renderer/p2p/socket_dispatcher.h" | 13 #include "content/renderer/p2p/socket_dispatcher.h" |
14 #include "jingle/glue/utils.h" | 14 #include "jingle/glue/utils.h" |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 P2PAsyncAddressResolver::P2PAsyncAddressResolver( | 18 P2PAsyncAddressResolver::P2PAsyncAddressResolver( |
19 P2PSocketDispatcher* dispatcher) | 19 P2PSocketDispatcher* dispatcher) |
20 : dispatcher_(dispatcher), | 20 : dispatcher_(dispatcher), |
21 ipc_task_runner_(dispatcher->task_runner()), | 21 ipc_task_runner_(dispatcher->task_runner()), |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 void P2PAsyncAddressResolver::DeliverResponse( | 88 void P2PAsyncAddressResolver::DeliverResponse( |
89 const net::IPAddressList& addresses) { | 89 const net::IPAddressList& addresses) { |
90 DCHECK(delegate_task_runner_->BelongsToCurrentThread()); | 90 DCHECK(delegate_task_runner_->BelongsToCurrentThread()); |
91 if (state_ == STATE_SENT) { | 91 if (state_ == STATE_SENT) { |
92 state_ = STATE_FINISHED; | 92 state_ = STATE_FINISHED; |
93 base::ResetAndReturn(&done_callback_).Run(addresses); | 93 base::ResetAndReturn(&done_callback_).Run(addresses); |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 } // namespace content | 97 } // namespace content |
OLD | NEW |