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

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

Issue 1638573002: Have WebGeolocationController always wrap up its private controller object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebGeolocationController.cpp
diff --git a/third_party/WebKit/Source/web/WebGeolocationController.cpp b/third_party/WebKit/Source/web/WebGeolocationController.cpp
index 2d2a966db0b99ac41a73bf31f4c728337ac9f715..c39a4d3d8646ddb0c31f35d7857ca24560f10a38 100644
--- a/third_party/WebKit/Source/web/WebGeolocationController.cpp
+++ b/third_party/WebKit/Source/web/WebGeolocationController.cpp
@@ -35,23 +35,13 @@
namespace blink {
-#if ENABLE(OILPAN)
// TODO(Oilpan): once GeolocationController is always on the heap,
// shorten out this GeolocationControllerPrivate intermediary.
-class GeolocationControllerPrivate : public GeolocationController {
+class GeolocationControllerPrivate final : public RefCountedWillBeGarbageCollected<GeolocationControllerPrivate> {
public:
- static GeolocationController& controller(const WebPrivatePtr<GeolocationControllerPrivate>& controller)
+ static PassRefPtrWillBeRawPtr<GeolocationControllerPrivate> create(GeolocationController* controller)
{
- ASSERT(!controller.isNull());
- return *controller;
- }
-};
-#else
-class GeolocationControllerPrivate final : public RefCounted<GeolocationControllerPrivate> {
-public:
- static PassRefPtr<GeolocationControllerPrivate> create(GeolocationController* controller)
- {
- return adoptRef(new GeolocationControllerPrivate(controller));
+ return adoptRefWillBeNoop(new GeolocationControllerPrivate(controller));
}
static GeolocationController& controller(const WebPrivatePtr<GeolocationControllerPrivate>& controller)
@@ -61,6 +51,11 @@ public:
return *controller->m_controller;
}
+ DEFINE_INLINE_TRACE()
+ {
+ visitor->trace(m_controller);
+ }
+
private:
explicit GeolocationControllerPrivate(GeolocationController* controller)
: m_controller(controller)
@@ -70,16 +65,11 @@ private:
// Non-Oilpan, this bare pointer is owned as a supplement and kept alive
// by the frame of the WebLocalFrame which creates the WebGeolocationController
// object that wraps it all up.
- GeolocationController* m_controller;
+ RawPtrWillBeMember<GeolocationController> m_controller;
};
-#endif
WebGeolocationController::WebGeolocationController(GeolocationController* controller)
-#if ENABLE(OILPAN)
- : m_private(static_cast<GeolocationControllerPrivate*>(controller))
-#else
: m_private(GeolocationControllerPrivate::create(controller))
-#endif
{
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698