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

Unified Diff: dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/dartium/DartCodeManager.java

Issue 371253002: Version 1.5.7 (Closed) Base URL: http://dart.googlecode.com/svn/branches/1.5/
Patch Set: Created 6 years, 5 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: dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/dartium/DartCodeManager.java
===================================================================
--- dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/dartium/DartCodeManager.java (revision 38051)
+++ dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/dartium/DartCodeManager.java (working copy)
@@ -22,8 +22,13 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import java.io.IOException;
+import java.util.Collection;
/**
* Manage known Dart files loaded in the target browser. Listen for resource change events (using
@@ -31,6 +36,34 @@
* send the new contents to the browser using the Webkit inspector protocol.
*/
public class DartCodeManager implements ResourceChangeParticipant {
+
+ private class UpdateDartFileJob extends Job {
+
+ IFile file;
+
+ public UpdateDartFileJob(IFile file) {
+ super("Updating file");
+ this.file = file;
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ String fileUrl = target.getResourceResolver().getUrlForResource(file);
+
+ if (fileUrl != null) {
+ Collection<WebkitScript> scripts = target.getConnection().getDebugger().getAllScripts();
+
+ for (WebkitScript script : scripts) {
+ if (fileUrl.equals(script.getUrl())) {
+ uploadNewSource(script.getScriptId(), file);
+ }
+ }
+ }
+ return Status.OK_STATUS;
+ }
+
+ }
+
private DartiumDebugTarget target;
public DartCodeManager(DartiumDebugTarget target) {
@@ -55,15 +88,8 @@
}
if ("dart".equals(file.getFileExtension())) {
- String fileUrl = target.getResourceResolver().getUrlForResource(file);
-
- if (fileUrl != null) {
- for (WebkitScript script : target.getConnection().getDebugger().getAllScripts()) {
- if (fileUrl.equals(script.getUrl())) {
- uploadNewSource(script.getScriptId(), file);
- }
- }
- }
+ UpdateDartFileJob job = new UpdateDartFileJob(file);
+ job.schedule();
}
}

Powered by Google App Engine
This is Rietveld 408576698