WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-149552-20150925170042.patch (text/plain), 13.80 KB, created by
Gyuyoung Kim
on 2015-09-25 01:01:03 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Gyuyoung Kim
Created:
2015-09-25 01:01:03 PDT
Size:
13.80 KB
patch
obsolete
>Subversion Revision: 190235 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 95661660b9f718eaef17daf71d704d94c75450b5..21baf482d3abe4d8f054cd2c568e0ecc2f062a5f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,32 @@ >+2015-09-25 Gyuyoung Kim <gyuyoung.kim@webkit.org> >+ >+ Clean up all uses of PassRefPtr in Modules/geolocation >+ https://bugs.webkit.org/show_bug.cgi?id=149552 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Modules/geolocation/GeoNotifier.cpp: >+ (WebCore::GeoNotifier::GeoNotifier): >+ (WebCore::GeoNotifier::setFatalError): >+ * Modules/geolocation/GeoNotifier.h: >+ (WebCore::GeoNotifier::create): >+ * Modules/geolocation/Geolocation.cpp: >+ (WebCore::createGeoposition): >+ (WebCore::createPositionError): >+ (WebCore::Geolocation::Watchers::add): >+ (WebCore::Geolocation::getCurrentPosition): >+ (WebCore::Geolocation::watchPosition): >+ (WebCore::Geolocation::startRequest): >+ * Modules/geolocation/Geolocation.h: >+ * Modules/geolocation/GeolocationError.h: >+ * Modules/geolocation/GeolocationPosition.h: >+ * Modules/geolocation/Geoposition.h: >+ (WebCore::Geoposition::create): >+ (WebCore::Geoposition::isolatedCopy): >+ (WebCore::Geoposition::Geoposition): >+ * Modules/geolocation/PositionError.h: >+ * Modules/geolocation/PositionOptions.h: >+ > 2015-09-24 Brent Fulgham <bfulgham@apple.com> > > [Win] Support composited content in WebView render-to-context methods >diff --git a/Source/WebCore/Modules/geolocation/GeoNotifier.cpp b/Source/WebCore/Modules/geolocation/GeoNotifier.cpp >index 2819eadcdf7921ffe9f477d94ad4e3fb963c3ad6..d3eed20edd4a97e5da8a0e6109c997b7cd1122f3 100644 >--- a/Source/WebCore/Modules/geolocation/GeoNotifier.cpp >+++ b/Source/WebCore/Modules/geolocation/GeoNotifier.cpp >@@ -34,11 +34,11 @@ > > namespace WebCore { > >-GeoNotifier::GeoNotifier(Geolocation& geolocation, PassRefPtr<PositionCallback> successCallback, PassRefPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options) >+GeoNotifier::GeoNotifier(Geolocation& geolocation, RefPtr<PositionCallback>&& successCallback, RefPtr<PositionErrorCallback>&& errorCallback, RefPtr<PositionOptions>&& options) > : m_geolocation(geolocation) >- , m_successCallback(successCallback) >- , m_errorCallback(errorCallback) >- , m_options(options) >+ , m_successCallback(WTF::move(successCallback)) >+ , m_errorCallback(WTF::move(errorCallback)) >+ , m_options(WTF::move(options)) > , m_timer(*this, &GeoNotifier::timerFired) > , m_useCachedPosition(false) > { >@@ -48,7 +48,7 @@ GeoNotifier::GeoNotifier(Geolocation& geolocation, PassRefPtr<PositionCallback> > ASSERT(m_options); > } > >-void GeoNotifier::setFatalError(PassRefPtr<PositionError> error) >+void GeoNotifier::setFatalError(RefPtr<PositionError>&& error) > { > // If a fatal error has already been set, stick with it. This makes sure that > // when permission is denied, this is the error reported, as required by the >@@ -56,7 +56,7 @@ void GeoNotifier::setFatalError(PassRefPtr<PositionError> error) > if (m_fatalError) > return; > >- m_fatalError = error; >+ m_fatalError = WTF::move(error); > // An existing timer may not have a zero timeout. > m_timer.stop(); > m_timer.startOneShot(0); >diff --git a/Source/WebCore/Modules/geolocation/GeoNotifier.h b/Source/WebCore/Modules/geolocation/GeoNotifier.h >index 6c3ec5cf552364746c681bef70b13b402bf41617..339243a32e3c077bb1ad6d757536fb6007e48bf7 100644 >--- a/Source/WebCore/Modules/geolocation/GeoNotifier.h >+++ b/Source/WebCore/Modules/geolocation/GeoNotifier.h >@@ -45,13 +45,13 @@ class PositionOptions; > > class GeoNotifier : public RefCounted<GeoNotifier> { > public: >- static Ref<GeoNotifier> create(Geolocation& geolocation, PassRefPtr<PositionCallback> positionCallback, PassRefPtr<PositionErrorCallback> positionErrorCallback, PassRefPtr<PositionOptions> options) >+ static Ref<GeoNotifier> create(Geolocation& geolocation, RefPtr<PositionCallback>&& positionCallback, RefPtr<PositionErrorCallback>&& positionErrorCallback, RefPtr<PositionOptions>&& options) > { >- return adoptRef(*new GeoNotifier(geolocation, positionCallback, positionErrorCallback, options)); >+ return adoptRef(*new GeoNotifier(geolocation, WTF::move(positionCallback), WTF::move(positionErrorCallback), WTF::move(options))); > } > > PositionOptions* options() const { return m_options.get(); } >- void setFatalError(PassRefPtr<PositionError>); >+ void setFatalError(RefPtr<PositionError>&&); > > bool useCachedPosition() const { return m_useCachedPosition; } > void setUseCachedPosition(); >@@ -65,7 +65,7 @@ public: > bool hasZeroTimeout() const; > > private: >- GeoNotifier(Geolocation&, PassRefPtr<PositionCallback>, PassRefPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>); >+ GeoNotifier(Geolocation&, RefPtr<PositionCallback>&&, RefPtr<PositionErrorCallback>&&, RefPtr<PositionOptions>&&); > > Ref<Geolocation> m_geolocation; > RefPtr<PositionCallback> m_successCallback; >diff --git a/Source/WebCore/Modules/geolocation/Geolocation.cpp b/Source/WebCore/Modules/geolocation/Geolocation.cpp >index 811424c2ba75d536d52de433d28096f78611040f..dc4726a2b81696717f7f1938a84334de85db1d4b 100644 >--- a/Source/WebCore/Modules/geolocation/Geolocation.cpp >+++ b/Source/WebCore/Modules/geolocation/Geolocation.cpp >@@ -49,10 +49,10 @@ static const char permissionDeniedErrorMessage[] = "User denied Geolocation"; > static const char failedToStartServiceErrorMessage[] = "Failed to start Geolocation service"; > static const char framelessDocumentErrorMessage[] = "Geolocation cannot be used in frameless documents"; > >-static PassRefPtr<Geoposition> createGeoposition(GeolocationPosition* position) >+static RefPtr<Geoposition> createGeoposition(GeolocationPosition* position) > { > if (!position) >- return 0; >+ return nullptr; > > RefPtr<Coordinates> coordinates = Coordinates::create(position->latitude(), position->longitude(), position->canProvideAltitude(), position->altitude(), > position->accuracy(), position->canProvideAltitudeAccuracy(), position->altitudeAccuracy(), >@@ -60,7 +60,7 @@ static PassRefPtr<Geoposition> createGeoposition(GeolocationPosition* position) > return Geoposition::create(coordinates.release(), convertSecondsToDOMTimeStamp(position->timestamp())); > } > >-static PassRefPtr<PositionError> createPositionError(GeolocationError* error) >+static Ref<PositionError> createPositionError(GeolocationError* error) > { > PositionError::ErrorCode code = PositionError::POSITION_UNAVAILABLE; > switch (error->code()) { >@@ -75,14 +75,13 @@ static PassRefPtr<PositionError> createPositionError(GeolocationError* error) > return PositionError::create(code, error->message()); > } > >-bool Geolocation::Watchers::add(int id, PassRefPtr<GeoNotifier> prpNotifier) >+bool Geolocation::Watchers::add(int id, RefPtr<GeoNotifier>&& notifier) > { > ASSERT(id > 0); >- RefPtr<GeoNotifier> notifier = prpNotifier; > > if (!m_idToNotifierMap.add(id, notifier.get()).isNewEntry) > return false; >- m_notifierToIdMap.set(notifier.release(), id); >+ m_notifierToIdMap.set(WTF::move(notifier), id); > return true; > } > >@@ -304,34 +303,34 @@ Geoposition* Geolocation::lastPosition() > return m_lastPosition.get(); > } > >-void Geolocation::getCurrentPosition(PassRefPtr<PositionCallback> successCallback, PassRefPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options) >+void Geolocation::getCurrentPosition(RefPtr<PositionCallback>&& successCallback, RefPtr<PositionErrorCallback>&& errorCallback, RefPtr<PositionOptions>&& options) > { > if (!frame()) > return; > >- RefPtr<GeoNotifier> notifier = GeoNotifier::create(*this, successCallback, errorCallback, options); >+ RefPtr<GeoNotifier> notifier = GeoNotifier::create(*this, WTF::move(successCallback), WTF::move(errorCallback), WTF::move(options)); > startRequest(notifier.get()); > > m_oneShots.add(notifier); > } > >-int Geolocation::watchPosition(PassRefPtr<PositionCallback> successCallback, PassRefPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options) >+int Geolocation::watchPosition(RefPtr<PositionCallback>&& successCallback, RefPtr<PositionErrorCallback>&& errorCallback, RefPtr<PositionOptions>&& options) > { > if (!frame()) > return 0; > >- RefPtr<GeoNotifier> notifier = GeoNotifier::create(*this, successCallback, errorCallback, options); >+ RefPtr<GeoNotifier> notifier = GeoNotifier::create(*this, WTF::move(successCallback), WTF::move(errorCallback), WTF::move(options)); > startRequest(notifier.get()); > > int watchID; > // Keep asking for the next id until we're given one that we don't already have. > do { > watchID = m_scriptExecutionContext->circularSequentialID(); >- } while (!m_watchers.add(watchID, notifier)); >+ } while (!m_watchers.add(watchID, WTF::move(notifier))); > return watchID; > } > >-void Geolocation::startRequest(GeoNotifier *notifier) >+void Geolocation::startRequest(GeoNotifier* notifier) > { > // Check whether permissions have already been denied. Note that if this is the case, > // the permission state can not change again in the lifetime of this page. >diff --git a/Source/WebCore/Modules/geolocation/Geolocation.h b/Source/WebCore/Modules/geolocation/Geolocation.h >index 87d42653ab6ca7639dd7a5414a951c4a7fa3e4b8..e5feec52e79240960fb67d7feef9157d60b425ee 100644 >--- a/Source/WebCore/Modules/geolocation/Geolocation.h >+++ b/Source/WebCore/Modules/geolocation/Geolocation.h >@@ -61,8 +61,8 @@ public: > Document* document() const; > WEBCORE_EXPORT Frame* frame() const; > >- void getCurrentPosition(PassRefPtr<PositionCallback>, PassRefPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>); >- int watchPosition(PassRefPtr<PositionCallback>, PassRefPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>); >+ void getCurrentPosition(RefPtr<PositionCallback>&&, RefPtr<PositionErrorCallback>&&, RefPtr<PositionOptions>&&); >+ int watchPosition(RefPtr<PositionCallback>&&, RefPtr<PositionErrorCallback>&&, RefPtr<PositionOptions>&&); > void clearWatch(int watchID); > > WEBCORE_EXPORT void setIsAllowed(bool); >@@ -93,7 +93,7 @@ private: > > class Watchers { > public: >- bool add(int id, PassRefPtr<GeoNotifier>); >+ bool add(int id, RefPtr<GeoNotifier>&&); > GeoNotifier* find(int id); > void remove(int id); > void remove(GeoNotifier*); >diff --git a/Source/WebCore/Modules/geolocation/GeolocationError.h b/Source/WebCore/Modules/geolocation/GeolocationError.h >index 0554e87b67f95ae6d6a70081183596892d14b004..ebb7aa73d4259359aaf0002388c16db4beff5384 100644 >--- a/Source/WebCore/Modules/geolocation/GeolocationError.h >+++ b/Source/WebCore/Modules/geolocation/GeolocationError.h >@@ -26,7 +26,6 @@ > #ifndef GeolocationError_h > #define GeolocationError_h > >-#include <wtf/PassRefPtr.h> > #include <wtf/RefCounted.h> > #include <wtf/RefPtr.h> > #include <wtf/text/WTFString.h> >diff --git a/Source/WebCore/Modules/geolocation/GeolocationPosition.h b/Source/WebCore/Modules/geolocation/GeolocationPosition.h >index 8d1e930701a2807224465c525abffe36692cd260..dbdd735b93ae6b7ac3367e2ce02a5426082f9d60 100644 >--- a/Source/WebCore/Modules/geolocation/GeolocationPosition.h >+++ b/Source/WebCore/Modules/geolocation/GeolocationPosition.h >@@ -26,7 +26,6 @@ > #ifndef GeolocationPosition_h > #define GeolocationPosition_h > >-#include <wtf/PassRefPtr.h> > #include <wtf/RefCounted.h> > #include <wtf/RefPtr.h> > >diff --git a/Source/WebCore/Modules/geolocation/Geoposition.h b/Source/WebCore/Modules/geolocation/Geoposition.h >index 78dc36a5e190fdb39c6775a7b420cd0577772428..78183bba347fe85254fca1e3699fb0bd0af5e5c3 100644 >--- a/Source/WebCore/Modules/geolocation/Geoposition.h >+++ b/Source/WebCore/Modules/geolocation/Geoposition.h >@@ -35,12 +35,12 @@ namespace WebCore { > > class Geoposition : public RefCounted<Geoposition> { > public: >- static Ref<Geoposition> create(PassRefPtr<Coordinates> coordinates, DOMTimeStamp timestamp) >+ static Ref<Geoposition> create(RefPtr<Coordinates>&& coordinates, DOMTimeStamp timestamp) > { >- return adoptRef(*new Geoposition(coordinates, timestamp)); >+ return adoptRef(*new Geoposition(WTF::move(coordinates), timestamp)); > } > >- PassRefPtr<Geoposition> isolatedCopy() const >+ Ref<Geoposition> isolatedCopy() const > { > return Geoposition::create(m_coordinates->isolatedCopy(), m_timestamp); > } >@@ -49,8 +49,8 @@ public: > Coordinates* coords() const { return m_coordinates.get(); } > > private: >- Geoposition(PassRefPtr<Coordinates> coordinates, DOMTimeStamp timestamp) >- : m_coordinates(coordinates) >+ Geoposition(RefPtr<Coordinates>&& coordinates, DOMTimeStamp timestamp) >+ : m_coordinates(WTF::move(coordinates)) > , m_timestamp(timestamp) > { > ASSERT(m_coordinates); >diff --git a/Source/WebCore/Modules/geolocation/PositionError.h b/Source/WebCore/Modules/geolocation/PositionError.h >index 138df96b076ed3b6f0df7be14667d619f5cf9507..81c25b7c409c6d12c718e803c226f12dc1acdc3a 100644 >--- a/Source/WebCore/Modules/geolocation/PositionError.h >+++ b/Source/WebCore/Modules/geolocation/PositionError.h >@@ -26,7 +26,6 @@ > #ifndef PositionError_h > #define PositionError_h > >-#include <wtf/PassRefPtr.h> > #include <wtf/RefCounted.h> > #include <wtf/text/WTFString.h> > >diff --git a/Source/WebCore/Modules/geolocation/PositionOptions.h b/Source/WebCore/Modules/geolocation/PositionOptions.h >index e4559217f250d22c95f720138bcc0a0eaf459bca..05dabe19feebaa9fae98e3364fd6db3a49aec41d 100644 >--- a/Source/WebCore/Modules/geolocation/PositionOptions.h >+++ b/Source/WebCore/Modules/geolocation/PositionOptions.h >@@ -26,7 +26,6 @@ > #ifndef PositionOptions_h > #define PositionOptions_h > >-#include <wtf/PassRefPtr.h> > #include <wtf/RefCounted.h> > > namespace WebCore {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 149552
:
261917
|
262229