imported patch bug1238801.patch
authorJinank Jain <jinank94@gmail.com>
Sun, 26 Jun 2016 11:43:07 -0400
changeset 791827 04b1e7fbf58fba32c5b77dc701b31ba6a6cd2b02
parent 786195 c9edfe35619f69f7785776ebd19a3140684024dc
child 791828 e449fd25ff5873e85bf6df3ffaaec87d815edea8
push id132135
push userjinank94@gmail.com
push dateSat, 02 Jul 2016 14:32:39 +0000
treeherdertry@04b1e7fbf58f [default view] [failures only]
bugs1238801
milestone50.0a1
imported patch bug1238801.patch
dom/geolocation/nsGeolocation.cpp
dom/webidl/Geolocation.webidl
--- a/dom/geolocation/nsGeolocation.cpp
+++ b/dom/geolocation/nsGeolocation.cpp
@@ -562,28 +562,20 @@ nsGeolocationRequest::GetRequester(nsICo
   return NS_OK;
 }
 
 void
 nsGeolocationRequest::SetTimeoutTimer()
 {
   StopTimeoutTimer();
 
-  int32_t timeout;
-  if (mOptions && (timeout = mOptions->mTimeout) != 0) {
-
-    if (timeout < 0) {
-      timeout = 0;
-    } else if (timeout < 10) {
-      timeout = 10;
-    }
-
+  if (mOptions && mOptions->mTimeout != 0 && mOptions->mTimeout != 0x7fffffff) {
     mTimeoutTimer = do_CreateInstance("@mozilla.org/timer;1");
     RefPtr<TimerCallbackHolder> holder = new TimerCallbackHolder(this);
-    mTimeoutTimer->InitWithCallback(holder, timeout, nsITimer::TYPE_ONE_SHOT);
+    mTimeoutTimer->InitWithCallback(holder, mOptions->mTimeout, nsITimer::TYPE_ONE_SHOT);
   }
 }
 
 void
 nsGeolocationRequest::StopTimeoutTimer()
 {
   if (mTimeoutTimer) {
     mTimeoutTimer->Cancel();
--- a/dom/webidl/Geolocation.webidl
+++ b/dom/webidl/Geolocation.webidl
@@ -7,18 +7,18 @@
  * http://www.w3.org/TR/geolocation-API
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 dictionary PositionOptions {
   boolean enableHighAccuracy = false;
-  long timeout = 0x7fffffff;
-  long maximumAge = 0;
+  [Clamp] unsigned long timeout = 0x7fffffff;
+  [Clamp] unsigned long maximumAge = 0;
 };
 
 [NoInterfaceObject]
 interface Geolocation {
   [Throws]
   void getCurrentPosition(PositionCallback successCallback,
                           optional PositionErrorCallback? errorCallback = null,
                           optional PositionOptions options);