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

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

Issue 6751260996796416: Issue 1724 - Fixed memory leak in messaging code, when no response is sent, on Safari (Closed)
Patch Set: Created Jan. 8, 2015, 2:14 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
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 } 599 }
600 600
601 frameId = page._frames.length; 601 frameId = page._frames.length;
602 page._frames.push({url: message.url, parent: parentFrame}); 602 page._frames.push({url: message.url, parent: parentFrame});
603 } 603 }
604 604
605 event.message = {pageId: pageId, frameId: frameId}; 605 event.message = {pageId: pageId, frameId: frameId};
606 break; 606 break;
607 case "webRequest": 607 case "webRequest":
608 var page = pages[event.message.pageId]; 608 var page = pages[event.message.pageId];
609 609 var results = ext.webRequest.onBeforeRequest._dispatch(
610 event.message = ext.webRequest.onBeforeRequest._dispatch(
611 event.message.url, 610 event.message.url,
612 event.message.type, 611 event.message.type,
613 page, 612 page,
614 page._frames[event.message.frameId] 613 page._frames[event.message.frameId]
615 ); 614 );
615
616 event.message = (results.indexOf(false) == -1);
616 break; 617 break;
617 case "proxy": 618 case "proxy":
618 event.message = backgroundPageProxy.handleMessage(event.message); 619 event.message = backgroundPageProxy.handleMessage(event.message);
619 break; 620 break;
620 case "request": 621 case "request":
621 var page = pages[event.message.pageId]; 622 var page = pages[event.message.pageId];
622 var sender = {page: page, frame: page._frames[event.message.frameId] }; 623 var sender = {page: page, frame: page._frames[event.message.frameId] };
623 624
624 var response = null; 625 var response = null;
625 var sendResponse = function(message) { response = message; }; 626 var sendResponse = function(message) { response = message; };
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 page.activate(); 672 page.activate();
672 if (callback) 673 if (callback)
673 callback(page); 674 callback(page);
674 return; 675 return;
675 } 676 }
676 } 677 }
677 678
678 ext.pages.open(optionsUrl, callback); 679 ext.pages.open(optionsUrl, callback);
679 }; 680 };
680 })(); 681 })();
OLDNEW
« no previous file with comments | « ext/common.js ('k') | safari/ext/common.js » ('j') | safari/ext/common.js » ('J')

Powered by Google App Engine
This is Rietveld