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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 3df57d69da47892f504e9dccc69b655c9b507006..af351b360d4761e1ca778d820bafc9daa00ae75b 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -180,8 +180,10 @@
#include "web/WebRemoteFrameImpl.h"
#include "web/WebSettingsImpl.h"
#include "wtf/CurrentTime.h"
+#include "wtf/PtrUtil.h"
#include "wtf/RefPtr.h"
#include "wtf/TemporaryChange.h"
+#include <memory>
#if USE(DEFAULT_RENDER_THEME)
#include "core/layout/LayoutThemeDefault.h"
@@ -229,9 +231,9 @@ const double WebView::maxTextSizeMultiplier = 3.0;
// Used to defer all page activity in cases where the embedder wishes to run
// a nested event loop. Using a stack enables nesting of message loop invocations.
-static Vector<OwnPtr<ScopedPageLoadDeferrer>>& pageLoadDeferrerStack()
+static Vector<std::unique_ptr<ScopedPageLoadDeferrer>>& pageLoadDeferrerStack()
{
- DEFINE_STATIC_LOCAL(Vector<OwnPtr<ScopedPageLoadDeferrer>>, deferrerStack, ());
+ DEFINE_STATIC_LOCAL(Vector<std::unique_ptr<ScopedPageLoadDeferrer>>, deferrerStack, ());
return deferrerStack;
}
@@ -362,7 +364,7 @@ void WebView::resetVisitedLinkState(bool invalidateVisitedLinkHashes)
void WebView::willEnterModalLoop()
{
- pageLoadDeferrerStack().append(adoptPtr(new ScopedPageLoadDeferrer()));
+ pageLoadDeferrerStack().append(wrapUnique(new ScopedPageLoadDeferrer()));
}
void WebView::didExitModalLoop()
@@ -448,7 +450,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_displayMode(WebDisplayModeBrowser)
, m_elasticOverscroll(FloatSize())
, m_mutator(nullptr)
- , m_scheduler(adoptPtr(Platform::current()->currentThread()->scheduler()->createWebViewScheduler(this).release()))
+ , m_scheduler(wrapUnique(Platform::current()->currentThread()->scheduler()->createWebViewScheduler(this).release()))
, m_lastFrameTimeMonotonic(0)
{
Page::PageClients pageClients;
@@ -738,7 +740,7 @@ WebInputEventResult WebViewImpl::handleGestureEvent(const WebGestureEvent& event
m_flingModifier = event.modifiers;
m_flingSourceDevice = event.sourceDevice;
DCHECK_NE(m_flingSourceDevice, WebGestureDeviceUninitialized);
- OwnPtr<WebGestureCurve> flingCurve = adoptPtr(Platform::current()->createFlingAnimationCurve(event.sourceDevice, WebFloatPoint(event.data.flingStart.velocityX, event.data.flingStart.velocityY), WebSize()));
+ std::unique_ptr<WebGestureCurve> flingCurve = wrapUnique(Platform::current()->createFlingAnimationCurve(event.sourceDevice, WebFloatPoint(event.data.flingStart.velocityX, event.data.flingStart.velocityY), WebSize()));
DCHECK(flingCurve);
m_gestureAnimation = WebActiveGestureAnimation::createAtAnimationStart(std::move(flingCurve), this);
scheduleAnimation();
@@ -959,7 +961,7 @@ void WebViewImpl::transferActiveWheelFlingAnimation(const WebActiveWheelFlingPar
m_positionOnFlingStart = parameters.point;
m_globalPositionOnFlingStart = parameters.globalPoint;
m_flingModifier = parameters.modifiers;
- OwnPtr<WebGestureCurve> curve = adoptPtr(Platform::current()->createFlingAnimationCurve(parameters.sourceDevice, WebFloatPoint(parameters.delta), parameters.cumulativeScroll));
+ std::unique_ptr<WebGestureCurve> curve = wrapUnique(Platform::current()->createFlingAnimationCurve(parameters.sourceDevice, WebFloatPoint(parameters.delta), parameters.cumulativeScroll));
DCHECK(curve);
m_gestureAnimation = WebActiveGestureAnimation::createWithTimeOffset(std::move(curve), this, parameters.startTime);
DCHECK_NE(parameters.sourceDevice, WebGestureDeviceUninitialized);
@@ -2190,7 +2192,7 @@ WebInputEventResult WebViewImpl::handleInputEvent(const WebInputEvent& inputEven
if (inputEvent.type == WebInputEvent::MouseUp)
mouseCaptureLost();
- OwnPtr<UserGestureIndicator> gestureIndicator;
+ std::unique_ptr<UserGestureIndicator> gestureIndicator;
AtomicString eventType;
switch (inputEvent.type) {
@@ -2202,12 +2204,12 @@ WebInputEventResult WebViewImpl::handleInputEvent(const WebInputEvent& inputEven
break;
case WebInputEvent::MouseDown:
eventType = EventTypeNames::mousedown;
- gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessingNewUserGesture));
+ gestureIndicator = wrapUnique(new UserGestureIndicator(DefinitelyProcessingNewUserGesture));
m_mouseCaptureGestureToken = gestureIndicator->currentToken();
break;
case WebInputEvent::MouseUp:
eventType = EventTypeNames::mouseup;
- gestureIndicator = adoptPtr(new UserGestureIndicator(m_mouseCaptureGestureToken.release()));
+ gestureIndicator = wrapUnique(new UserGestureIndicator(m_mouseCaptureGestureToken.release()));
break;
default:
NOTREACHED();
@@ -2837,7 +2839,7 @@ void WebViewImpl::reportFixedRasterScaleUseCounters(bool hasBlurryContent, bool
WebSettingsImpl* WebViewImpl::settingsImpl()
{
if (!m_webSettings)
- m_webSettings = adoptPtr(new WebSettingsImpl(&m_page->settings(), m_devToolsEmulator.get()));
+ m_webSettings = wrapUnique(new WebSettingsImpl(&m_page->settings(), m_devToolsEmulator.get()));
DCHECK(m_webSettings);
return m_webSettings.get();
}
@@ -4474,17 +4476,17 @@ void WebViewImpl::setVisibilityState(WebPageVisibilityState visibilityState,
void WebViewImpl::pointerLockMouseEvent(const WebInputEvent& event)
{
- OwnPtr<UserGestureIndicator> gestureIndicator;
+ std::unique_ptr<UserGestureIndicator> gestureIndicator;
AtomicString eventType;
switch (event.type) {
case WebInputEvent::MouseDown:
eventType = EventTypeNames::mousedown;
- gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessingNewUserGesture));
+ gestureIndicator = wrapUnique(new UserGestureIndicator(DefinitelyProcessingNewUserGesture));
m_pointerLockGestureToken = gestureIndicator->currentToken();
break;
case WebInputEvent::MouseUp:
eventType = EventTypeNames::mouseup;
- gestureIndicator = adoptPtr(new UserGestureIndicator(m_pointerLockGestureToken.release()));
+ gestureIndicator = wrapUnique(new UserGestureIndicator(m_pointerLockGestureToken.release()));
break;
case WebInputEvent::MouseMove:
eventType = EventTypeNames::mousemove;
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/Source/web/WorkerContentSettingsClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698