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 "content/browser/devtools/devtools_http_handler_impl.h" | 5 #include "content/browser/devtools/devtools_http_handler_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 return; | 607 return; |
608 std::string browser_prefix = "/devtools/browser"; | 608 std::string browser_prefix = "/devtools/browser"; |
609 size_t browser_pos = request.path.find(browser_prefix); | 609 size_t browser_pos = request.path.find(browser_prefix); |
610 if (browser_pos == 0) { | 610 if (browser_pos == 0) { |
611 if (browser_target_) { | 611 if (browser_target_) { |
612 Send500(connection_id, "Another client already attached"); | 612 Send500(connection_id, "Another client already attached"); |
613 return; | 613 return; |
614 } | 614 } |
615 browser_target_.reset(new DevToolsBrowserTarget( | 615 browser_target_.reset(new DevToolsBrowserTarget( |
616 thread_->message_loop_proxy().get(), server_.get(), connection_id)); | 616 thread_->message_loop_proxy().get(), server_.get(), connection_id)); |
617 browser_target_->RegisterHandler(new DevToolsTracingHandler()); | 617 browser_target_->RegisterDomainHandler(new DevToolsTracingHandler()); |
618 AcceptWebSocket(connection_id, request); | 618 AcceptWebSocket(connection_id, request); |
619 return; | 619 return; |
620 } | 620 } |
621 | 621 |
622 std::string page_prefix = "/devtools/page/"; | 622 std::string page_prefix = "/devtools/page/"; |
623 size_t pos = request.path.find(page_prefix); | 623 size_t pos = request.path.find(page_prefix); |
624 if (pos != 0) { | 624 if (pos != 0) { |
625 Send404(connection_id); | 625 Send404(connection_id); |
626 return; | 626 return; |
627 } | 627 } |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 page_info.id.c_str())); | 869 page_info.id.c_str())); |
870 std::string devtools_frontend_url = GetFrontendURLInternal( | 870 std::string devtools_frontend_url = GetFrontendURLInternal( |
871 page_info.id.c_str(), | 871 page_info.id.c_str(), |
872 host); | 872 host); |
873 dictionary->SetString("devtoolsFrontendUrl", devtools_frontend_url); | 873 dictionary->SetString("devtoolsFrontendUrl", devtools_frontend_url); |
874 } | 874 } |
875 return dictionary; | 875 return dictionary; |
876 } | 876 } |
877 | 877 |
878 } // namespace content | 878 } // namespace content |
OLD | NEW |