{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/firefox-ios/issues/492","labels_url":"https://api.github.com/repos/mozilla/firefox-ios/issues/492/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/firefox-ios/issues/492/comments","events_url":"https://api.github.com/repos/mozilla/firefox-ios/issues/492/events","html_url":"https://github.com/mozilla/firefox-ios/pull/492","id":79296308,"number":492,"title":"Bug 1163120 - Zombies","user":{"login":"wesj","id":1117644,"avatar_url":"https://avatars.githubusercontent.com/u/1117644?v=3","gravatar_id":"","url":"https://api.github.com/users/wesj","html_url":"https://github.com/wesj","followers_url":"https://api.github.com/users/wesj/followers","following_url":"https://api.github.com/users/wesj/following{/other_user}","gists_url":"https://api.github.com/users/wesj/gists{/gist_id}","starred_url":"https://api.github.com/users/wesj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesj/subscriptions","organizations_url":"https://api.github.com/users/wesj/orgs","repos_url":"https://api.github.com/users/wesj/repos","events_url":"https://api.github.com/users/wesj/events{/privacy}","received_events_url":"https://api.github.com/users/wesj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-05-22T05:31:00Z","updated_at":"2015-05-27T03:10:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mozilla/firefox-ios/pulls/492","html_url":"https://github.com/mozilla/firefox-ios/pull/492","diff_url":"https://github.com/mozilla/firefox-ios/pull/492.diff","patch_url":"https://github.com/mozilla/firefox-ios/pull/492.patch"},"body":"This lets a Browser exist without a webView. The webView within it can be created/destroyed by calling zombify()/resurrect(). While its a zombie, it holds on to (some) information that's given to it so that it can handle it later when its resurrected. i.e. the last load request. A navigation delegate. I started to make userScripts that were loaded work like that as well, but decided it was easier for callers to just be careful about re-registering themselves when the tabs were resurrected. There's a delegate interface for notifications when tabs are zombified or resurrected.\r\n\r\nTabs are automatically \"resurrected\" when they're created (unless you specify not to), or when they're selected. Zombie tabs load the thumbnails from thumbnail storage. \r\n\r\nI also... couldn't resist and made a few other little changes. This completely zombifies all unselected tabs on memory warnings. Seems like something we should do? It also removes selecting tabs from the addTab method, since the two seem like orthogonal things to me. i.e. Ideally you'd just call:\r\ntabManager.selectedTab = tabManager.addTab(url)"},"comment":{"url":"https://api.github.com/repos/mozilla/firefox-ios/issues/comments/105741154","html_url":"https://github.com/mozilla/firefox-ios/pull/492#issuecomment-105741154","issue_url":"https://api.github.com/repos/mozilla/firefox-ios/issues/492","id":105741154,"user":{"login":"st3fan","id":28052,"avatar_url":"https://avatars.githubusercontent.com/u/28052?v=3","gravatar_id":"","url":"https://api.github.com/users/st3fan","html_url":"https://github.com/st3fan","followers_url":"https://api.github.com/users/st3fan/followers","following_url":"https://api.github.com/users/st3fan/following{/other_user}","gists_url":"https://api.github.com/users/st3fan/gists{/gist_id}","starred_url":"https://api.github.com/users/st3fan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/st3fan/subscriptions","organizations_url":"https://api.github.com/users/st3fan/orgs","repos_url":"https://api.github.com/users/st3fan/repos","events_url":"https://api.github.com/users/st3fan/events{/privacy}","received_events_url":"https://api.github.com/users/st3fan/received_events","type":"User","site_admin":false},"created_at":"2015-05-27T03:10:38Z","updated_at":"2015-05-27T03:10:38Z","body":"Also, when measuring memory usage, remember two things: first, that a large chunk is happening outside of the main application process. You may actually be able to see the external processes that are being created. (On OS X they will have the site name in their process name). Second, the behaviour (of memory in general and webviews specifically) and memory usage is different on the simulator. Be sure to check on a real device."}}