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

Side by Side Diff: ui/file_manager/image_loader/cache.js

Issue 401893002: IndexedDB: Stop using webkit-prefixed versions of APIs in tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More webkitIndexedDB foo and update webkitErrorMessage use too Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/perf/page_sets/endure/indexeddb_app_worker.js ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * Persistent cache storing images in an indexed database on the hard disk. 8 * Persistent cache storing images in an indexed database on the hard disk.
9 * @constructor 9 * @constructor
10 */ 10 */
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 }; 64 };
65 65
66 /** 66 /**
67 * Initializes the cache database. 67 * Initializes the cache database.
68 * @param {function()} callback Completion callback. 68 * @param {function()} callback Completion callback.
69 */ 69 */
70 Cache.prototype.initialize = function(callback) { 70 Cache.prototype.initialize = function(callback) {
71 // Establish a connection to the database or (re)create it if not available 71 // Establish a connection to the database or (re)create it if not available
72 // or not up to date. After changing the database's schema, increment 72 // or not up to date. After changing the database's schema, increment
73 // Cache.DB_VERSION to force database recreating. 73 // Cache.DB_VERSION to force database recreating.
74 var openRequest = window.webkitIndexedDB.open(Cache.DB_NAME, 74 var openRequest = window.indexedDB.open(Cache.DB_NAME, Cache.DB_VERSION);
75 Cache.DB_VERSION);
76 75
77 openRequest.onsuccess = function(e) { 76 openRequest.onsuccess = function(e) {
78 this.db_ = e.target.result; 77 this.db_ = e.target.result;
79 callback(); 78 callback();
80 }.bind(this); 79 }.bind(this);
81 80
82 openRequest.onerror = callback; 81 openRequest.onerror = callback;
83 82
84 openRequest.onupgradeneeded = function(e) { 83 openRequest.onupgradeneeded = function(e) {
85 console.info('Cache database creating or upgrading.'); 84 console.info('Cache database creating or upgrading.');
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 metadataReceived = true; 400 metadataReceived = true;
402 onPartialSuccess(); 401 onPartialSuccess();
403 }; 402 };
404 403
405 metadataRequest.onerror = function() { 404 metadataRequest.onerror = function() {
406 console.error('Failed to remove an image.'); 405 console.error('Failed to remove an image.');
407 metadataReceived = true; 406 metadataReceived = true;
408 onPartialSuccess(); 407 onPartialSuccess();
409 }; 408 };
410 }; 409 };
OLDNEW
« no previous file with comments | « tools/perf/page_sets/endure/indexeddb_app_worker.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698