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

Unified Diff: third_party/WebKit/public/platform/WebCompositorSupport.h

Issue 2389973002: Use std::unique_ptr to signal ownership transfer in WebCompositorSupport (Closed)
Patch Set: rebase Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/public/platform/WebCompositorSupport.h
diff --git a/third_party/WebKit/public/platform/WebCompositorSupport.h b/third_party/WebKit/public/platform/WebCompositorSupport.h
index 6a90e22d14964c90c005201671471c5d7b1e11d9..0ef1b3cae2ef242aabb671c3339e263b01e70d45 100644
--- a/third_party/WebKit/public/platform/WebCompositorSupport.h
+++ b/third_party/WebKit/public/platform/WebCompositorSupport.h
@@ -32,6 +32,8 @@
#include "WebScrollbar.h"
#include "WebScrollbarThemePainter.h"
+#include <memory>
+
namespace cc {
class Layer;
class TextureLayerClient;
@@ -51,36 +53,28 @@ class WebCompositorSupport {
public:
// Layers -------------------------------------------------------
- virtual WebLayer* createLayer() { return nullptr; }
+ virtual std::unique_ptr<WebLayer> createLayer() = 0;
- virtual WebLayer* createLayerFromCCLayer(cc::Layer*) { return nullptr; }
+ virtual std::unique_ptr<WebLayer> createLayerFromCCLayer(cc::Layer*) = 0;
- virtual WebContentLayer* createContentLayer(WebContentLayerClient*) {
- return nullptr;
- }
+ virtual std::unique_ptr<WebContentLayer> createContentLayer(
+ WebContentLayerClient*) = 0;
- virtual WebExternalTextureLayer* createExternalTextureLayer(
- cc::TextureLayerClient*) {
- return nullptr;
- }
+ virtual std::unique_ptr<WebExternalTextureLayer> createExternalTextureLayer(
+ cc::TextureLayerClient*) = 0;
- virtual WebImageLayer* createImageLayer() { return nullptr; }
+ virtual std::unique_ptr<WebImageLayer> createImageLayer() = 0;
- // The ownership of the WebScrollbarThemeGeometry pointer is passed to
- // Chromium.
- virtual WebScrollbarLayer* createScrollbarLayer(WebScrollbar*,
- WebScrollbarThemePainter,
- WebScrollbarThemeGeometry*) {
- return nullptr;
- }
+ virtual std::unique_ptr<WebScrollbarLayer> createScrollbarLayer(
+ std::unique_ptr<WebScrollbar>,
+ WebScrollbarThemePainter,
+ std::unique_ptr<WebScrollbarThemeGeometry>) = 0;
- virtual WebScrollbarLayer* createSolidColorScrollbarLayer(
+ virtual std::unique_ptr<WebScrollbarLayer> createSolidColorScrollbarLayer(
WebScrollbar::Orientation,
int thumbThickness,
int trackStart,
- bool isLeftSideVerticalScrollbar) {
- return nullptr;
- }
+ bool isLeftSideVerticalScrollbar) = 0;
protected:
virtual ~WebCompositorSupport() {}

Powered by Google App Engine
This is Rietveld 408576698