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

Unified Diff: ui/file_manager/audio_player/js/audio_player_model.js

Issue 984593002: Use Object.observe() instead of Polyfills (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 9 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: ui/file_manager/audio_player/js/audio_player_model.js
diff --git a/ui/file_manager/audio_player/js/audio_player_model.js b/ui/file_manager/audio_player/js/audio_player_model.js
index 8fbc4bf5fed1322c7d06c4b5800b303b2a442dc3..3927b2a9c687188f81bf03b59bcb327fc2db107f 100644
--- a/ui/file_manager/audio_player/js/audio_player_model.js
+++ b/ui/file_manager/audio_player/js/audio_player_model.js
@@ -54,7 +54,7 @@
model[key.substr(STORAGE_PREFIX.length)] = result[key];
}
callback();
- }.bind(this));
+ });
};
/**
@@ -69,13 +69,13 @@
Object.seal(this);
// Restores the values from the storage
- loadModel(this, function() {
+ var target = this;
+ loadModel(target, function() {
// Installs observer to watch changes of the values.
- var observer = new ObjectObserver(this);
- observer.open(function(added, removed, changed, getOldValueFn) {
- saveModel(this);
- }.bind(this));
- }.bind(this));
+ Object.observe(target, function(changes) {
+ saveModel(target);
+ });
+ });
}
// Exports AudioPlayerModel class to the global.
« no previous file with comments | « ui/file_manager/audio_player/js/audio_player.js ('k') | ui/file_manager/audio_player/js/audio_player_scripts.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698