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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/persistence/Persistence.js

Issue 2578823002: DevTools: [Persistence] sync resetting of working copy (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 Persistence.Persistence = class extends Common.Object { 7 Persistence.Persistence = class extends Common.Object {
8 /** 8 /**
9 * @param {!Workspace.Workspace} workspace 9 * @param {!Workspace.Workspace} workspace
10 * @param {!Bindings.BreakpointManager} breakpointManager 10 * @param {!Bindings.BreakpointManager} breakpointManager
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 /** 129 /**
130 * @param {!Common.Event} event 130 * @param {!Common.Event} event
131 */ 131 */
132 _onWorkingCopyChanged(event) { 132 _onWorkingCopyChanged(event) {
133 var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); 133 var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data);
134 var binding = uiSourceCode[Persistence.Persistence._binding]; 134 var binding = uiSourceCode[Persistence.Persistence._binding];
135 if (!binding || binding[Persistence.Persistence._muteWorkingCopy]) 135 if (!binding || binding[Persistence.Persistence._muteWorkingCopy])
136 return; 136 return;
137 var other = binding.network === uiSourceCode ? binding.fileSystem : binding. network; 137 var other = binding.network === uiSourceCode ? binding.fileSystem : binding. network;
138 if (!uiSourceCode.isDirty()) {
139 binding[Persistence.Persistence._muteWorkingCopy] = true;
140 other.resetWorkingCopy();
141 binding[Persistence.Persistence._muteWorkingCopy] = false;
142 this._contentSyncedForTest();
143 return;
144 }
145
138 var target = Bindings.NetworkProject.targetForUISourceCode(binding.network); 146 var target = Bindings.NetworkProject.targetForUISourceCode(binding.network);
139 if (target.isNodeJS()) { 147 if (target.isNodeJS()) {
140 var newContent = uiSourceCode.workingCopy(); 148 var newContent = uiSourceCode.workingCopy();
141 other.requestContent().then(() => { 149 other.requestContent().then(() => {
142 var nodeJSContent = 150 var nodeJSContent =
143 Persistence.Persistence._rewrapNodeJSContent(binding, other, other.w orkingCopy(), newContent); 151 Persistence.Persistence._rewrapNodeJSContent(binding, other, other.w orkingCopy(), newContent);
144 setWorkingCopy.call(this, () => nodeJSContent); 152 setWorkingCopy.call(this, () => nodeJSContent);
145 }); 153 });
146 return; 154 return;
147 } 155 }
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 constructor(network, fileSystem, exactMatch) { 342 constructor(network, fileSystem, exactMatch) {
335 this.network = network; 343 this.network = network;
336 this.fileSystem = fileSystem; 344 this.fileSystem = fileSystem;
337 this.exactMatch = exactMatch; 345 this.exactMatch = exactMatch;
338 this._removed = false; 346 this._removed = false;
339 } 347 }
340 }; 348 };
341 349
342 /** @type {!Persistence.Persistence} */ 350 /** @type {!Persistence.Persistence} */
343 Persistence.persistence; 351 Persistence.persistence;
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-sync-content-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698