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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 for (DevToolsTargetDescriptor* descriptor : descriptors) { | 585 for (DevToolsTargetDescriptor* descriptor : descriptors) { |
586 descriptor_map_[descriptor->GetId()] = descriptor; | 586 descriptor_map_[descriptor->GetId()] = descriptor; |
587 list_value.Append(SerializeDescriptor(*descriptor, host)); | 587 list_value.Append(SerializeDescriptor(*descriptor, host)); |
588 } | 588 } |
589 SendJson(connection_id, net::HTTP_OK, &list_value, std::string()); | 589 SendJson(connection_id, net::HTTP_OK, &list_value, std::string()); |
590 return; | 590 return; |
591 } | 591 } |
592 | 592 |
593 if (command == "new") { | 593 if (command == "new") { |
594 GURL url(net::UnescapeURLComponent( | 594 GURL url(net::UnescapeURLComponent( |
595 query, net::UnescapeRule::URL_SPECIAL_CHARS)); | 595 query, |
| 596 net::UnescapeRule::PATH_SEPARATORS | |
| 597 net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS)); |
596 if (!url.is_valid()) | 598 if (!url.is_valid()) |
597 url = GURL(url::kAboutBlankURL); | 599 url = GURL(url::kAboutBlankURL); |
598 scoped_ptr<DevToolsTargetDescriptor> descriptor = | 600 scoped_ptr<DevToolsTargetDescriptor> descriptor = |
599 devtools_discovery::DevToolsDiscoveryManager::GetInstance()-> | 601 devtools_discovery::DevToolsDiscoveryManager::GetInstance()-> |
600 CreateNew(url); | 602 CreateNew(url); |
601 if (!descriptor) { | 603 if (!descriptor) { |
602 SendJson(connection_id, | 604 SendJson(connection_id, |
603 net::HTTP_INTERNAL_SERVER_ERROR, | 605 net::HTTP_INTERNAL_SERVER_ERROR, |
604 NULL, | 606 NULL, |
605 "Could not create new page"); | 607 "Could not create new page"); |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 id.c_str(), | 931 id.c_str(), |
930 host); | 932 host); |
931 dictionary->SetString( | 933 dictionary->SetString( |
932 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); | 934 kTargetDevtoolsFrontendUrlField, devtools_frontend_url); |
933 } | 935 } |
934 | 936 |
935 return dictionary; | 937 return dictionary; |
936 } | 938 } |
937 | 939 |
938 } // namespace devtools_http_handler | 940 } // namespace devtools_http_handler |
OLD | NEW |