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

Side by Side Diff: content/browser/devtools/protocol/page_handler.cc

Issue 2863623003: [DevTools] Support multiple sessions in content/ domain handlers (Closed)
Patch Set: addressed review comments Created 3 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/protocol/page_handler.h" 5 #include "content/browser/devtools/protocol/page_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 frames_in_flight_(0), 102 frames_in_flight_(0),
103 navigation_throttle_enabled_(false), 103 navigation_throttle_enabled_(false),
104 next_navigation_id_(0), 104 next_navigation_id_(0),
105 host_(nullptr), 105 host_(nullptr),
106 weak_factory_(this) {} 106 weak_factory_(this) {}
107 107
108 PageHandler::~PageHandler() { 108 PageHandler::~PageHandler() {
109 } 109 }
110 110
111 // static 111 // static
112 PageHandler* PageHandler::FromSession(DevToolsSession* session) { 112 std::vector<PageHandler*> PageHandler::ForAgentHost(
113 return static_cast<PageHandler*>( 113 DevToolsAgentHostImpl* host) {
114 session->GetHandlerByName(Page::Metainfo::domainName)); 114 return DevToolsSession::HandlersForAgentHost<PageHandler>(
115 host, Page::Metainfo::domainName);
115 } 116 }
116 117
117 void PageHandler::SetRenderFrameHost(RenderFrameHostImpl* host) { 118 void PageHandler::SetRenderFrameHost(RenderFrameHostImpl* host) {
118 if (host_ == host) 119 if (host_ == host)
119 return; 120 return;
120 121
121 RenderWidgetHostImpl* widget_host = 122 RenderWidgetHostImpl* widget_host =
122 host_ ? host_->GetRenderWidgetHost() : nullptr; 123 host_ ? host_->GetRenderWidgetHost() : nullptr;
123 if (widget_host) { 124 if (widget_host) {
124 registrar_.Remove( 125 registrar_.Remove(
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 Response PageHandler::StopLoading() { 575 Response PageHandler::StopLoading() {
575 WebContentsImpl* web_contents = GetWebContents(); 576 WebContentsImpl* web_contents = GetWebContents();
576 if (!web_contents) 577 if (!web_contents)
577 return Response::InternalError(); 578 return Response::InternalError();
578 web_contents->Stop(); 579 web_contents->Stop();
579 return Response::OK(); 580 return Response::OK();
580 } 581 }
581 582
582 } // namespace protocol 583 } // namespace protocol
583 } // namespace content 584 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/page_handler.h ('k') | content/browser/devtools/protocol/security_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698