Hello nicolasroard,

I'd like you to do a code review.  Please execute
        g4 diff -c 10628057

or point your web browser to
        http://mondrian/10628057

to review the following code:

Change 10628057 by andr...@andreip-gearslinux on 2009/03/27 12:32:44 *pending*

        Fix for 1741787
        
        Readding the checks in SetState(). Nicolas was right to add
        them in the first place, I was wrong to think they are
        superfluous.
        
        PRESUBMIT=passed
        BUG=1741787
        R=nicolasroard
        [email protected]
        DELTA=16  (15 added, 0 deleted, 1 changed)
        OCL=10628057

Affected files ...

... 
//depot/googleclient/gears/opensource/gears/localserver/android/http_request_android.cc#15
 edit

16 delta lines: 15 added, 0 deleted, 1 changed

The issue description(s) relevant to this code can be found at:
        http://b/issue?id=1741787

Also consider running:
        g4 lint -c 10628057

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 10628057 by andr...@andreip-gearslinux on 2009/03/27 12:32:44 *pending*

        Fix for 1741787
        
        Readding the checks in SetState(). Nicolas was right to add
        them in the first place, I was wrong to think they are
        superfluous.

Affected files ...

... 
//depot/googleclient/gears/opensource/gears/localserver/android/http_request_android.cc#15
 edit

==== 
//depot/googleclient/gears/opensource/gears/localserver/android/http_request_android.cc#15
 - 
/home/andreip/Gears/googleclient/gears/opensource/gears/localserver/android/http_request_android.cc
 ====
# action=edit type=text
--- 
googleclient/gears/opensource/gears/localserver/android/http_request_android.cc 
    2009-03-27 12:33:18.000000000 +0000
+++ 
googleclient/gears/opensource/gears/localserver/android/http_request_android.cc 
    2009-03-27 12:28:31.000000000 +0000
@@ -614,7 +614,22 @@
         (state != STATE_MAIN_IDLE)) {
       return false;
     }
-  }
+
+    // The state can be idle if the abort comes
+    // after we already processed MAIN_COMPLETE.
+    if (state_ == STATE_MAIN_IDLE) {
+      return false;
+    }
+
+    // If we are already in STATE_MAIN_COMPLETE,
+    // we only allow a transition to STATE_MAIN_IDLE
+    if (state_ == STATE_MAIN_COMPLETE) {
+      if (state != STATE_MAIN_IDLE) {
+        return false;
+      }
+    }
+  }
+
   if (state_ == state) {
     return false;
   }

Reply via email to