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

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

Issue 1092123004: DevTools: remove dependency of most agents on InspectorPageAgent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed debug build 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;
47 class LayoutObject; 46 class LayoutObject;
48 class LayoutRect; 47 class LayoutRect;
49 class PictureSnapshot; 48 class PictureSnapshot;
50 class DeprecatedPaintLayer; 49 class DeprecatedPaintLayer;
51 class DeprecatedPaintLayerCompositor; 50 class DeprecatedPaintLayerCompositor;
52 51
53 typedef String ErrorString; 52 typedef String ErrorString;
54 53
55 class InspectorLayerTreeAgent final : public InspectorBaseAgent<InspectorLayerTr eeAgent, InspectorFrontend::LayerTree>, public InspectorBackendDispatcher::Layer TreeCommandHandler { 54 class InspectorLayerTreeAgent final : public InspectorBaseAgent<InspectorLayerTr eeAgent, InspectorFrontend::LayerTree>, public InspectorBackendDispatcher::Layer TreeCommandHandler {
56 public: 55 public:
57 static PassOwnPtrWillBeRawPtr<InspectorLayerTreeAgent> create(InspectorPageA gent* pageAgent) 56 static PassOwnPtrWillBeRawPtr<InspectorLayerTreeAgent> create(LocalFrame* in spectedFrame)
58 { 57 {
59 return adoptPtrWillBeNoop(new InspectorLayerTreeAgent(pageAgent)); 58 return adoptPtrWillBeNoop(new InspectorLayerTreeAgent(inspectedFrame));
60 } 59 }
61 virtual ~InspectorLayerTreeAgent(); 60 virtual ~InspectorLayerTreeAgent();
62 DECLARE_VIRTUAL_TRACE(); 61 DECLARE_VIRTUAL_TRACE();
63 62
64 void disable(ErrorString*) override; 63 void disable(ErrorString*) override;
65 void restore() override; 64 void restore() override;
66 65
67 // Called from InspectorController 66 // Called from InspectorController
68 void willAddPageOverlay(const GraphicsLayer*); 67 void willAddPageOverlay(const GraphicsLayer*);
69 void didRemovePageOverlay(const GraphicsLayer*); 68 void didRemovePageOverlay(const GraphicsLayer*);
(...skipping 11 matching lines...) Expand all
81 virtual void replaySnapshot(ErrorString*, const String& snapshotId, const in t* fromStep, const int* toStep, const double* scale, String* dataURL) override; 80 virtual void replaySnapshot(ErrorString*, const String& snapshotId, const in t* fromStep, const int* toStep, const double* scale, String* dataURL) 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; 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;
83 virtual void snapshotCommandLog(ErrorString*, const String& snapshotId, RefP tr<TypeBuilder::Array<JSONObject> >&) override; 82 virtual void snapshotCommandLog(ErrorString*, const String& snapshotId, RefP tr<TypeBuilder::Array<JSONObject> >&) override;
84 83
85 // Called by other agents. 84 // Called by other agents.
86 PassRefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > buildLayerTre e(); 85 PassRefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > buildLayerTre e();
87 86
88 private: 87 private:
89 static unsigned s_lastSnapshotId; 88 static unsigned s_lastSnapshotId;
90 89
91 explicit InspectorLayerTreeAgent(InspectorPageAgent*); 90 explicit InspectorLayerTreeAgent(LocalFrame*);
92 91
93 GraphicsLayer* rootGraphicsLayer(); 92 GraphicsLayer* rootGraphicsLayer();
94 93
95 DeprecatedPaintLayerCompositor* deprecatedPaintLayerCompositor(); 94 DeprecatedPaintLayerCompositor* deprecatedPaintLayerCompositor();
96 GraphicsLayer* layerById(ErrorString*, const String& layerId); 95 GraphicsLayer* layerById(ErrorString*, const String& layerId);
97 const PictureSnapshot* snapshotById(ErrorString*, const String& snapshotId); 96 const PictureSnapshot* snapshotById(ErrorString*, const String& snapshotId);
98 97
99 typedef HashMap<int, int> LayerIdToNodeIdMap; 98 typedef HashMap<int, int> LayerIdToNodeIdMap;
100 void buildLayerIdToNodeIdMap(DeprecatedPaintLayer*, LayerIdToNodeIdMap&); 99 void buildLayerIdToNodeIdMap(DeprecatedPaintLayer*, LayerIdToNodeIdMap&);
101 void gatherGraphicsLayers(GraphicsLayer*, HashMap<int, int>& layerIdToNodeId Map, RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&); 100 void gatherGraphicsLayers(GraphicsLayer*, HashMap<int, int>& layerIdToNodeId Map, RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&);
102 int idForNode(Node*); 101 int idForNode(Node*);
103 102
104 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; 103 RawPtrWillBeMember<LocalFrame> m_inspectedFrame;
105 Vector<int, 2> m_pageOverlayLayerIds; 104 Vector<int, 2> m_pageOverlayLayerIds;
106 105
107 typedef HashMap<String, RefPtr<PictureSnapshot> > SnapshotById; 106 typedef HashMap<String, RefPtr<PictureSnapshot> > SnapshotById;
108 SnapshotById m_snapshotById; 107 SnapshotById m_snapshotById;
109 }; 108 };
110 109
111 } // namespace blink 110 } // namespace blink
112 111
113 112
114 #endif // !defined(InspectorLayerTreeAgent_h) 113 #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