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

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

Issue 898593002: DevTools: use per-LocalFrame instrumenting agents instead of per-Page ones. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed assertion Created 5 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 /* 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 24 matching lines...) Expand all
35 #include "core/InspectorTypeBuilder.h" 35 #include "core/InspectorTypeBuilder.h"
36 #include "core/inspector/InspectorBaseAgent.h" 36 #include "core/inspector/InspectorBaseAgent.h"
37 #include "core/rendering/RenderLayer.h" 37 #include "core/rendering/RenderLayer.h"
38 #include "platform/Timer.h" 38 #include "platform/Timer.h"
39 #include "wtf/PassOwnPtr.h" 39 #include "wtf/PassOwnPtr.h"
40 #include "wtf/PassRefPtr.h" 40 #include "wtf/PassRefPtr.h"
41 #include "wtf/text/WTFString.h" 41 #include "wtf/text/WTFString.h"
42 42
43 namespace blink { 43 namespace blink {
44 44
45 class InspectorPageAgent;
45 class PictureSnapshot; 46 class PictureSnapshot;
46 class Page;
47 class RenderLayerCompositor; 47 class RenderLayerCompositor;
48 48
49 typedef String ErrorString; 49 typedef String ErrorString;
50 50
51 class InspectorLayerTreeAgent final : public InspectorBaseAgent<InspectorLayerTr eeAgent>, public InspectorBackendDispatcher::LayerTreeCommandHandler { 51 class InspectorLayerTreeAgent final : public InspectorBaseAgent<InspectorLayerTr eeAgent>, public InspectorBackendDispatcher::LayerTreeCommandHandler {
52 public: 52 public:
53 static PassOwnPtrWillBeRawPtr<InspectorLayerTreeAgent> create(Page* page) 53 static PassOwnPtrWillBeRawPtr<InspectorLayerTreeAgent> create(InspectorPageA gent* pageAgent)
54 { 54 {
55 return adoptPtrWillBeNoop(new InspectorLayerTreeAgent(page)); 55 return adoptPtrWillBeNoop(new InspectorLayerTreeAgent(pageAgent));
56 } 56 }
57 virtual ~InspectorLayerTreeAgent(); 57 virtual ~InspectorLayerTreeAgent();
58 virtual void trace(Visitor*) override; 58 virtual void trace(Visitor*) override;
59 59
60 virtual void setFrontend(InspectorFrontend*) override; 60 virtual void setFrontend(InspectorFrontend*) override;
61 virtual void clearFrontend() override; 61 virtual void clearFrontend() override;
62 virtual void restore() override; 62 virtual void restore() override;
63 63
64 // Called from InspectorController 64 // Called from InspectorController
65 void willAddPageOverlay(const GraphicsLayer*); 65 void willAddPageOverlay(const GraphicsLayer*);
(...skipping 13 matching lines...) Expand all
79 virtual void replaySnapshot(ErrorString*, const String& snapshotId, const in t* fromStep, const int* toStep, const double* scale, String* dataURL) override; 79 virtual void replaySnapshot(ErrorString*, const String& snapshotId, const in t* fromStep, const int* toStep, const double* scale, String* dataURL) override;
80 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; 80 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 snapshotCommandLog(ErrorString*, const String& snapshotId, RefP tr<TypeBuilder::Array<JSONObject> >&) override; 81 virtual void snapshotCommandLog(ErrorString*, const String& snapshotId, RefP tr<TypeBuilder::Array<JSONObject> >&) override;
82 82
83 // Called by other agents. 83 // Called by other agents.
84 PassRefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > buildLayerTre e(); 84 PassRefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > buildLayerTre e();
85 85
86 private: 86 private:
87 static unsigned s_lastSnapshotId; 87 static unsigned s_lastSnapshotId;
88 88
89 explicit InspectorLayerTreeAgent(Page*); 89 explicit InspectorLayerTreeAgent(InspectorPageAgent*);
90 90
91 GraphicsLayer* rootGraphicsLayer(); 91 GraphicsLayer* rootGraphicsLayer();
92 92
93 RenderLayerCompositor* renderLayerCompositor(); 93 RenderLayerCompositor* renderLayerCompositor();
94 GraphicsLayer* layerById(ErrorString*, const String& layerId); 94 GraphicsLayer* layerById(ErrorString*, const String& layerId);
95 const PictureSnapshot* snapshotById(ErrorString*, const String& snapshotId); 95 const PictureSnapshot* snapshotById(ErrorString*, const String& snapshotId);
96 96
97 typedef HashMap<int, int> LayerIdToNodeIdMap; 97 typedef HashMap<int, int> LayerIdToNodeIdMap;
98 void buildLayerIdToNodeIdMap(RenderLayer*, LayerIdToNodeIdMap&); 98 void buildLayerIdToNodeIdMap(RenderLayer*, LayerIdToNodeIdMap&);
99 void gatherGraphicsLayers(GraphicsLayer*, HashMap<int, int>& layerIdToNodeId Map, RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&); 99 void gatherGraphicsLayers(GraphicsLayer*, HashMap<int, int>& layerIdToNodeId Map, RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&);
100 int idForNode(Node*); 100 int idForNode(Node*);
101 101
102 InspectorFrontend::LayerTree* m_frontend; 102 InspectorFrontend::LayerTree* m_frontend;
103 RawPtrWillBeMember<Page> m_page; 103 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent;
104 Vector<int, 2> m_pageOverlayLayerIds; 104 Vector<int, 2> m_pageOverlayLayerIds;
105 105
106 typedef HashMap<String, RefPtr<PictureSnapshot> > SnapshotById; 106 typedef HashMap<String, RefPtr<PictureSnapshot> > SnapshotById;
107 SnapshotById m_snapshotById; 107 SnapshotById m_snapshotById;
108 }; 108 };
109 109
110 } // namespace blink 110 } // namespace blink
111 111
112 112
113 #endif // !defined(InspectorLayerTreeAgent_h) 113 #endif // !defined(InspectorLayerTreeAgent_h)
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorInstrumentationCustomInl.h ('k') | Source/core/inspector/InspectorLayerTreeAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698