OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/devtools/device/webrtc/webrtc_device_provider.h" | 5 #include "chrome/browser/devtools/device/webrtc/webrtc_device_provider.h" |
6 | 6 |
| 7 #include "base/location.h" |
| 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/thread_task_runner_handle.h" |
7 #include "chrome/browser/devtools/device/webrtc/devtools_bridge_client.h" | 10 #include "chrome/browser/devtools/device/webrtc/devtools_bridge_client.h" |
8 #include "chrome/common/url_constants.h" | 11 #include "chrome/common/url_constants.h" |
9 #include "content/public/browser/web_ui.h" | 12 #include "content/public/browser/web_ui.h" |
10 #include "content/public/browser/web_ui_data_source.h" | 13 #include "content/public/browser/web_ui_data_source.h" |
11 #include "grit/webrtc_device_provider_resources_map.h" | 14 #include "grit/webrtc_device_provider_resources_map.h" |
12 #include "net/base/net_errors.h" | 15 #include "net/base/net_errors.h" |
13 #include "net/socket/stream_socket.h" | 16 #include "net/socket/stream_socket.h" |
14 | 17 |
15 using content::BrowserThread; | 18 using content::BrowserThread; |
16 using content::WebUIDataSource; | 19 using content::WebUIDataSource; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 void WebRTCDeviceProvider::OpenSocket(const std::string& serial, | 80 void WebRTCDeviceProvider::OpenSocket(const std::string& serial, |
78 const std::string& socket_name, | 81 const std::string& socket_name, |
79 const SocketCallback& callback) { | 82 const SocketCallback& callback) { |
80 BrowserThread::PostTask( | 83 BrowserThread::PostTask( |
81 BrowserThread::UI, | 84 BrowserThread::UI, |
82 FROM_HERE, | 85 FROM_HERE, |
83 base::Bind(&DevToolsBridgeClient::StartSessionIfNeeded, | 86 base::Bind(&DevToolsBridgeClient::StartSessionIfNeeded, |
84 client_, socket_name)); | 87 client_, socket_name)); |
85 // TODO(serya): Implement | 88 // TODO(serya): Implement |
86 scoped_ptr<net::StreamSocket> socket; | 89 scoped_ptr<net::StreamSocket> socket; |
87 base::MessageLoop::current()->PostTask( | 90 base::ThreadTaskRunnerHandle::Get()->PostTask( |
88 FROM_HERE, base::Bind(callback, net::ERR_FAILED, base::Passed(&socket))); | 91 FROM_HERE, base::Bind(callback, net::ERR_FAILED, base::Passed(&socket))); |
89 } | 92 } |
OLD | NEW |