Disclaimer: I didn't review the test yet.

http://gwt-code-reviews.appspot.com/1386806/diff/1011/user/src/com/google/gwt/activity/Activity.gwt.xml
File user/src/com/google/gwt/activity/Activity.gwt.xml (right):

http://gwt-code-reviews.appspot.com/1386806/diff/1011/user/src/com/google/gwt/activity/Activity.gwt.xml#newcode4
user/src/com/google/gwt/activity/Activity.gwt.xml:4: <inherits
name='javax.inject.Inject'/>
Will fail now that you removed the module.

http://gwt-code-reviews.appspot.com/1386806/diff/1011/user/src/com/google/gwt/activity/client/RunAsyncActivity.java
File user/src/com/google/gwt/activity/client/RunAsyncActivity.java
(right):

http://gwt-code-reviews.appspot.com/1386806/diff/1011/user/src/com/google/gwt/activity/client/RunAsyncActivity.java#newcode57
user/src/com/google/gwt/activity/client/RunAsyncActivity.java:57:
wrapped.start(panel, eventBus);
It still wouldn't handle the case of start/cancel/start.
This is what would happen from an ActivityManager:
  activity.start(panel, new ResettableEventBus(bus));
  activity.onCancel();
  // activity2.start(), or activity2==null
  // activity2.onCancel(), or mayStop+onStop
  activity.start(panel, new ResettableEventBus(bus));

If the runAsync completes between the onCancel and the second start, all
is well, as loaded() will be true. If the runAsync completes after the
second start though, you'll:
 1) get a second instance from the AsyncProvider
 2) start the activity from the first get() and never cancel it
This could be mitigated by an additional 'loading' flag/state, as I
proposed yesterday.
This could happen if, for instance, the RunAsyncActivity is cached
somehow (or a singleton) and either the user changes his mind quickly,
or the network or server lags (and the user then navigates back and
forth until the app becomes "responsive" again; this is something I
happen to do quite regularly on GMail and the new Google Groups!)

http://gwt-code-reviews.appspot.com/1386806/diff/1011/user/src/com/google/gwt/core/client/AsyncProvider.java
File user/src/com/google/gwt/core/client/AsyncProvider.java (right):

http://gwt-code-reviews.appspot.com/1386806/diff/1011/user/src/com/google/gwt/core/client/AsyncProvider.java#newcode26
user/src/com/google/gwt/core/client/AsyncProvider.java:26: * @see
RunAsyncProvider
I can't find any RunAsyncProvider class; did you really mean to edit the
javadoc?
If you wanted to remove the reference to javax.inject.Provider, how
about doing an onSuccess(new Foo()) instead? that would have little to
no added value compared to an AsyncProxy, but it'd still show how to use
AsyncProvider with GWT.runAsync.

http://gwt-code-reviews.appspot.com/1386806/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to