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

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

Issue 336553003: Change Page::m_mainFrame to be a Frame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 6 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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 void InspectorLayerTreeAgent::restore() 162 void InspectorLayerTreeAgent::restore()
163 { 163 {
164 // We do not re-enable layer agent automatically after navigation. This is b ecause 164 // We do not re-enable layer agent automatically after navigation. This is b ecause
165 // it depends on DOMAgent and node ids in particular, so we let front-end re quest document 165 // it depends on DOMAgent and node ids in particular, so we let front-end re quest document
166 // and re-enable the agent manually after this. 166 // and re-enable the agent manually after this.
167 } 167 }
168 168
169 void InspectorLayerTreeAgent::enable(ErrorString*) 169 void InspectorLayerTreeAgent::enable(ErrorString*)
170 { 170 {
171 m_instrumentingAgents->setInspectorLayerTreeAgent(this); 171 m_instrumentingAgents->setInspectorLayerTreeAgent(this);
172 if (LocalFrame* frame = m_page->mainFrame()) { 172 if (LocalFrame* frame = m_page->deprecatedLocalMainFrame()) {
173 Document* document = frame->document(); 173 Document* document = frame->document();
174 if (document && document->lifecycle().state() >= DocumentLifecycle::Comp ositingClean) 174 if (document && document->lifecycle().state() >= DocumentLifecycle::Comp ositingClean)
175 layerTreeDidChange(); 175 layerTreeDidChange();
176 } 176 }
177 } 177 }
178 178
179 void InspectorLayerTreeAgent::disable(ErrorString*) 179 void InspectorLayerTreeAgent::disable(ErrorString*)
180 { 180 {
181 m_instrumentingAgents->setInspectorLayerTreeAgent(0); 181 m_instrumentingAgents->setInspectorLayerTreeAgent(0);
182 m_snapshotById.clear(); 182 m_snapshotById.clear();
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 gatherGraphicsLayers(root->children()[i], layerIdToNodeIdMap, layers); 246 gatherGraphicsLayers(root->children()[i], layerIdToNodeIdMap, layers);
247 } 247 }
248 248
249 int InspectorLayerTreeAgent::idForNode(Node* node) 249 int InspectorLayerTreeAgent::idForNode(Node* node)
250 { 250 {
251 return InspectorNodeIds::idForNode(node); 251 return InspectorNodeIds::idForNode(node);
252 } 252 }
253 253
254 RenderLayerCompositor* InspectorLayerTreeAgent::renderLayerCompositor() 254 RenderLayerCompositor* InspectorLayerTreeAgent::renderLayerCompositor()
255 { 255 {
256 RenderView* renderView = m_page->mainFrame()->contentRenderer(); 256 RenderView* renderView = m_page->deprecatedLocalMainFrame()->contentRenderer ();
257 RenderLayerCompositor* compositor = renderView ? renderView->compositor() : 0; 257 RenderLayerCompositor* compositor = renderView ? renderView->compositor() : 0;
258 return compositor; 258 return compositor;
259 } 259 }
260 260
261 static GraphicsLayer* findLayerById(GraphicsLayer* root, int layerId) 261 static GraphicsLayer* findLayerById(GraphicsLayer* root, int layerId)
262 { 262 {
263 if (root->platformLayer()->id() == layerId) 263 if (root->platformLayer()->id() == layerId)
264 return root; 264 return root;
265 if (root->replicaLayer()) { 265 if (root->replicaLayer()) {
266 if (GraphicsLayer* layer = findLayerById(root->replicaLayer(), layerId)) 266 if (GraphicsLayer* layer = findLayerById(root->replicaLayer(), layerId))
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 void InspectorLayerTreeAgent::didRemovePageOverlay(const GraphicsLayer* layer) 405 void InspectorLayerTreeAgent::didRemovePageOverlay(const GraphicsLayer* layer)
406 { 406 {
407 size_t index = m_pageOverlayLayerIds.find(layer->platformLayer()->id()); 407 size_t index = m_pageOverlayLayerIds.find(layer->platformLayer()->id());
408 if (index == WTF::kNotFound) 408 if (index == WTF::kNotFound)
409 return; 409 return;
410 m_pageOverlayLayerIds.remove(index); 410 m_pageOverlayLayerIds.remove(index);
411 } 411 }
412 412
413 413
414 } // namespace WebCore 414 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorInputAgent.cpp ('k') | Source/core/inspector/InspectorOverlay.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698