| 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 "chromecast/browser/devtools/remote_debugging_server.h" | 5 #include "chromecast/browser/devtools/remote_debugging_server.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 new TCPServerSocketFactory("0.0.0.0", port, 1)); | 86 new TCPServerSocketFactory("0.0.0.0", port, 1)); |
| 87 #endif | 87 #endif |
| 88 } | 88 } |
| 89 | 89 |
| 90 std::string GetFrontendUrl() { | 90 std::string GetFrontendUrl() { |
| 91 return base::StringPrintf(kFrontEndURL, content::GetWebKitRevision().c_str()); | 91 return base::StringPrintf(kFrontEndURL, content::GetWebKitRevision().c_str()); |
| 92 } | 92 } |
| 93 | 93 |
| 94 } // namespace | 94 } // namespace |
| 95 | 95 |
| 96 RemoteDebuggingServer::RemoteDebuggingServer() | 96 RemoteDebuggingServer::RemoteDebuggingServer() : port_(0) { |
| 97 : devtools_http_handler_(NULL), | |
| 98 port_(0) { | |
| 99 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 97 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 100 pref_port_.Init(prefs::kRemoteDebuggingPort, | 98 pref_port_.Init(prefs::kRemoteDebuggingPort, |
| 101 ChromecastConfig::GetInstance()->pref_service(), | 99 ChromecastConfig::GetInstance()->pref_service(), |
| 102 base::Bind(&RemoteDebuggingServer::OnPortChanged, | 100 base::Bind(&RemoteDebuggingServer::OnPortChanged, |
| 103 base::Unretained(this))); | 101 base::Unretained(this))); |
| 104 | 102 |
| 105 // Starts new dev tools, clearing port number saved in config. | 103 // Starts new dev tools, clearing port number saved in config. |
| 106 // Remote debugging in production must be triggered only by config server. | 104 // Remote debugging in production must be triggered only by config server. |
| 107 pref_port_.SetValue(ShouldStartImmediately() ? | 105 pref_port_.SetValue(ShouldStartImmediately() ? |
| 108 kDefaultRemoteDebuggingPort : 0); | 106 kDefaultRemoteDebuggingPort : 0); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 138 CreateSocketFactory(port_), | 136 CreateSocketFactory(port_), |
| 139 GetFrontendUrl(), | 137 GetFrontendUrl(), |
| 140 new CastDevToolsDelegate(), | 138 new CastDevToolsDelegate(), |
| 141 base::FilePath())); | 139 base::FilePath())); |
| 142 LOG(INFO) << "Devtools started: port=" << port_; | 140 LOG(INFO) << "Devtools started: port=" << port_; |
| 143 } | 141 } |
| 144 } | 142 } |
| 145 | 143 |
| 146 } // namespace shell | 144 } // namespace shell |
| 147 } // namespace chromecast | 145 } // namespace chromecast |
| OLD | NEW |