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

Side by Side Diff: Source/core/inspector/InspectorLayerTreeAgent.h

Issue 1118963002: Revert of DevTools: remove dependency of most agents on InspectorPageAgent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 25 matching lines...) Expand all
36 #include "core/inspector/InspectorBaseAgent.h" 36 #include "core/inspector/InspectorBaseAgent.h"
37 #include "platform/Timer.h" 37 #include "platform/Timer.h"
38 #include "wtf/PassOwnPtr.h" 38 #include "wtf/PassOwnPtr.h"
39 #include "wtf/PassRefPtr.h" 39 #include "wtf/PassRefPtr.h"
40 #include "wtf/text/WTFString.h" 40 #include "wtf/text/WTFString.h"
41 41
42 namespace blink { 42 namespace blink {
43 43
44 class GraphicsContext; 44 class GraphicsContext;
45 class GraphicsLayer; 45 class GraphicsLayer;
46 class InspectorPageAgent;
46 class LayoutObject; 47 class LayoutObject;
47 class LayoutRect; 48 class LayoutRect;
48 class PictureSnapshot; 49 class PictureSnapshot;
49 class DeprecatedPaintLayer; 50 class DeprecatedPaintLayer;
50 class DeprecatedPaintLayerCompositor; 51 class DeprecatedPaintLayerCompositor;
51 52
52 typedef String ErrorString; 53 typedef String ErrorString;
53 54
54 class InspectorLayerTreeAgent final : public InspectorBaseAgent<InspectorLayerTr eeAgent, InspectorFrontend::LayerTree>, public InspectorBackendDispatcher::Layer TreeCommandHandler { 55 class InspectorLayerTreeAgent final : public InspectorBaseAgent<InspectorLayerTr eeAgent, InspectorFrontend::LayerTree>, public InspectorBackendDispatcher::Layer TreeCommandHandler {
55 public: 56 public:
56 static PassOwnPtrWillBeRawPtr<InspectorLayerTreeAgent> create(LocalFrame* in spectedFrame) 57 static PassOwnPtrWillBeRawPtr<InspectorLayerTreeAgent> create(InspectorPageA gent* pageAgent)
57 { 58 {
58 return adoptPtrWillBeNoop(new InspectorLayerTreeAgent(inspectedFrame)); 59 return adoptPtrWillBeNoop(new InspectorLayerTreeAgent(pageAgent));
59 } 60 }
60 virtual ~InspectorLayerTreeAgent(); 61 virtual ~InspectorLayerTreeAgent();
61 DECLARE_VIRTUAL_TRACE(); 62 DECLARE_VIRTUAL_TRACE();
62 63
63 void disable(ErrorString*) override; 64 void disable(ErrorString*) override;
64 void restore() override; 65 void restore() override;
65 66
66 // Called from InspectorController 67 // Called from InspectorController
67 void willAddPageOverlay(const GraphicsLayer*); 68 void willAddPageOverlay(const GraphicsLayer*);
68 void didRemovePageOverlay(const GraphicsLayer*); 69 void didRemovePageOverlay(const GraphicsLayer*);
(...skipping 11 matching lines...) Expand all
80 virtual void replaySnapshot(ErrorString*, const String& snapshotId, const in t* fromStep, const int* toStep, const double* scale, String* dataURL) override; 81 virtual void replaySnapshot(ErrorString*, const String& snapshotId, const in t* fromStep, const int* toStep, const double* scale, String* dataURL) override;
81 virtual void profileSnapshot(ErrorString*, const String& snapshotId, const i nt* minRepeatCount, const double* minDuration, const RefPtr<JSONObject>* clipRec t, RefPtr<TypeBuilder::Array<TypeBuilder::Array<double> > >&) override; 82 virtual void profileSnapshot(ErrorString*, const String& snapshotId, const i nt* minRepeatCount, const double* minDuration, const RefPtr<JSONObject>* clipRec t, RefPtr<TypeBuilder::Array<TypeBuilder::Array<double> > >&) override;
82 virtual void snapshotCommandLog(ErrorString*, const String& snapshotId, RefP tr<TypeBuilder::Array<JSONObject> >&) override; 83 virtual void snapshotCommandLog(ErrorString*, const String& snapshotId, RefP tr<TypeBuilder::Array<JSONObject> >&) override;
83 84
84 // Called by other agents. 85 // Called by other agents.
85 PassRefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > buildLayerTre e(); 86 PassRefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > buildLayerTre e();
86 87
87 private: 88 private:
88 static unsigned s_lastSnapshotId; 89 static unsigned s_lastSnapshotId;
89 90
90 explicit InspectorLayerTreeAgent(LocalFrame*); 91 explicit InspectorLayerTreeAgent(InspectorPageAgent*);
91 92
92 GraphicsLayer* rootGraphicsLayer(); 93 GraphicsLayer* rootGraphicsLayer();
93 94
94 DeprecatedPaintLayerCompositor* deprecatedPaintLayerCompositor(); 95 DeprecatedPaintLayerCompositor* deprecatedPaintLayerCompositor();
95 GraphicsLayer* layerById(ErrorString*, const String& layerId); 96 GraphicsLayer* layerById(ErrorString*, const String& layerId);
96 const PictureSnapshot* snapshotById(ErrorString*, const String& snapshotId); 97 const PictureSnapshot* snapshotById(ErrorString*, const String& snapshotId);
97 98
98 typedef HashMap<int, int> LayerIdToNodeIdMap; 99 typedef HashMap<int, int> LayerIdToNodeIdMap;
99 void buildLayerIdToNodeIdMap(DeprecatedPaintLayer*, LayerIdToNodeIdMap&); 100 void buildLayerIdToNodeIdMap(DeprecatedPaintLayer*, LayerIdToNodeIdMap&);
100 void gatherGraphicsLayers(GraphicsLayer*, HashMap<int, int>& layerIdToNodeId Map, RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&); 101 void gatherGraphicsLayers(GraphicsLayer*, HashMap<int, int>& layerIdToNodeId Map, RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&);
101 int idForNode(Node*); 102 int idForNode(Node*);
102 103
103 RawPtrWillBeMember<LocalFrame> m_inspectedFrame; 104 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent;
104 Vector<int, 2> m_pageOverlayLayerIds; 105 Vector<int, 2> m_pageOverlayLayerIds;
105 106
106 typedef HashMap<String, RefPtr<PictureSnapshot> > SnapshotById; 107 typedef HashMap<String, RefPtr<PictureSnapshot> > SnapshotById;
107 SnapshotById m_snapshotById; 108 SnapshotById m_snapshotById;
108 }; 109 };
109 110
110 } // namespace blink 111 } // namespace blink
111 112
112 113
113 #endif // !defined(InspectorLayerTreeAgent_h) 114 #endif // !defined(InspectorLayerTreeAgent_h)
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorInputAgent.cpp ('k') | Source/core/inspector/InspectorLayerTreeAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698