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/chrome_devtools_manager_delegate.h" | 5 #include "chrome/browser/devtools/chrome_devtools_manager_delegate.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/devtools/device/android_device_manager.h" | 10 #include "chrome/browser/devtools/device/android_device_manager.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 "Remote locations are already in use by another client."); | 192 "Remote locations are already in use by another client."); |
193 } | 193 } |
194 | 194 |
195 remote_locations_requester_ = agent_host; | 195 remote_locations_requester_ = agent_host; |
196 std::set<net::HostPortPair> tcp_locations; | 196 std::set<net::HostPortPair> tcp_locations; |
197 base::ListValue* locations; | 197 base::ListValue* locations; |
198 if (!params->GetList(kLocationsParam, &locations)) | 198 if (!params->GetList(kLocationsParam, &locations)) |
199 return DevToolsProtocol::CreateInvalidParamsResponse(command_id, | 199 return DevToolsProtocol::CreateInvalidParamsResponse(command_id, |
200 kLocationsParam); | 200 kLocationsParam); |
201 for (const auto& item : *locations) { | 201 for (const auto& item : *locations) { |
202 if (!item->IsType(base::Value::TYPE_DICTIONARY)) { | 202 if (!item->IsType(base::Value::Type::DICTIONARY)) { |
203 return DevToolsProtocol::CreateInvalidParamsResponse(command_id, | 203 return DevToolsProtocol::CreateInvalidParamsResponse(command_id, |
204 kLocationsParam); | 204 kLocationsParam); |
205 } | 205 } |
206 base::DictionaryValue* dictionary = | 206 base::DictionaryValue* dictionary = |
207 static_cast<base::DictionaryValue*>(item.get()); | 207 static_cast<base::DictionaryValue*>(item.get()); |
208 std::string host; | 208 std::string host; |
209 if (!dictionary->GetStringWithoutPathExpansion(kHostParam, &host)) { | 209 if (!dictionary->GetStringWithoutPathExpansion(kHostParam, &host)) { |
210 return DevToolsProtocol::CreateInvalidParamsResponse(command_id, | 210 return DevToolsProtocol::CreateInvalidParamsResponse(command_id, |
211 kLocationsParam); | 211 kLocationsParam); |
212 } | 212 } |
(...skipping 18 matching lines...) Expand all Loading... |
231 | 231 |
232 device_discovery_.reset(new DevToolsDeviceDiscovery(device_manager_.get(), | 232 device_discovery_.reset(new DevToolsDeviceDiscovery(device_manager_.get(), |
233 base::Bind(&ChromeDevToolsManagerDelegate::DevicesAvailable, | 233 base::Bind(&ChromeDevToolsManagerDelegate::DevicesAvailable, |
234 base::Unretained(this)))); | 234 base::Unretained(this)))); |
235 } | 235 } |
236 | 236 |
237 std::unique_ptr<base::DictionaryValue> result( | 237 std::unique_ptr<base::DictionaryValue> result( |
238 base::MakeUnique<base::DictionaryValue>()); | 238 base::MakeUnique<base::DictionaryValue>()); |
239 return DevToolsProtocol::CreateSuccessResponse(command_id, std::move(result)); | 239 return DevToolsProtocol::CreateSuccessResponse(command_id, std::move(result)); |
240 } | 240 } |
OLD | NEW |