Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: lib/io.js

Issue 29526591: Issue 5562 - Move Edge storage to IndexedDB (Closed)
Left Patch Set: Improve list loading logic and remove redundant checks Created Aug. 24, 2017, 4:47 p.m.
Right Patch Set: Remove accidental code Created Aug. 24, 2017, 5:15 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | lib/localforage.min.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 10 matching lines...) Expand all
21 21
22 function fileToKey(fileName) 22 function fileToKey(fileName)
23 { 23 {
24 return keyPrefix + fileName; 24 return keyPrefix + fileName;
25 } 25 }
26 26
27 function loadFile(fileName) 27 function loadFile(fileName)
28 { 28 {
29 return new Promise((resolve, reject) => 29 return new Promise((resolve, reject) =>
30 { 30 {
31 console.trace();
Sebastian Noack 2017/08/24 17:11:00 Did you forget to remove this?
Oleksandr 2017/08/24 17:17:04 Whoops. Yes, sorry. Some of the refreshes before c
32 localforage.getItem(fileToKey(fileName), (err, value) => 31 localforage.getItem(fileToKey(fileName), (err, value) =>
33 { 32 {
34 if (err || value == null) 33 if (err || value == null)
35 reject({type: "NoSuchFile"}); 34 reject({type: "NoSuchFile"});
36 else 35 else
37 resolve(value); 36 resolve(value);
38 }); 37 });
39 }); 38 });
40 } 39 }
41 40
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 lastModified: entry.lastModified 156 lastModified: entry.lastModified
158 }; 157 };
159 }).catch(error => 158 }).catch(error =>
160 { 159 {
161 if (error.type == "NoSuchFile") 160 if (error.type == "NoSuchFile")
162 return {exists: false}; 161 return {exists: false};
163 throw error; 162 throw error;
164 }); 163 });
165 } 164 }
166 }; 165 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld