| 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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 return; | 517 return; |
| 518 } | 518 } |
| 519 | 519 |
| 520 if (command == "version") { | 520 if (command == "version") { |
| 521 base::DictionaryValue version; | 521 base::DictionaryValue version; |
| 522 version.SetString("Protocol-Version", | 522 version.SetString("Protocol-Version", |
| 523 DevToolsAgentHost::GetProtocolVersion().c_str()); | 523 DevToolsAgentHost::GetProtocolVersion().c_str()); |
| 524 version.SetString("WebKit-Version", GetWebKitVersion()); | 524 version.SetString("WebKit-Version", GetWebKitVersion()); |
| 525 version.SetString("Browser", product_name_); | 525 version.SetString("Browser", product_name_); |
| 526 version.SetString("User-Agent", user_agent_); | 526 version.SetString("User-Agent", user_agent_); |
| 527 version.SetString("V8-Version", v8_version_); |
| 527 #if defined(OS_ANDROID) | 528 #if defined(OS_ANDROID) |
| 528 version.SetString("Android-Package", | 529 version.SetString("Android-Package", |
| 529 base::android::BuildInfo::GetInstance()->package_name()); | 530 base::android::BuildInfo::GetInstance()->package_name()); |
| 530 #endif | 531 #endif |
| 531 SendJson(connection_id, net::HTTP_OK, &version, std::string()); | 532 SendJson(connection_id, net::HTTP_OK, &version, std::string()); |
| 532 return; | 533 return; |
| 533 } | 534 } |
| 534 | 535 |
| 535 if (command == "list") { | 536 if (command == "list") { |
| 536 DevToolsAgentHost::DiscoverAllHosts( | 537 DevToolsAgentHost::DiscoverAllHosts( |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 connection_to_client_.erase(connection_id); | 698 connection_to_client_.erase(connection_id); |
| 698 } | 699 } |
| 699 | 700 |
| 700 DevToolsHttpHandler::DevToolsHttpHandler( | 701 DevToolsHttpHandler::DevToolsHttpHandler( |
| 701 DevToolsManagerDelegate* delegate, | 702 DevToolsManagerDelegate* delegate, |
| 702 std::unique_ptr<DevToolsSocketFactory> socket_factory, | 703 std::unique_ptr<DevToolsSocketFactory> socket_factory, |
| 703 const std::string& frontend_url, | 704 const std::string& frontend_url, |
| 704 const base::FilePath& output_directory, | 705 const base::FilePath& output_directory, |
| 705 const base::FilePath& debug_frontend_dir, | 706 const base::FilePath& debug_frontend_dir, |
| 706 const std::string& product_name, | 707 const std::string& product_name, |
| 707 const std::string& user_agent) | 708 const std::string& user_agent, |
| 709 const std::string& v8_version) |
| 708 : thread_(nullptr), | 710 : thread_(nullptr), |
| 709 frontend_url_(frontend_url), | 711 frontend_url_(frontend_url), |
| 710 product_name_(product_name), | 712 product_name_(product_name), |
| 711 user_agent_(user_agent), | 713 user_agent_(user_agent), |
| 714 v8_version_(v8_version), |
| 712 server_wrapper_(nullptr), | 715 server_wrapper_(nullptr), |
| 713 delegate_(delegate), | 716 delegate_(delegate), |
| 714 socket_factory_(nullptr), | 717 socket_factory_(nullptr), |
| 715 weak_factory_(this) { | 718 weak_factory_(this) { |
| 716 bool bundles_resources = frontend_url_.empty(); | 719 bool bundles_resources = frontend_url_.empty(); |
| 717 if (frontend_url_.empty()) | 720 if (frontend_url_.empty()) |
| 718 frontend_url_ = "/devtools/inspector.html"; | 721 frontend_url_ = "/devtools/inspector.html"; |
| 719 | 722 |
| 720 BrowserThread::PostTask( | 723 BrowserThread::PostTask( |
| 721 BrowserThread::FILE, FROM_HERE, | 724 BrowserThread::FILE, FROM_HERE, |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 id.c_str(), | 857 id.c_str(), |
| 855 host); | 858 host); |
| 856 dictionary->SetString( | 859 dictionary->SetString( |
| 857 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); | 860 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); |
| 858 } | 861 } |
| 859 | 862 |
| 860 return dictionary; | 863 return dictionary; |
| 861 } | 864 } |
| 862 | 865 |
| 863 } // namespace content | 866 } // namespace content |
| OLD | NEW |