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; |