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

Side by Side Diff: third_party/WebKit/Source/web/WebGeolocationController.cpp

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 19 matching lines...) Expand all
30 #include "modules/geolocation/GeolocationPosition.h" 30 #include "modules/geolocation/GeolocationPosition.h"
31 #include "platform/heap/Handle.h" 31 #include "platform/heap/Handle.h"
32 #include "public/web/WebGeolocationError.h" 32 #include "public/web/WebGeolocationError.h"
33 #include "public/web/WebGeolocationPosition.h" 33 #include "public/web/WebGeolocationPosition.h"
34 #include "wtf/RefCounted.h" 34 #include "wtf/RefCounted.h"
35 35
36 namespace blink { 36 namespace blink {
37 37
38 // TODO(Oilpan): once GeolocationController is always on the heap, 38 // TODO(Oilpan): once GeolocationController is always on the heap,
39 // shorten out this GeolocationControllerPrivate intermediary. 39 // shorten out this GeolocationControllerPrivate intermediary.
40 class GeolocationControllerPrivate final : public RefCountedWillBeGarbageCollect ed<GeolocationControllerPrivate> { 40 class GeolocationControllerPrivate final : public GarbageCollected<GeolocationCo ntrollerPrivate> {
41 public: 41 public:
42 static PassRefPtrWillBeRawPtr<GeolocationControllerPrivate> create(Geolocati onController* controller) 42 static RawPtr<GeolocationControllerPrivate> create(GeolocationController* co ntroller)
43 { 43 {
44 return adoptRefWillBeNoop(new GeolocationControllerPrivate(controller)); 44 return (new GeolocationControllerPrivate(controller));
45 } 45 }
46 46
47 static GeolocationController& controller(const WebPrivatePtr<GeolocationCont rollerPrivate>& controller) 47 static GeolocationController& controller(const WebPrivatePtr<GeolocationCont rollerPrivate>& controller)
48 { 48 {
49 ASSERT(!controller.isNull()); 49 ASSERT(!controller.isNull());
50 ASSERT(controller->m_controller); 50 ASSERT(controller->m_controller);
51 return *controller->m_controller; 51 return *controller->m_controller;
52 } 52 }
53 53
54 DEFINE_INLINE_TRACE() 54 DEFINE_INLINE_TRACE()
55 { 55 {
56 visitor->trace(m_controller); 56 visitor->trace(m_controller);
57 } 57 }
58 58
59 private: 59 private:
60 explicit GeolocationControllerPrivate(GeolocationController* controller) 60 explicit GeolocationControllerPrivate(GeolocationController* controller)
61 : m_controller(controller) 61 : m_controller(controller)
62 { 62 {
63 } 63 }
64 64
65 // Non-Oilpan, this bare pointer is owned as a supplement and kept alive 65 // Non-Oilpan, this bare pointer is owned as a supplement and kept alive
66 // by the frame of the WebLocalFrame which creates the WebGeolocationControl ler 66 // by the frame of the WebLocalFrame which creates the WebGeolocationControl ler
67 // object that wraps it all up. 67 // object that wraps it all up.
68 RawPtrWillBeMember<GeolocationController> m_controller; 68 Member<GeolocationController> m_controller;
69 }; 69 };
70 70
71 WebGeolocationController::WebGeolocationController(GeolocationController* contro ller) 71 WebGeolocationController::WebGeolocationController(GeolocationController* contro ller)
72 : m_private(GeolocationControllerPrivate::create(controller)) 72 : m_private(GeolocationControllerPrivate::create(controller))
73 { 73 {
74 } 74 }
75 75
76 void WebGeolocationController::reset() 76 void WebGeolocationController::reset()
77 { 77 {
78 m_private.reset(); 78 m_private.reset();
79 } 79 }
80 80
81 void WebGeolocationController::positionChanged(const WebGeolocationPosition& web Position) 81 void WebGeolocationController::positionChanged(const WebGeolocationPosition& web Position)
82 { 82 {
83 GeolocationControllerPrivate::controller(m_private).positionChanged(static_c ast<GeolocationPosition*>(webPosition)); 83 GeolocationControllerPrivate::controller(m_private).positionChanged(static_c ast<GeolocationPosition*>(webPosition));
84 } 84 }
85 85
86 void WebGeolocationController::errorOccurred(const WebGeolocationError& webError ) 86 void WebGeolocationController::errorOccurred(const WebGeolocationError& webError )
87 { 87 {
88 GeolocationControllerPrivate::controller(m_private).errorOccurred(static_cas t<GeolocationError*>(webError)); 88 GeolocationControllerPrivate::controller(m_private).errorOccurred(static_cas t<GeolocationError*>(webError));
89 } 89 }
90 90
91 } // namespace blink 91 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698