| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.debug.ui.liveedit; | 5 package org.chromium.debug.ui.liveedit; |
| 6 | 6 |
| 7 import java.io.IOException; | 7 import java.io.IOException; |
| 8 import java.io.UnsupportedEncodingException; | 8 import java.io.UnsupportedEncodingException; |
| 9 import java.util.ArrayList; | 9 import java.util.ArrayList; |
| 10 import java.util.List; | 10 import java.util.List; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 /** | 27 /** |
| 28 * Parses LiveEdit push result and produces input for {@link LiveEditDiffViewer}
. | 28 * Parses LiveEdit push result and produces input for {@link LiveEditDiffViewer}
. |
| 29 * It is also responsible for providing user-visible explanations about situatio
n with each | 29 * It is also responsible for providing user-visible explanations about situatio
n with each |
| 30 * function. | 30 * function. |
| 31 */ | 31 */ |
| 32 public class PushResultParser { | 32 public class PushResultParser { |
| 33 static LiveEditDiffViewer.Input createViewerInput( | 33 static LiveEditDiffViewer.Input createViewerInput( |
| 34 final UpdatableScript.ChangeDescription changeDescription, ScriptTargetMap
ping filePair, | 34 final UpdatableScript.ChangeDescription changeDescription, ScriptTargetMap
ping filePair, |
| 35 boolean previewMode) { | 35 boolean previewMode) { |
| 36 Script script = filePair.getScriptHolder().getSingleScript(); | 36 Script script = filePair.getSingleScript(); |
| 37 IFile file = filePair.getFile(); | 37 IFile file = filePair.getFile(); |
| 38 String newSourceTemp; | 38 String newSourceTemp; |
| 39 try { | 39 try { |
| 40 byte[] newSourceBytes = ChromiumDebugPluginUtil.readFileContents(file); | 40 byte[] newSourceBytes = ChromiumDebugPluginUtil.readFileContents(file); |
| 41 newSourceTemp = new String(newSourceBytes, "UTF-8"); //$NON-NLS-1$ | 41 newSourceTemp = new String(newSourceBytes, "UTF-8"); //$NON-NLS-1$ |
| 42 } catch (UnsupportedEncodingException e) { | 42 } catch (UnsupportedEncodingException e) { |
| 43 throw new RuntimeException(e); | 43 throw new RuntimeException(e); |
| 44 } catch (IOException e) { | 44 } catch (IOException e) { |
| 45 newSourceTemp = Messages.PushResultParser_FAILED_SEE_LOG; | 45 newSourceTemp = Messages.PushResultParser_FAILED_SEE_LOG; |
| 46 ChromiumDebugPlugin.log(e); | 46 ChromiumDebugPlugin.log(e); |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 } | 285 } |
| 286 return message; | 286 return message; |
| 287 } | 287 } |
| 288 default: return Messages.PushResultParser_RESULT_UNKNOWN; | 288 default: return Messages.PushResultParser_RESULT_UNKNOWN; |
| 289 } | 289 } |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 }; | 292 }; |
| 293 } | 293 } |
| 294 } | 294 } |
| OLD | NEW |