| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.Object} | 7 * @extends {WebInspector.Object} |
| 8 * @param {!WebInspector.Workspace} workspace | 8 * @param {!WebInspector.Workspace} workspace |
| 9 * @param {!WebInspector.BreakpointManager} breakpointManager | 9 * @param {!WebInspector.BreakpointManager} breakpointManager |
| 10 * @param {!WebInspector.FileSystemMapping} fileSystemMapping | 10 * @param {!WebInspector.FileSystemMapping} fileSystemMapping |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 * @param {!WebInspector.Event} event | 77 * @param {!WebInspector.Event} event |
| 78 */ | 78 */ |
| 79 _onWorkingCopyCommitted: function(event) | 79 _onWorkingCopyCommitted: function(event) |
| 80 { | 80 { |
| 81 var uiSourceCode = /** @type {!WebInspector.UISourceCode} */(event.targe
t); | 81 var uiSourceCode = /** @type {!WebInspector.UISourceCode} */(event.targe
t); |
| 82 var binding = uiSourceCode[WebInspector.Persistence._binding]; | 82 var binding = uiSourceCode[WebInspector.Persistence._binding]; |
| 83 if (!binding || binding[WebInspector.Persistence._muteCommit]) | 83 if (!binding || binding[WebInspector.Persistence._muteCommit]) |
| 84 return; | 84 return; |
| 85 var newContent = /** @type {string} */(event.data.content); | 85 var newContent = /** @type {string} */(event.data.content); |
| 86 var other = binding.network === uiSourceCode ? binding.fileSystem : bind
ing.network; | 86 var other = binding.network === uiSourceCode ? binding.fileSystem : bind
ing.network; |
| 87 if (Runtime.queryParam("v8only")) { | 87 var target = WebInspector.NetworkProject.targetForUISourceCode(binding.n
etwork); |
| 88 if (target.isNodeJS()) { |
| 88 other.requestContent().then(currentContent => this._syncNodeJSConten
t(binding, other, currentContent, newContent)); | 89 other.requestContent().then(currentContent => this._syncNodeJSConten
t(binding, other, currentContent, newContent)); |
| 89 return; | 90 return; |
| 90 } | 91 } |
| 91 binding[WebInspector.Persistence._muteCommit] = true; | 92 binding[WebInspector.Persistence._muteCommit] = true; |
| 92 other.addRevision(newContent); | 93 other.addRevision(newContent); |
| 93 binding[WebInspector.Persistence._muteCommit] = false; | 94 binding[WebInspector.Persistence._muteCommit] = false; |
| 94 this._contentSyncedForTest(); | 95 this._contentSyncedForTest(); |
| 95 }, | 96 }, |
| 96 | 97 |
| 97 /** | 98 /** |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 * @param {!WebInspector.UISourceCode} fileSystem | 236 * @param {!WebInspector.UISourceCode} fileSystem |
| 236 */ | 237 */ |
| 237 WebInspector.PersistenceBinding = function(network, fileSystem) | 238 WebInspector.PersistenceBinding = function(network, fileSystem) |
| 238 { | 239 { |
| 239 this.network = network; | 240 this.network = network; |
| 240 this.fileSystem = fileSystem; | 241 this.fileSystem = fileSystem; |
| 241 } | 242 } |
| 242 | 243 |
| 243 /** @type {!WebInspector.Persistence} */ | 244 /** @type {!WebInspector.Persistence} */ |
| 244 WebInspector.persistence; | 245 WebInspector.persistence; |
| OLD | NEW |