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

Unified Diff: third_party/WebKit/Source/platform/graphics/LoggingCanvas.h

Issue 2204383003: Make blink::JSONValue (and subclasses) use unique_ptr rather than RefPtrs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/Source/platform/graphics/LoggingCanvas.h
diff --git a/third_party/WebKit/Source/platform/graphics/LoggingCanvas.h b/third_party/WebKit/Source/platform/graphics/LoggingCanvas.h
index 1d2f0bceb32d4681b4f0bb73f27007e80b71d6dd..1bf9661fb3193bf531c017dd8f073ccb40af4e8c 100644
--- a/third_party/WebKit/Source/platform/graphics/LoggingCanvas.h
+++ b/third_party/WebKit/Source/platform/graphics/LoggingCanvas.h
@@ -33,13 +33,17 @@
#include "platform/JSONValues.h"
#include "platform/graphics/InterceptingCanvas.h"
+#include <memory>
namespace blink {
class LoggingCanvas : public InterceptingCanvasBase {
public:
LoggingCanvas(int width, int height);
- PassRefPtr<JSONArray> log();
+
+ // Gives the caller ownership of the current log data, and clears the log
+ // for future operations.
+ std::unique_ptr<JSONArray> log();
void onDrawPaint(const SkPaint&) override;
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) override;
@@ -75,7 +79,7 @@ public:
private:
friend class AutoLogger;
- RefPtr<JSONArray> m_log;
+ std::unique_ptr<JSONArray> m_log;
};
#ifndef NDEBUG

Powered by Google App Engine
This is Rietveld 408576698