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

Unified Diff: dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/dartium/HtmlScriptManager.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/HtmlScriptManager.java
===================================================================
--- dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/dartium/HtmlScriptManager.java (revision 38051)
+++ dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/dartium/HtmlScriptManager.java (working copy)
@@ -24,6 +24,10 @@
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;
@@ -32,6 +36,29 @@
* connection.
*/
public class HtmlScriptManager implements ResourceChangeParticipant {
+
+ private class UpdateHtmlFileJob extends Job {
+
+ IFile file;
+
+ public UpdateHtmlFileJob(IFile file) {
+ super("Updating file");
+ this.file = file;
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ String fileUrl = target.getResourceResolver().getUrlForResource(file);
+
+ if (fileUrl != null && fileUrl.equals(rootNode.getDocumentURL())) {
+ uploadNewSource(rootNode, file);
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ }
+
private DartiumDebugTarget target;
private WebkitNode rootNode;
@@ -58,11 +85,8 @@
@Override
public final void handleFileChanged(IFile file) {
if ("html".equals(file.getFileExtension())) {
- String fileUrl = target.getResourceResolver().getUrlForResource(file);
-
- if (fileUrl != null && fileUrl.equals(rootNode.getDocumentURL())) {
- uploadNewSource(rootNode, file);
- }
+ UpdateHtmlFileJob job = new UpdateHtmlFileJob(file);
+ job.schedule();
}
}

Powered by Google App Engine
This is Rietveld 408576698