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

Unified Diff: Source/modules/geolocation/PositionOptions.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, 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/geolocation/Geolocation.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/geolocation/PositionOptions.h
diff --git a/Source/modules/geolocation/PositionOptions.h b/Source/modules/geolocation/PositionOptions.h
index 6885ff8c12d3931e981dcab61529754ffb8e6df9..dca924c8aa7e2799a17302eb241bc14860aa0ab6 100644
--- a/Source/modules/geolocation/PositionOptions.h
+++ b/Source/modules/geolocation/PositionOptions.h
@@ -28,6 +28,7 @@
#include "platform/heap/Handle.h"
#include "wtf/RefCounted.h"
+#include <limits.h>
namespace WebCore {
@@ -38,43 +39,36 @@ public:
bool enableHighAccuracy() const { return m_highAccuracy; }
void setEnableHighAccuracy(bool enable) { m_highAccuracy = enable; }
- bool hasTimeout() const { return m_hasTimeout; }
unsigned timeout() const
{
- ASSERT(hasTimeout());
return m_timeout;
}
void setTimeout(unsigned timeout)
{
- m_hasTimeout = true;
m_timeout = timeout;
}
- bool hasMaximumAge() const { return m_hasMaximumAge; }
unsigned maximumAge() const
{
- ASSERT(hasMaximumAge());
return m_maximumAge;
}
- void clearMaximumAge() { m_hasMaximumAge = false; }
void setMaximumAge(unsigned age)
{
- m_hasMaximumAge = true;
m_maximumAge = age;
}
private:
PositionOptions()
: m_highAccuracy(false)
- , m_hasTimeout(false)
+ , m_maximumAge(0)
+ , m_timeout(std::numeric_limits<unsigned>::max())
+
{
setMaximumAge(0);
}
bool m_highAccuracy;
- bool m_hasTimeout;
- unsigned m_timeout;
- bool m_hasMaximumAge;
- unsigned m_maximumAge;
+ int m_maximumAge;
+ int m_timeout;
};
} // namespace WebCore
« no previous file with comments | « Source/modules/geolocation/Geolocation.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698