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

Side by Side Diff: Source/modules/geolocation/GeolocationController.h

Issue 255983003: Oilpan: Move all supplements of Page, Document, and WorkerClients to the managed heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: using namespace WebCore Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 24 matching lines...) Expand all
35 #include "wtf/RefPtr.h" 35 #include "wtf/RefPtr.h"
36 36
37 namespace WebCore { 37 namespace WebCore {
38 38
39 class GeolocationInspectorAgent; 39 class GeolocationInspectorAgent;
40 class GeolocationClient; 40 class GeolocationClient;
41 class GeolocationError; 41 class GeolocationError;
42 class GeolocationPosition; 42 class GeolocationPosition;
43 class Page; 43 class Page;
44 44
45 class GeolocationController FINAL : public Supplement<Page>, public PageLifecycl eObserver { 45 class GeolocationController FINAL : public NoBaseWillBeGarbageCollectedFinalized <GeolocationController>, public WillBeHeapSupplement<Page>, public PageLifecycle Observer {
46 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(GeolocationController);
46 WTF_MAKE_NONCOPYABLE(GeolocationController); 47 WTF_MAKE_NONCOPYABLE(GeolocationController);
47 public: 48 public:
48 virtual ~GeolocationController(); 49 virtual ~GeolocationController();
49 50
50 static PassOwnPtr<GeolocationController> create(Page&, GeolocationClient*); 51 static PassOwnPtrWillBeRawPtr<GeolocationController> create(Page&, Geolocati onClient*);
51 52
52 void addObserver(Geolocation*, bool enableHighAccuracy); 53 void addObserver(Geolocation*, bool enableHighAccuracy);
53 void removeObserver(Geolocation*); 54 void removeObserver(Geolocation*);
54 55
55 void requestPermission(Geolocation*); 56 void requestPermission(Geolocation*);
56 void cancelPermissionRequest(Geolocation*); 57 void cancelPermissionRequest(Geolocation*);
57 58
58 void positionChanged(GeolocationPosition*); 59 void positionChanged(GeolocationPosition*);
59 void errorOccurred(GeolocationError*); 60 void errorOccurred(GeolocationError*);
60 61
61 GeolocationPosition* lastPosition(); 62 GeolocationPosition* lastPosition();
62 63
63 void setClientForTest(GeolocationClient*); 64 void setClientForTest(GeolocationClient*);
64 bool hasClientForTest() { return m_hasClientForTest; } 65 bool hasClientForTest() { return m_hasClientForTest; }
65 GeolocationClient* client() { return m_client; } 66 GeolocationClient* client() { return m_client; }
66 67
67 // Inherited from PageLifecycleObserver. 68 // Inherited from PageLifecycleObserver.
68 virtual void pageVisibilityChanged() OVERRIDE; 69 virtual void pageVisibilityChanged() OVERRIDE;
69 70
70 static const char* supplementName(); 71 static const char* supplementName();
71 static GeolocationController* from(Page* page) { return static_cast<Geolocat ionController*>(Supplement<Page>::from(page, supplementName())); } 72 static GeolocationController* from(Page* page) { return static_cast<Geolocat ionController*>(WillBeHeapSupplement<Page>::from(page, supplementName())); }
72 73
73 virtual void trace(Visitor*) OVERRIDE { }; 74 virtual void trace(Visitor*) OVERRIDE;
74 75
75 virtual void willBeDestroyed() OVERRIDE; 76 virtual void willBeDestroyed() OVERRIDE;
76 77
77 private: 78 private:
78 GeolocationController(Page&, GeolocationClient*); 79 GeolocationController(Page&, GeolocationClient*);
79 80
80 void startUpdatingIfNeeded(); 81 void startUpdatingIfNeeded();
81 void stopUpdatingIfNeeded(); 82 void stopUpdatingIfNeeded();
82 83
83 GeolocationClient* m_client; 84 GeolocationClient* m_client;
84 bool m_hasClientForTest; 85 bool m_hasClientForTest;
85 86
86 RefPtrWillBePersistent<GeolocationPosition> m_lastPosition; 87 RefPtrWillBeMember<GeolocationPosition> m_lastPosition;
87 typedef WillBePersistentHeapHashSet<RefPtrWillBeMember<Geolocation> > Observ ersSet; 88 typedef WillBeHeapHashSet<RefPtrWillBeMember<Geolocation> > ObserversSet;
88 // All observers; both those requesting high accuracy and those not. 89 // All observers; both those requesting high accuracy and those not.
89 ObserversSet m_observers; 90 ObserversSet m_observers;
90 ObserversSet m_highAccuracyObservers; 91 ObserversSet m_highAccuracyObservers;
91 bool m_isClientUpdating; 92 bool m_isClientUpdating;
92 GeolocationInspectorAgent* m_inspectorAgent; 93 GeolocationInspectorAgent* m_inspectorAgent;
93 }; 94 };
94 95
95 } // namespace WebCore 96 } // namespace WebCore
96 97
97 #endif // GeolocationController_h 98 #endif // GeolocationController_h
OLDNEW
« no previous file with comments | « Source/modules/filesystem/LocalFileSystem.cpp ('k') | Source/modules/geolocation/GeolocationController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698