Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Side by Side Diff: content/browser/devtools/devtools_http_handler_impl.cc

Issue 11958010: DevTools: brush up remote debugging browser target: use callbacks, make handlers implementation a m… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments addressed (left error handling order in place) Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/devtools/devtools_browser_target.cc ('k') | content/browser/devtools/devtools_tracing_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698