Cherry-pick security fix in WebKit change 65329

See http://trac.webkit.org/changeset/65329

Bug: 2986936
Change-Id: I664cc00bba4cdd68cc5e23d2566279de614f5f64
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp
index a885062..eddbc36 100644
--- a/WebCore/page/Geolocation.cpp
+++ b/WebCore/page/Geolocation.cpp
@@ -271,6 +271,9 @@
 
 void Geolocation::getCurrentPosition(PassRefPtr<PositionCallback> successCallback, PassRefPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options)
 {
+    if (!m_frame)
+        return;
+
     RefPtr<GeoNotifier> notifier = startRequest(successCallback, errorCallback, options);
     ASSERT(notifier);
 
@@ -279,6 +282,9 @@
 
 int Geolocation::watchPosition(PassRefPtr<PositionCallback> successCallback, PassRefPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options)
 {
+    if (!m_frame)
+        return 0;
+
     RefPtr<GeoNotifier> notifier = startRequest(successCallback, errorCallback, options);
     ASSERT(notifier);