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

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

Issue 297143003: Set default values for timeout and maximumAge of PositionOptions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Change <limits> to <limits.h> Created 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All Rights Reserved.
3 * Copyright 2010, The Android Open Source Project 3 * Copyright 2010, The Android Open Source Project
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 bool useCachedPosition() const { return m_useCachedPosition; } 111 bool useCachedPosition() const { return m_useCachedPosition; }
112 112
113 // Tells the notifier to use a cached position and starts its timer with 113 // Tells the notifier to use a cached position and starts its timer with
114 // an interval of 0. 114 // an interval of 0.
115 void setUseCachedPosition(); 115 void setUseCachedPosition();
116 116
117 void runSuccessCallback(Geoposition*); 117 void runSuccessCallback(Geoposition*);
118 void runErrorCallback(PositionError*); 118 void runErrorCallback(PositionError*);
119 119
120 // Starts the timer if a timeout was specified on the options. 120 void startTimer();
121 void startTimerIfNeeded();
122
123 void stopTimer(); 121 void stopTimer();
124 122
125 // Runs the error callback if there is a fatal error. Otherwise, if a 123 // Runs the error callback if there is a fatal error. Otherwise, if a
126 // cached position must be used, registers itself for receiving one. 124 // cached position must be used, registers itself for receiving one.
127 // Otherwise, the notifier has expired, and its error callback is run. 125 // Otherwise, the notifier has expired, and its error callback is run.
128 void timerFired(Timer<GeoNotifier>*); 126 void timerFired(Timer<GeoNotifier>*);
129 127
130 bool hasZeroTimeout() const;
131
132 private: 128 private:
133 GeoNotifier(Geolocation*, PassOwnPtr<PositionCallback>, PassOwnPtr<Posit ionErrorCallback>, PassRefPtrWillBeRawPtr<PositionOptions>); 129 GeoNotifier(Geolocation*, PassOwnPtr<PositionCallback>, PassOwnPtr<Posit ionErrorCallback>, PassRefPtrWillBeRawPtr<PositionOptions>);
134 130
135 RefPtrWillBeMember<Geolocation> m_geolocation; 131 RefPtrWillBeMember<Geolocation> m_geolocation;
136 OwnPtr<PositionCallback> m_successCallback; 132 OwnPtr<PositionCallback> m_successCallback;
137 OwnPtr<PositionErrorCallback> m_errorCallback; 133 OwnPtr<PositionErrorCallback> m_errorCallback;
138 RefPtrWillBeMember<PositionOptions> m_options; 134 RefPtrWillBeMember<PositionOptions> m_options;
139 Timer<GeoNotifier> m_timer; 135 Timer<GeoNotifier> m_timer;
140 RefPtrWillBeMember<PositionError> m_fatalError; 136 RefPtrWillBeMember<PositionError> m_fatalError;
141 bool m_useCachedPosition; 137 bool m_useCachedPosition;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 Yes, 238 Yes,
243 No 239 No
244 } m_allowGeolocation; 240 } m_allowGeolocation;
245 241
246 GeoNotifierSet m_requestsAwaitingCachedPosition; 242 GeoNotifierSet m_requestsAwaitingCachedPosition;
247 }; 243 };
248 244
249 } // namespace WebCore 245 } // namespace WebCore
250 246
251 #endif // Geolocation_h 247 #endif // Geolocation_h
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8GeolocationCustom.cpp ('k') | Source/modules/geolocation/Geolocation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698