Hello andreip,
I'd like you to do a code review. Please execute
g4 diff -c 8461425
or point your web browser to
http://mondrian/8461425
to review the following code:
Change 8461425 by [EMAIL PROTECTED] on 2008/10/02 12:15:35 *pending*
Fix for crashing bug 1408088 in Geolocation arbitrator.
BUG=1408088
R=andreip
[EMAIL PROTECTED]
DELTA=13 (13 added, 0 deleted, 0 changed)
OCL=8461425
Affected files ...
... //depot/googleclient/gears/opensource/gears/geolocation/geolocation.cc#52
edit
13 delta lines: 13 added, 0 deleted, 0 changed
The issue description(s) relevant to this code can be found at:
http://b/issue?id=1408088
or if you are using the old Bugs DB, at:
http://bugs.corp.google.com/show_bug.cgi?id=1408088
Also consider running:
g4 lint -c 8461425
which verifies that the changelist doesn't introduce new style violations.
If you can't do the review, please let me know as soon as possible. During
your review, please ensure that all new code has corresponding unit tests and
that existing unit tests are updated appropriately. Visit
http://www/eng/code_review.html for more information.
This is a semiautomated message from "g4 mail". Complaints or suggestions?
Mail [EMAIL PROTECTED]
Change 8461425 by [EMAIL PROTECTED] on 2008/10/02 12:15:35 *pending*
Fix for crashing bug 1408088 in Geolocation arbitrator.
Affected files ...
... //depot/googleclient/gears/opensource/gears/geolocation/geolocation.cc#52
edit
==== //depot/googleclient/gears/opensource/gears/geolocation/geolocation.cc#52
-
c:\MyDocs\Gears1/googleclient/gears/opensource/gears/geolocation/geolocation.cc
====
# action=edit type=text
--- googleclient/gears/opensource/gears/geolocation/geolocation.cc
2008-09-26 19:39:33.000000000 +0100
+++ googleclient/gears/opensource/gears/geolocation/geolocation.cc
2008-10-02 12:25:00.000000000 +0100
@@ -650,6 +650,12 @@
last_position_ = position;
}
+ // Whenever a fix request makes its last callback, we unref this object. This
+ // means that once the last fix request has made its last callback, we risk
+ // this object being deleted before this method completes. We therefore ref
+ // and unref this object around the callback and unref calls.
+ Ref();
+
// The HandleXXXRequestUpdate methods called below may make a callback to
// JavaScript. A callback may ...
// - call back into Gears code and remove a repeating fix request.
@@ -675,6 +681,11 @@
}
}
+#ifdef DEBUG
+ // Force garbage collection to guard against regression. See comment above.
+ GetJsRunner()->ForceGC();
+#endif
+
// Iterate over all repeating fix requests.
IdList watch_ids;
for (FixRequestInfoMap::const_iterator iter = fix_requests_.begin();
@@ -693,6 +704,8 @@
HandleRepeatingRequestUpdate(watch_id, position);
}
}
+
+ Unref();
}
bool GearsGeolocation::MakeSuccessCallback(FixRequestInfo *fix_info,