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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 #endif | 103 #endif |
104 } | 104 } |
105 | 105 |
106 std::string GetFrontendUrl() { | 106 std::string GetFrontendUrl() { |
107 return base::StringPrintf(kFrontEndURL, content::GetWebKitRevision().c_str()); | 107 return base::StringPrintf(kFrontEndURL, content::GetWebKitRevision().c_str()); |
108 } | 108 } |
109 | 109 |
110 } // namespace | 110 } // namespace |
111 | 111 |
112 RemoteDebuggingServer::RemoteDebuggingServer() : port_(0) { | 112 RemoteDebuggingServer::RemoteDebuggingServer() : port_(0) { |
113 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 113 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
114 pref_port_.Init(prefs::kRemoteDebuggingPort, | 114 pref_port_.Init(prefs::kRemoteDebuggingPort, |
115 CastBrowserProcess::GetInstance()->pref_service(), | 115 CastBrowserProcess::GetInstance()->pref_service(), |
116 base::Bind(&RemoteDebuggingServer::OnPortChanged, | 116 base::Bind(&RemoteDebuggingServer::OnPortChanged, |
117 base::Unretained(this))); | 117 base::Unretained(this))); |
118 | 118 |
119 // Starts new dev tools, clearing port number saved in config. | 119 // Starts new dev tools, clearing port number saved in config. |
120 // Remote debugging in production must be triggered only by config server. | 120 // Remote debugging in production must be triggered only by config server. |
121 pref_port_.SetValue(ShouldStartImmediately() ? | 121 pref_port_.SetValue(ShouldStartImmediately() ? |
122 kDefaultRemoteDebuggingPort : 0); | 122 kDefaultRemoteDebuggingPort : 0); |
123 OnPortChanged(); | 123 OnPortChanged(); |
(...skipping 25 matching lines...) Expand all Loading... |
149 CreateSocketFactory(port_), | 149 CreateSocketFactory(port_), |
150 GetFrontendUrl(), | 150 GetFrontendUrl(), |
151 new CastDevToolsDelegate(), | 151 new CastDevToolsDelegate(), |
152 base::FilePath())); | 152 base::FilePath())); |
153 LOG(INFO) << "Devtools started: port=" << port_; | 153 LOG(INFO) << "Devtools started: port=" << port_; |
154 } | 154 } |
155 } | 155 } |
156 | 156 |
157 } // namespace shell | 157 } // namespace shell |
158 } // namespace chromecast | 158 } // namespace chromecast |
OLD | NEW |