| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 std::unique_ptr<net::ServerSocket> | 337 std::unique_ptr<net::ServerSocket> |
| 338 DevToolsHttpHandler::ServerSocketFactory::CreateForTethering( | 338 DevToolsHttpHandler::ServerSocketFactory::CreateForTethering( |
| 339 std::string* name) { | 339 std::string* name) { |
| 340 return nullptr; | 340 return nullptr; |
| 341 } | 341 } |
| 342 | 342 |
| 343 // DevToolsHttpHandler ------------------------------------------------------- | 343 // DevToolsHttpHandler ------------------------------------------------------- |
| 344 | 344 |
| 345 DevToolsHttpHandler::~DevToolsHttpHandler() { | 345 DevToolsHttpHandler::~DevToolsHttpHandler() { |
| 346 TerminateOnUI(thread_, server_wrapper_, socket_factory_); | 346 TerminateOnUI(thread_, server_wrapper_, socket_factory_); |
| 347 STLDeleteValues(&descriptor_map_); | 347 base::STLDeleteValues(&descriptor_map_); |
| 348 STLDeleteValues(&connection_to_client_); | 348 base::STLDeleteValues(&connection_to_client_); |
| 349 } | 349 } |
| 350 | 350 |
| 351 GURL DevToolsHttpHandler::GetFrontendURL(const std::string& path) { | 351 GURL DevToolsHttpHandler::GetFrontendURL(const std::string& path) { |
| 352 if (!server_ip_address_) | 352 if (!server_ip_address_) |
| 353 return GURL(); | 353 return GURL(); |
| 354 return GURL(std::string("http://") + server_ip_address_->ToString() + | 354 return GURL(std::string("http://") + server_ip_address_->ToString() + |
| 355 (path.empty() ? frontend_url_ : path)); | 355 (path.empty() ? frontend_url_ : path)); |
| 356 } | 356 } |
| 357 | 357 |
| 358 static std::string PathWithoutParams(const std::string& path) { | 358 static std::string PathWithoutParams(const std::string& path) { |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 SendJson(connection_id, net::HTTP_OK, &version, std::string()); | 575 SendJson(connection_id, net::HTTP_OK, &version, std::string()); |
| 576 return; | 576 return; |
| 577 } | 577 } |
| 578 | 578 |
| 579 if (command == "list") { | 579 if (command == "list") { |
| 580 std::string host = info.headers["host"]; | 580 std::string host = info.headers["host"]; |
| 581 DevToolsTargetDescriptor::List descriptors = | 581 DevToolsTargetDescriptor::List descriptors = |
| 582 devtools_discovery::DevToolsDiscoveryManager::GetInstance()-> | 582 devtools_discovery::DevToolsDiscoveryManager::GetInstance()-> |
| 583 GetDescriptors(); | 583 GetDescriptors(); |
| 584 std::sort(descriptors.begin(), descriptors.end(), TimeComparator); | 584 std::sort(descriptors.begin(), descriptors.end(), TimeComparator); |
| 585 STLDeleteValues(&descriptor_map_); | 585 base::STLDeleteValues(&descriptor_map_); |
| 586 base::ListValue list_value; | 586 base::ListValue list_value; |
| 587 for (DevToolsTargetDescriptor* descriptor : descriptors) { | 587 for (DevToolsTargetDescriptor* descriptor : descriptors) { |
| 588 descriptor_map_[descriptor->GetId()] = descriptor; | 588 descriptor_map_[descriptor->GetId()] = descriptor; |
| 589 list_value.Append(SerializeDescriptor(*descriptor, host)); | 589 list_value.Append(SerializeDescriptor(*descriptor, host)); |
| 590 } | 590 } |
| 591 SendJson(connection_id, net::HTTP_OK, &list_value, std::string()); | 591 SendJson(connection_id, net::HTTP_OK, &list_value, std::string()); |
| 592 return; | 592 return; |
| 593 } | 593 } |
| 594 | 594 |
| 595 if (command == "new") { | 595 if (command == "new") { |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 id.c_str(), | 932 id.c_str(), |
| 933 host); | 933 host); |
| 934 dictionary->SetString( | 934 dictionary->SetString( |
| 935 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); | 935 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); |
| 936 } | 936 } |
| 937 | 937 |
| 938 return dictionary; | 938 return dictionary; |
| 939 } | 939 } |
| 940 | 940 |
| 941 } // namespace devtools_http_handler | 941 } // namespace devtools_http_handler |
| OLD | NEW |