Update comments

Old comment bug was fixed a while back in Chrome.

Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
Faster escape from onBeforeRequest when nothing applies

Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
Don't try to update the URI() object unless needed (rare)

Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
Remove useless displayPageAction handlers

We call displayPageAction all the freaking time.

It's called in chrome.tabs.onUpdated which takes care of 99.9% of all cases.

These two are unnecessary.

Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
Add some comments explaining functions

Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
Move displayPageAction out of the hot onBeforeRequest

displayPageAction is called (unnecessarily) potentially /hundreds/ of times per tab.

It only needs to be called /once/ when a page updates and has applicable rules.

We'd be fine just removing it from onBeforeRequest (and depending on chrome.tabs.onUpdated) except for the super-edge case where a tab:
- Meets zero potentially applicable rulesets
- Has absolutely no rulesets that apply to dependencies (included JS, etc.)
- Makes a request we /can/ apply rules to, but it happens after DOM document complete when tabs.onUpdated has already fired

In practice, I was unable to find *any* sites that met this criteria, but I can make a localhost test case.

This adds a 10 sec. timer to check if active tabs are missing the pageAction icon.

Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
Merge branch 'background-perf-changes' of github.com:semenko/https-everywhere into semenko-background-perf-changes

Conflicts:
	chromium/background.js
Revert "Move displayPageAction out of the hot onBeforeRequest"

This reverts commit 1d5df8f3204aac85618a1b8b21629dc9fbaaa791.
Fire pageAction only from tabs.onUpdated/onReplaced

pageAction is responsible for adding the HTTPS Everywhere icon next to the URL bar. We used to display this only on pages w/ applicable rules (almost every page), but that logic was messy and slow. Now we display the icon all the time.

This might get called once or twice per-tab, but it's relatively low cost. At least we're no longer calling it multiple times for every request :)

Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
Merge branch 'background-perf-changes' of github.com:semenko/https-everywhere into semenko-background-perf-changes
Merge branch 'semenko-background-perf-changes'