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

Side by Side Diff: third_party/WebKit/Source/web/InspectorOverlay.cpp

Issue 1967933002: [DevTools] Dispatch messages to V8InspectorSession directly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@1936593002
Patch Set: rebased Created 4 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 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 21 matching lines...) Expand all
32 #include "bindings/core/v8/ScriptSourceCode.h" 32 #include "bindings/core/v8/ScriptSourceCode.h"
33 #include "bindings/core/v8/V8InspectorOverlayHost.h" 33 #include "bindings/core/v8/V8InspectorOverlayHost.h"
34 #include "core/dom/Node.h" 34 #include "core/dom/Node.h"
35 #include "core/dom/StaticNodeList.h" 35 #include "core/dom/StaticNodeList.h"
36 #include "core/frame/FrameHost.h" 36 #include "core/frame/FrameHost.h"
37 #include "core/frame/FrameView.h" 37 #include "core/frame/FrameView.h"
38 #include "core/frame/LocalFrame.h" 38 #include "core/frame/LocalFrame.h"
39 #include "core/frame/Settings.h" 39 #include "core/frame/Settings.h"
40 #include "core/input/EventHandler.h" 40 #include "core/input/EventHandler.h"
41 #include "core/inspector/InspectorCSSAgent.h" 41 #include "core/inspector/InspectorCSSAgent.h"
42 #include "core/inspector/InspectorDebuggerAgent.h"
43 #include "core/inspector/InspectorOverlayHost.h" 42 #include "core/inspector/InspectorOverlayHost.h"
44 #include "core/inspector/LayoutEditor.h" 43 #include "core/inspector/LayoutEditor.h"
45 #include "core/layout/api/LayoutViewItem.h" 44 #include "core/layout/api/LayoutViewItem.h"
46 #include "core/loader/EmptyClients.h" 45 #include "core/loader/EmptyClients.h"
47 #include "core/loader/FrameLoadRequest.h" 46 #include "core/loader/FrameLoadRequest.h"
48 #include "core/page/ChromeClient.h" 47 #include "core/page/ChromeClient.h"
49 #include "core/page/Page.h" 48 #include "core/page/Page.h"
50 #include "platform/ScriptForbiddenScope.h" 49 #include "platform/ScriptForbiddenScope.h"
51 #include "platform/graphics/GraphicsContext.h" 50 #include "platform/graphics/GraphicsContext.h"
52 #include "platform/graphics/paint/CullRect.h" 51 #include "platform/graphics/paint/CullRect.h"
53 #include "platform/inspector_protocol/Values.h" 52 #include "platform/inspector_protocol/Values.h"
53 #include "platform/v8_inspector/public/V8InspectorSession.h"
54 #include "public/platform/Platform.h" 54 #include "public/platform/Platform.h"
55 #include "public/platform/WebData.h" 55 #include "public/platform/WebData.h"
56 #include "web/PageOverlay.h" 56 #include "web/PageOverlay.h"
57 #include "web/WebInputEventConversion.h" 57 #include "web/WebInputEventConversion.h"
58 #include "web/WebLocalFrameImpl.h" 58 #include "web/WebLocalFrameImpl.h"
59 #include "web/WebViewImpl.h" 59 #include "web/WebViewImpl.h"
60 #include <v8.h> 60 #include <v8.h>
61 61
62 namespace blink { 62 namespace blink {
63 63
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 DCHECK(!m_overlayPage); 193 DCHECK(!m_overlayPage);
194 } 194 }
195 195
196 DEFINE_TRACE(InspectorOverlay) 196 DEFINE_TRACE(InspectorOverlay)
197 { 197 {
198 visitor->trace(m_highlightNode); 198 visitor->trace(m_highlightNode);
199 visitor->trace(m_eventTargetNode); 199 visitor->trace(m_eventTargetNode);
200 visitor->trace(m_overlayPage); 200 visitor->trace(m_overlayPage);
201 visitor->trace(m_overlayChromeClient); 201 visitor->trace(m_overlayChromeClient);
202 visitor->trace(m_overlayHost); 202 visitor->trace(m_overlayHost);
203 visitor->trace(m_debuggerAgent);
204 visitor->trace(m_domAgent); 203 visitor->trace(m_domAgent);
205 visitor->trace(m_cssAgent); 204 visitor->trace(m_cssAgent);
206 visitor->trace(m_layoutEditor); 205 visitor->trace(m_layoutEditor);
207 visitor->trace(m_hoveredNodeForInspectMode); 206 visitor->trace(m_hoveredNodeForInspectMode);
208 } 207 }
209 208
210 void InspectorOverlay::init(InspectorCSSAgent* cssAgent, InspectorDebuggerAgent* debuggerAgent, InspectorDOMAgent* domAgent) 209 void InspectorOverlay::init(InspectorCSSAgent* cssAgent, V8InspectorSession* v8S ession, InspectorDOMAgent* domAgent)
211 { 210 {
212 m_debuggerAgent = debuggerAgent; 211 m_v8Session = v8Session;
213 m_domAgent = domAgent; 212 m_domAgent = domAgent;
214 m_cssAgent = cssAgent; 213 m_cssAgent = cssAgent;
215 m_overlayHost->setListener(this); 214 m_overlayHost->setListener(this);
216 } 215 }
217 216
218 void InspectorOverlay::invalidate() 217 void InspectorOverlay::invalidate()
219 { 218 {
220 if (!m_pageOverlay) 219 if (!m_pageOverlay)
221 m_pageOverlay = PageOverlay::create(m_webViewImpl, new InspectorPageOver layDelegate(*this)); 220 m_pageOverlay = PageOverlay::create(m_webViewImpl, new InspectorPageOver layDelegate(*this));
222 221
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 m_resizeTimerActive = false; 583 m_resizeTimerActive = false;
585 m_pausedInDebuggerMessage = String(); 584 m_pausedInDebuggerMessage = String();
586 m_inspectMode = InspectorDOMAgent::NotSearching; 585 m_inspectMode = InspectorDOMAgent::NotSearching;
587 m_timer.stop(); 586 m_timer.stop();
588 hideHighlight(); 587 hideHighlight();
589 } 588 }
590 589
591 void InspectorOverlay::clear() 590 void InspectorOverlay::clear()
592 { 591 {
593 clearInternal(); 592 clearInternal();
594 m_debuggerAgent.clear(); 593 m_v8Session = nullptr;
595 m_domAgent.clear(); 594 m_domAgent.clear();
596 m_cssAgent.clear(); 595 m_cssAgent.clear();
597 m_overlayHost->setListener(nullptr); 596 m_overlayHost->setListener(nullptr);
598 } 597 }
599 598
600 void InspectorOverlay::overlayResumed() 599 void InspectorOverlay::overlayResumed()
601 { 600 {
602 if (m_debuggerAgent) { 601 if (m_v8Session)
603 ErrorString error; 602 m_v8Session->resume();
604 m_debuggerAgent->resume(&error);
605 }
606 } 603 }
607 604
608 void InspectorOverlay::overlaySteppedOver() 605 void InspectorOverlay::overlaySteppedOver()
609 { 606 {
610 if (m_debuggerAgent) { 607 if (m_v8Session)
611 ErrorString error; 608 m_v8Session->stepOver();
612 m_debuggerAgent->stepOver(&error);
613 }
614 } 609 }
615 610
616 void InspectorOverlay::overlayStartedPropertyChange(const String& property) 611 void InspectorOverlay::overlayStartedPropertyChange(const String& property)
617 { 612 {
618 DCHECK(m_layoutEditor); 613 DCHECK(m_layoutEditor);
619 m_layoutEditor->overlayStartedPropertyChange(property); 614 m_layoutEditor->overlayStartedPropertyChange(property);
620 } 615 }
621 616
622 void InspectorOverlay::overlayPropertyChanged(float value) 617 void InspectorOverlay::overlayPropertyChanged(float value)
623 { 618 {
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 776
782 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node) 777 void InspectorOverlay::initializeLayoutEditorIfNeeded(Node* node)
783 { 778 {
784 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || !node || !node-> isElementNode() || !node->ownerDocument()->isActive() || !m_cssAgent || !m_domAg ent) 779 if (m_inspectMode != InspectorDOMAgent::ShowLayoutEditor || !node || !node-> isElementNode() || !node->ownerDocument()->isActive() || !m_cssAgent || !m_domAg ent)
785 return; 780 return;
786 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgen t, &overlayMainFrame()->script()); 781 m_layoutEditor = LayoutEditor::create(toElement(node), m_cssAgent, m_domAgen t, &overlayMainFrame()->script());
787 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde n(true); 782 toChromeClientImpl(m_webViewImpl->page()->chromeClient()).setCursorOverridde n(true);
788 } 783 }
789 784
790 } // namespace blink 785 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698