Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2412)

Unified Diff: editor/tools/plugins/com.google.dart.tools.update.core/src/com/google/dart/tools/update/core/internal/UpdateModel.java

Issue 10660016: Update manager fixes to handle update check failures. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.tools.update.core/src/com/google/dart/tools/update/core/internal/UpdateModel.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.update.core/src/com/google/dart/tools/update/core/internal/UpdateModel.java (revision 9083)
+++ editor/tools/plugins/com.google.dart.tools.update.core/src/com/google/dart/tools/update/core/internal/UpdateModel.java (working copy)
@@ -37,6 +37,12 @@
//no-op
}
},
+ FAILED {
+ @Override
+ public void notify(UpdateListener listener) {
+ listener.checkFailed(errorMessage);
+ }
+ },
CHECKING {
@Override
public void notify(UpdateListener listener) {
@@ -106,6 +112,8 @@
private final CopyOnWriteArrayList<UpdateListener> listeners = new CopyOnWriteArrayList<UpdateListener>();
+ private static String errorMessage;
+
/**
* Add the given update listener.
*
@@ -184,13 +192,21 @@
}
/**
+ * Caches an error message for state notifications.
+ *
+ * @param msg the error message
+ */
+ void setErrorMessage(String msg) {
+ errorMessage = msg;
+ }
+
+ /**
* Caches a revision number for state notifications.
*
* @param revision the latest available revision
*/
- @SuppressWarnings("static-access")
void setLatestAvailableRevision(Revision revision) {
- this.latestRevision = revision;
+ latestRevision = revision;
}
/**

Powered by Google App Engine
This is Rietveld 408576698