[Pkg-mozext-commits] [spdy-indicator] 01/01: Imported Upstream version 2.2
Dmitry Smirnov
onlyjob at moszumanska.debian.org
Sun Nov 30 10:51:18 UTC 2014
This is an automated email from the git hooks/post-receive script.
onlyjob pushed a commit to branch upstream
in repository spdy-indicator.
commit f19918d (upstream)
Author: Dmitry Smirnov <onlyjob at member.fsf.org>
Date: Sat Nov 29 17:53:31 2014
Imported Upstream version 2.2
---
chrome/content/indicator.jsm | 52 ++++++++++++++++++++++++++++++++----
chrome/locale/en-US/overlay.dtd | 4 +++
chrome/skin/icon-http2-active.png | Bin 0 -> 269 bytes
chrome/skin/icon-spdy-active.png | Bin 383 -> 293 bytes
chrome/skin/icon-spdy-subactive.png | Bin 402 -> 284 bytes
chrome/skin/icon-spdy2-active.png | Bin 0 -> 301 bytes
chrome/skin/icon-spdy3-active.png | Bin 0 -> 302 bytes
chrome/skin/icon-spdy31-active.png | Bin 0 -> 300 bytes
chrome/skin/overlay.css | 12 +++++++++
icon.png | Bin 3589 -> 3278 bytes
install.rdf | 6 ++---
11 files changed, 66 insertions(+), 8 deletions(-)
diff --git a/chrome/content/indicator.jsm b/chrome/content/indicator.jsm
index 3577323..a974db6 100644
--- a/chrome/content/indicator.jsm
+++ b/chrome/content/indicator.jsm
@@ -108,7 +108,7 @@ var SPDYManager = {
if (!indicator) {
debug("Could not find indicator from chrome window for request");
} else {
- indicator.spdyRequested(domWindow, subject.URI);
+ indicator.spdyRequested(domWindow, subject.URI, spdyHeader);
}
break;
}
@@ -161,6 +161,18 @@ var SPDYManager = {
}, {
name: "active",
tooltip: "SPDY is active for the top-level document",
+ }, {
+ name: "spdy2",
+ tooltip: "SPDY 2 is active for the top-level document",
+ }, {
+ name: "spdy3",
+ tooltip: "SPDY 3 is active for the top-level document",
+ }, {
+ name: "spdy31",
+ tooltip: "SPDY 3.1 is active for the top-level document",
+ }, {
+ name: "http2",
+ tooltip: "HTTP/2 is active for the top-level document",
}
],
@@ -270,6 +282,27 @@ SPDYIndicator.prototype = {
return (spdyRequests && spdyRequests.indexOf(currentPath) !== -1);
},
+ updateStateForSPDY: function (browser) {
+ let spdyVersions = browser.getUserData("__spdyindicator_spdyversions");
+ let currentPath = browser.getUserData("__spdyindicator_path") ||
+ browser.currentURI.prePath;
+
+ let state = 3;
+ if (spdyVersions && spdyVersions.hasOwnProperty(currentPath)) {
+ let version = spdyVersions[currentPath];
+ if (version.match(/^h2/)) {
+ state = 7;
+ } else if (version === "3.1") {
+ state = 6;
+ } else if (version === "3") {
+ state = 5;
+ } else if (version === "2") {
+ state = 4;
+ }
+ }
+ this.updateState(browser, state);
+ },
+
update: function () {
let state = this.getState(this.browser.selectedBrowser);
// change indicator state
@@ -281,23 +314,32 @@ SPDYIndicator.prototype = {
},
_update_bound: null,
- spdyRequested: function (domWindow, uri) {
+ spdyRequested: function (domWindow, uri, version) {
debug("Requested " + uri.asciiSpec);
+ debug("SPDY Version " + version);
let browser = this.browser.getBrowserForDocument(domWindow.top.document);
if (!browser) return;
let spdyRequests = browser.getUserData("__spdyindicator_spdyrequests") || [];
+ let spdyVersions = browser.getUserData("__spdyindicator_spdyversions") || {};
if (spdyRequests.indexOf(uri.prePath) === -1) {
spdyRequests.push(uri.prePath);
+ spdyVersions[uri.prePath] = version;
}
if (spdyRequests.length > SPDYREQUESTS_MAXSIZE) {
- spdyRequests.splice(0, spdyRequests.length - SPDYREQUESTS_MAXSIZE);
+ let splices = spdyRequests.splice(0, spdyRequests.length - SPDYREQUESTS_MAXSIZE);
+ splices.forEach(function (element) {
+ if (spdyVersions.hasOwnProperty(element)) {
+ delete spdyVersions[element];
+ }
+ });
}
browser.setUserData("__spdyindicator_spdyrequests", spdyRequests, null);
+ browser.setUserData("__spdyindicator_spdyversions", spdyVersions, null);
if (this.isTopLevelSPDY(browser)) {
- this.updateState(browser, 3);
+ this.updateStateForSPDY(browser);
} else {
this.updateState(browser, 2);
}
@@ -308,7 +350,7 @@ SPDYIndicator.prototype = {
browser.setUserData("__spdyindicator_path", URI.prePath, null);
this.setState(browser, 0);
if (this.isTopLevelSPDY(browser)) {
- this.updateState(browser, 3);
+ this.updateStateForSPDY(browser);
}
},
onProgressChange: function () {},
diff --git a/chrome/locale/en-US/overlay.dtd b/chrome/locale/en-US/overlay.dtd
index bc64b06..ab4498f 100644
--- a/chrome/locale/en-US/overlay.dtd
+++ b/chrome/locale/en-US/overlay.dtd
@@ -1,3 +1,7 @@
<!ENTITY spdyindicator.tooltipInactive "SPDY is inactive">
<!ENTITY spdyindicator.tooltipActive "SPDY is active for the top-level document">
<!ENTITY spdyindicator.tooltipSubactive "SPDY is active for sub-documents included in the top-level document">
+<!ENTITY spdyindicator.tooltipSPDY2 "SPDY 2 is active for the top-level document">
+<!ENTITY spdyindicator.tooltipSPDY3 "SPDY 3 is active for the top-level document">
+<!ENTITY spdyindicator.tooltipSPDY31 "SPDY 3.1 is active for the top-level document">
+<!ENTITY spdyindicator.tooltipHTTP2 "HTTP/2 is active for the top-level document">
diff --git a/chrome/skin/icon-http2-active.png b/chrome/skin/icon-http2-active.png
new file mode 100644
index 0000000..e2c48a8
Binary files /dev/null and b/chrome/skin/icon-http2-active.png differ
diff --git a/chrome/skin/icon-spdy-active.png b/chrome/skin/icon-spdy-active.png
index 89d9140..c53e8d5 100644
Binary files a/chrome/skin/icon-spdy-active.png and b/chrome/skin/icon-spdy-active.png differ
diff --git a/chrome/skin/icon-spdy-subactive.png b/chrome/skin/icon-spdy-subactive.png
index f102447..80f80b0 100644
Binary files a/chrome/skin/icon-spdy-subactive.png and b/chrome/skin/icon-spdy-subactive.png differ
diff --git a/chrome/skin/icon-spdy2-active.png b/chrome/skin/icon-spdy2-active.png
new file mode 100644
index 0000000..61014d5
Binary files /dev/null and b/chrome/skin/icon-spdy2-active.png differ
diff --git a/chrome/skin/icon-spdy3-active.png b/chrome/skin/icon-spdy3-active.png
new file mode 100644
index 0000000..0eeffe7
Binary files /dev/null and b/chrome/skin/icon-spdy3-active.png differ
diff --git a/chrome/skin/icon-spdy31-active.png b/chrome/skin/icon-spdy31-active.png
new file mode 100644
index 0000000..ca97315
Binary files /dev/null and b/chrome/skin/icon-spdy31-active.png differ
diff --git a/chrome/skin/overlay.css b/chrome/skin/overlay.css
index 1fb1e92..90d4938 100644
--- a/chrome/skin/overlay.css
+++ b/chrome/skin/overlay.css
@@ -1,3 +1,15 @@
+#spdyindicator-icon[state=http2] {
+ list-style-image: url("chrome://spdyindicator/skin/icon-http2-active.png");
+}
+#spdyindicator-icon[state=spdy31] {
+ list-style-image: url("chrome://spdyindicator/skin/icon-spdy31-active.png");
+}
+#spdyindicator-icon[state=spdy3] {
+ list-style-image: url("chrome://spdyindicator/skin/icon-spdy3-active.png");
+}
+#spdyindicator-icon[state=spdy2] {
+ list-style-image: url("chrome://spdyindicator/skin/icon-spdy2-active.png");
+}
#spdyindicator-icon[state=active] {
list-style-image: url("chrome://spdyindicator/skin/icon-spdy-active.png");
}
diff --git a/icon.png b/icon.png
index e3decd6..92ebfe2 100644
Binary files a/icon.png and b/icon.png differ
diff --git a/install.rdf b/install.rdf
index 21dfacb..c839dd3 100644
--- a/install.rdf
+++ b/install.rdf
@@ -3,7 +3,7 @@
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>spdyindicator at chengsun.github.com</em:id>
- <em:version>2.1</em:version>
+ <em:version>2.2</em:version>
<em:type>2</em:type>
<em:bootstrap>true</em:bootstrap>
@@ -11,7 +11,7 @@
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>10.*</em:minVersion>
- <em:maxVersion>15.0a1</em:maxVersion>
+ <em:maxVersion>34.*</em:maxVersion>
</Description>
</em:targetApplication>
@@ -19,5 +19,5 @@
<em:description>An indicator showing SPDY support in the address bar.</em:description>
<em:creator>Cheng Sun</em:creator>
<em:homepageURL>http://github.com/chengsun/moz-spdy-indicator</em:homepageURL>
- </Description>
+ </Description>
</RDF>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/spdy-indicator.git
More information about the Pkg-mozext-commits
mailing list