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 "chrome/browser/devtools/browser_list_tabcontents_provider.h" | 5 #include "chrome/browser/devtools/browser_list_tabcontents_provider.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 if (!extension_host || extension_host->host_contents() != web_contents) | 133 if (!extension_host || extension_host->host_contents() != web_contents) |
134 return std::string(); | 134 return std::string(); |
135 | 135 |
136 return extension_host->extension()->name(); | 136 return extension_host->extension()->name(); |
137 } | 137 } |
138 | 138 |
139 #if defined(DEBUG_DEVTOOLS) | 139 #if defined(DEBUG_DEVTOOLS) |
140 static int g_last_tethering_port_ = 9333; | 140 static int g_last_tethering_port_ = 9333; |
141 | 141 |
142 scoped_refptr<net::StreamListenSocket> | 142 scoped_ptr<net::StreamListenSocket> |
143 BrowserListTabContentsProvider::CreateSocketForTethering( | 143 BrowserListTabContentsProvider::CreateSocketForTethering( |
144 net::StreamListenSocket::Delegate* delegate, | 144 net::StreamListenSocket::Delegate* delegate, |
145 std::string* name) { | 145 std::string* name) { |
146 if (g_last_tethering_port_ == 9444) | 146 if (g_last_tethering_port_ == 9444) |
147 g_last_tethering_port_ = 9333; | 147 g_last_tethering_port_ = 9333; |
148 int port = ++g_last_tethering_port_; | 148 int port = ++g_last_tethering_port_; |
149 *name = base::IntToString(port); | 149 *name = base::IntToString(port); |
150 return net::TCPListenSocket::CreateAndListen("127.0.0.1", port, delegate); | 150 return net::TCPListenSocket::CreateAndListen("127.0.0.1", port, delegate) |
| 151 .PassAs<StreamListenSocket>(); |
151 } | 152 } |
152 #else | 153 #else |
153 scoped_refptr<net::StreamListenSocket> | 154 scoped_ptr<net::StreamListenSocket> |
154 BrowserListTabContentsProvider::CreateSocketForTethering( | 155 BrowserListTabContentsProvider::CreateSocketForTethering( |
155 net::StreamListenSocket::Delegate* delegate, | 156 net::StreamListenSocket::Delegate* delegate, |
156 std::string* name) { | 157 std::string* name) { |
157 return NULL; | 158 return scoped_ptr<net::StreamListenSocket>(); |
158 } | 159 } |
159 #endif // defined(DEBUG_DEVTOOLS) | 160 #endif // defined(DEBUG_DEVTOOLS) |
OLD | NEW |