Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef StubChromeClientForSPv2_h | 5 #ifndef StubChromeClientForSPv2_h |
| 6 #define StubChromeClientForSPv2_h | 6 #define StubChromeClientForSPv2_h |
| 7 | 7 |
| 8 #include "core/loader/EmptyClients.h" | 8 #include "core/loader/EmptyClients.h" |
| 9 #include "platform/graphics/compositing/PaintArtifactCompositor.h" | 9 #include "platform/graphics/compositing/PaintArtifactCompositor.h" |
| 10 #include "platform/testing/WebLayerTreeViewImplForTesting.h" | 10 #include "platform/testing/WebLayerTreeViewImplForTesting.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 // A simple ChromeClient implementation which forwards painted artifacts to a | 14 // A simple ChromeClient implementation which forwards painted artifacts to a |
| 15 // PaintArtifactCompositor attached to a testing WebLayerTreeView, and permits | 15 // PaintArtifactCompositor attached to a testing WebLayerTreeView, and permits |
| 16 // simple analysis of the results. | 16 // simple analysis of the results. |
| 17 class StubChromeClientForSPv2 : public EmptyChromeClient { | 17 class StubChromeClientForSPv2 |
| 18 : public EmptyChromeClient { | |
|
jbroman
2016/09/04 20:27:11
super-nit: why wrap this?
pdr.
2016/09/05 01:28:19
This was just a mistake, fixed.
| |
| 18 public: | 19 public: |
| 19 StubChromeClientForSPv2(WebLayerTreeViewImplForTesting::LayerListPolicy laye rListPolicy) | 20 StubChromeClientForSPv2() : m_layerTreeView() |
| 20 : m_layerTreeView(layerListPolicy) | |
| 21 { | 21 { |
| 22 m_layerTreeView.setRootLayer(*m_paintArtifactCompositor.getWebLayer()); | 22 m_layerTreeView.setRootLayer(*m_paintArtifactCompositor.getWebLayer()); |
| 23 } | 23 } |
| 24 | 24 |
| 25 bool hasLayer(const WebLayer& layer) { return m_layerTreeView.hasLayer(layer ); } | 25 bool hasLayer(const WebLayer& layer) { return m_layerTreeView.hasLayer(layer ); } |
| 26 | 26 |
| 27 // ChromeClient | 27 // ChromeClient |
| 28 void didPaint(const PaintArtifact& artifact) override | 28 void didPaint(const PaintArtifact& artifact) override |
| 29 { | 29 { |
| 30 m_paintArtifactCompositor.update(artifact); | 30 m_paintArtifactCompositor.update(artifact); |
| 31 } | 31 } |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 WebLayerTreeViewImplForTesting m_layerTreeView; | 34 WebLayerTreeViewImplForTesting m_layerTreeView; |
| 35 PaintArtifactCompositor m_paintArtifactCompositor; | 35 PaintArtifactCompositor m_paintArtifactCompositor; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 } // namespace blink | 38 } // namespace blink |
| 39 | 39 |
| 40 #endif // StubChromeClientForSPv2_h | 40 #endif // StubChromeClientForSPv2_h |
| OLD | NEW |