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

Unified Diff: Source/bindings/v8/custom/V8GeolocationCustom.cpp

Issue 297143003: Set default values for timeout and maximumAge of PositionOptions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 | « no previous file | Source/modules/geolocation/Geolocation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8GeolocationCustom.cpp
diff --git a/Source/bindings/v8/custom/V8GeolocationCustom.cpp b/Source/bindings/v8/custom/V8GeolocationCustom.cpp
index 213fab7ee502c910f022a8721af11e1af59734f1..b4f5c596cd8a80df55c3a8c5422a7a73073c2872 100644
--- a/Source/bindings/v8/custom/V8GeolocationCustom.cpp
+++ b/Source/bindings/v8/custom/V8GeolocationCustom.cpp
@@ -105,15 +105,11 @@ static PassRefPtrWillBeRawPtr<PositionOptions> createPositionOptions(v8::Local<v
return nullptr;
}
double maximumAgeDouble = maximumAgeNumber->Value();
- if (std::isinf(maximumAgeDouble) && maximumAgeDouble > 0) {
- // If the value is positive infinity, clear maximumAge.
- options->clearMaximumAge();
+ if ((std::isinf(maximumAgeDouble) && maximumAgeDouble > 0) || maximumAgeDouble <= 0) {
+ // If the value is positive infinity or negative
Nils Barth (inactive) 2014/05/26 01:20:43 ??? If the value of maximumAge is set to positive
kihong 2014/05/26 04:23:43 You are right. I will change this with next patch.
+ options->setMaximumAge(0);
} else {
- if (maximumAgeDouble <= 0) {
- options->setMaximumAge(0);
- } else {
- options->setMaximumAge(toUInt32(maximumAgeValue, Clamp, exceptionState));
- }
+ options->setMaximumAge(toUInt32(maximumAgeValue, Clamp, exceptionState));
}
}
« no previous file with comments | « no previous file | Source/modules/geolocation/Geolocation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698