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

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

Issue 12218134: Introduce intercepting and handling devtools messages in the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 10 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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 return; 616 return;
617 std::string browser_prefix = "/devtools/browser"; 617 std::string browser_prefix = "/devtools/browser";
618 size_t browser_pos = request.path.find(browser_prefix); 618 size_t browser_pos = request.path.find(browser_prefix);
619 if (browser_pos == 0) { 619 if (browser_pos == 0) {
620 if (browser_target_) { 620 if (browser_target_) {
621 Send500(connection_id, "Another client already attached"); 621 Send500(connection_id, "Another client already attached");
622 return; 622 return;
623 } 623 }
624 browser_target_.reset(new DevToolsBrowserTarget( 624 browser_target_.reset(new DevToolsBrowserTarget(
625 thread_->message_loop_proxy().get(), server_.get(), connection_id)); 625 thread_->message_loop_proxy().get(), server_.get(), connection_id));
626 browser_target_->RegisterDomainHandler(new DevToolsTracingHandler()); 626 browser_target_->RegisterDomainHandler(
627 new DevToolsTracingHandler(browser_target_->GetNotifier()));
pfeldman 2013/02/13 17:38:24 It is unfortunate browser target can't set itself
kkania 2013/02/13 19:17:19 Done.
627 AcceptWebSocket(connection_id, request); 628 AcceptWebSocket(connection_id, request);
628 return; 629 return;
629 } 630 }
630 631
631 std::string page_prefix = "/devtools/page/"; 632 std::string page_prefix = "/devtools/page/";
632 size_t pos = request.path.find(page_prefix); 633 size_t pos = request.path.find(page_prefix);
633 if (pos != 0) { 634 if (pos != 0) {
634 Send404(connection_id); 635 Send404(connection_id);
635 return; 636 return;
636 } 637 }
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 page_info.id.c_str())); 890 page_info.id.c_str()));
890 std::string devtools_frontend_url = GetFrontendURLInternal( 891 std::string devtools_frontend_url = GetFrontendURLInternal(
891 page_info.id.c_str(), 892 page_info.id.c_str(),
892 host); 893 host);
893 dictionary->SetString("devtoolsFrontendUrl", devtools_frontend_url); 894 dictionary->SetString("devtoolsFrontendUrl", devtools_frontend_url);
894 } 895 }
895 return dictionary; 896 return dictionary;
896 } 897 }
897 898
898 } // namespace content 899 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698