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

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

Issue 2435043003: DevTools: restore selection and scrollposition between network and filesystem (Closed)
Patch Set: add testcase Created 4 years, 2 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: third_party/WebKit/Source/devtools/front_end/persistence/Persistence.js
diff --git a/third_party/WebKit/Source/devtools/front_end/persistence/Persistence.js b/third_party/WebKit/Source/devtools/front_end/persistence/Persistence.js
index 8423ebee8e0038b4f2f6007deff60d9e2f3c20ef..58131cc3e8a724130c40d6e9bfacebbcf16af4fb 100644
--- a/third_party/WebKit/Source/devtools/front_end/persistence/Persistence.js
+++ b/third_party/WebKit/Source/devtools/front_end/persistence/Persistence.js
@@ -38,10 +38,13 @@ WebInspector.Persistence.prototype = {
*/
_onBindingCreated: function(binding)
{
- if (binding.network.isDirty() || binding.fileSystem.isDirty()) {
+ if (binding.network.isDirty()) {
WebInspector.console.log(WebInspector.UIString("%s can not be persisted to file system due to unsaved changes.", binding.network.name()));
return;
}
+ if (binding.fileSystem.isDirty())
+ binding.network.setWorkingCopy(binding.fileSystem.workingCopy());
+
binding.network[WebInspector.Persistence._binding] = binding;
binding.fileSystem[WebInspector.Persistence._binding] = binding;
@@ -61,6 +64,9 @@ WebInspector.Persistence.prototype = {
*/
_onBindingRemoved: function(binding)
{
+ if (binding.network.isDirty())
+ binding.fileSystem.setWorkingCopy(binding.network.workingCopy());
+
binding.network[WebInspector.Persistence._binding] = null;
binding.fileSystem[WebInspector.Persistence._binding] = null;

Powered by Google App Engine
This is Rietveld 408576698