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

Unified Diff: Source/core/paint/FileUploadControlPainter.cpp

Issue 1129793005: Replace OwnPtr with WTF::Optional for optional recorders. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: merge with master Created 5 years, 7 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: Source/core/paint/FileUploadControlPainter.cpp
diff --git a/Source/core/paint/FileUploadControlPainter.cpp b/Source/core/paint/FileUploadControlPainter.cpp
index 34b3031de96de022954b2cb7d4e69470b34ba2d0..66e7d1d60acb21fe4f35c283a477e5924c94811e 100644
--- a/Source/core/paint/FileUploadControlPainter.cpp
+++ b/Source/core/paint/FileUploadControlPainter.cpp
@@ -11,6 +11,7 @@
#include "core/paint/LayoutObjectDrawingRecorder.h"
#include "core/paint/PaintInfo.h"
#include "platform/graphics/paint/ClipRecorder.h"
+#include "wtf/Optional.h"
namespace blink {
@@ -22,14 +23,14 @@ void FileUploadControlPainter::paintObject(const PaintInfo& paintInfo, const Lay
return;
// Push a clip.
- OwnPtr<ClipRecorder> clipRecorder;
+ Optional<ClipRecorder> clipRecorder;
if (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseChildBlockBackgrounds) {
IntRect clipRect = enclosingIntRect(LayoutRect(
LayoutPoint(paintOffset.x() + m_layoutFileUploadControl.borderLeft(), paintOffset.y() + m_layoutFileUploadControl.borderTop()),
m_layoutFileUploadControl.size() + LayoutSize(0, -m_layoutFileUploadControl.borderWidth() + buttonShadowHeight)));
if (clipRect.isEmpty())
return;
- clipRecorder = adoptPtr(new ClipRecorder(*paintInfo.context, m_layoutFileUploadControl, DisplayItem::ClipFileUploadControlRect, LayoutRect(clipRect)));
+ clipRecorder.emplace(*paintInfo.context, m_layoutFileUploadControl, DisplayItem::ClipFileUploadControlRect, LayoutRect(clipRect));
}
if (paintInfo.phase == PaintPhaseForeground) {

Powered by Google App Engine
This is Rietveld 408576698