| 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/history/top_sites.h" | 9 #include "chrome/browser/history/top_sites.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 BrowserListTabContentsProvider::CreateSocketForTethering( | 78 BrowserListTabContentsProvider::CreateSocketForTethering( |
| 79 net::StreamListenSocket::Delegate* delegate, | 79 net::StreamListenSocket::Delegate* delegate, |
| 80 std::string* name) { | 80 std::string* name) { |
| 81 if (!g_tethering_enabled.Get()) | 81 if (!g_tethering_enabled.Get()) |
| 82 return scoped_ptr<net::StreamListenSocket>(); | 82 return scoped_ptr<net::StreamListenSocket>(); |
| 83 | 83 |
| 84 if (last_tethering_port_ == kMaxTetheringPort) | 84 if (last_tethering_port_ == kMaxTetheringPort) |
| 85 last_tethering_port_ = kMinTetheringPort; | 85 last_tethering_port_ = kMinTetheringPort; |
| 86 int port = ++last_tethering_port_; | 86 int port = ++last_tethering_port_; |
| 87 *name = base::IntToString(port); | 87 *name = base::IntToString(port); |
| 88 return net::TCPListenSocket::CreateAndListen("127.0.0.1", port, delegate) | 88 return net::TCPListenSocket::CreateAndListen("127.0.0.1", port, delegate); |
| 89 .PassAs<net::StreamListenSocket>(); | |
| 90 } | 89 } |
| OLD | NEW |