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

Side by Side Diff: chrome/ext/background.js

Issue 5957502386569216: Issue 2021 - Fixed deletion of migrated files from the FileSystem API (Closed)
Patch Set: Created April 21, 2015, 1:56 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | 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 /* 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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 { 582 {
583 chrome.storage.local.set( 583 chrome.storage.local.set(
584 { 584 {
585 "file:patterns.ini": { 585 "file:patterns.ini": {
586 content: reader.result.split(/[\r\n]+/), 586 content: reader.result.split(/[\r\n]+/),
587 lastModified: metadata.modificationTime.getTime() 587 lastModified: metadata.modificationTime.getTime()
588 } 588 }
589 }, 589 },
590 function() 590 function()
591 { 591 {
592 fs.root.removeRecursively(callback, callback); 592 fs.root.createReader().readEntries(function(entries)
593 {
594 var emptyFunc = function() {};
595
596 for (var i = 0; i < entries.length; i++)
597 {
598 var entry = entries[i];
599 if (entry.isDirectory)
600 entry.removeRecursively(emptyFunc, emptyFunc);
601 else
602 entry.remove(emptyFunc, emptyFunc);
603 }
604 });
605
606 callback();
593 } 607 }
594 ); 608 );
595 } 609 }
596 else 610 else
597 { 611 {
598 callback(); 612 callback();
599 } 613 }
600 }; 614 };
601 reader.readAsText(file); 615 reader.readAsText(file);
602 }, callback); 616 }, callback);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 callback(new Page(tab)); 653 callback(new Page(tab));
640 } 654 }
641 else 655 else
642 { 656 {
643 ext.pages.open(optionsUrl, callback); 657 ext.pages.open(optionsUrl, callback);
644 } 658 }
645 }); 659 });
646 }); 660 });
647 }; 661 };
648 })(); 662 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld