1 |
commit: a748522a120615f64e00d471acafb53e2b4aff5e |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 4 08:09:57 2021 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 4 08:30:08 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a748522a |
7 |
|
8 |
www-client/seamonkey: Fix CPU hogging with polyfill addon |
9 |
|
10 |
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org> |
11 |
|
12 |
.../files/seamonkey-2.53.7.1-cpu_hog_fix.patch | 72 ++++++++++++++++++++++ |
13 |
www-client/seamonkey/seamonkey-2.53.7.1-r1.ebuild | 3 + |
14 |
2 files changed, 75 insertions(+) |
15 |
|
16 |
diff --git a/www-client/seamonkey/files/seamonkey-2.53.7.1-cpu_hog_fix.patch b/www-client/seamonkey/files/seamonkey-2.53.7.1-cpu_hog_fix.patch |
17 |
new file mode 100644 |
18 |
index 00000000000..51894c48501 |
19 |
--- /dev/null |
20 |
+++ b/www-client/seamonkey/files/seamonkey-2.53.7.1-cpu_hog_fix.patch |
21 |
@@ -0,0 +1,72 @@ |
22 |
+https://github.com/JustOff/github-wc-polyfill/issues/10 |
23 |
+ |
24 |
+--- a/netwerk/protocol/websocket/WebSocketChannel.h |
25 |
++++ b/netwerk/protocol/websocket/WebSocketChannel.h |
26 |
+@@ -151,6 +151,7 @@ private: |
27 |
+ void GeneratePong(uint8_t *payload, uint32_t len); |
28 |
+ void GeneratePing(); |
29 |
+ |
30 |
++ MOZ_MUST_USE nsresult OnNetworkChangedTargetThread(); |
31 |
+ MOZ_MUST_USE nsresult OnNetworkChanged(); |
32 |
+ MOZ_MUST_USE nsresult StartPinging(); |
33 |
+ |
34 |
+--- a/netwerk/protocol/websocket/WebSocketChannel.cpp |
35 |
++++ b/netwerk/protocol/websocket/WebSocketChannel.cpp |
36 |
+@@ -1270,14 +1270,14 @@ WebSocketChannel::Observe(nsISupports *s |
37 |
+ // Next we check mDataStarted, which we need to do on mTargetThread. |
38 |
+ if (!IsOnTargetThread()) { |
39 |
+ mTargetThread->Dispatch( |
40 |
+- NewRunnableMethod("net::WebSocketChannel::OnNetworkChanged", |
41 |
++ NewRunnableMethod("net::WebSocketChannel::OnNetworkChangedTargetThread", |
42 |
+ this, |
43 |
+- &WebSocketChannel::OnNetworkChanged), |
44 |
++ &WebSocketChannel::OnNetworkChangedTargetThread), |
45 |
+ NS_DISPATCH_NORMAL); |
46 |
+ } else { |
47 |
+- nsresult rv = OnNetworkChanged(); |
48 |
++ nsresult rv = OnNetworkChangedTargetThread(); |
49 |
+ if (NS_FAILED(rv)) { |
50 |
+- LOG(("WebSocket: OnNetworkChanged failed (%08" PRIx32 ")", |
51 |
++ LOG(("WebSocket: OnNetworkChangedTargetThread failed (%08" PRIx32 ")", |
52 |
+ static_cast<uint32_t>(rv))); |
53 |
+ } |
54 |
+ } |
55 |
+@@ -1289,23 +1289,25 @@ WebSocketChannel::Observe(nsISupports *s |
56 |
+ } |
57 |
+ |
58 |
+ nsresult |
59 |
+-WebSocketChannel::OnNetworkChanged() |
60 |
++WebSocketChannel::OnNetworkChangedTargetThread() |
61 |
+ { |
62 |
+- if (IsOnTargetThread()) { |
63 |
+- LOG(("WebSocketChannel::OnNetworkChanged() - on target thread %p", this)); |
64 |
+- |
65 |
+- if (!mDataStarted) { |
66 |
+- LOG(("WebSocket: data not started yet, no ping needed")); |
67 |
+- return NS_OK; |
68 |
+- } |
69 |
++ LOG(("WebSocketChannel::OnNetworkChangedTargetThread() - on target thread %p", this)); |
70 |
+ |
71 |
+- return mSocketThread->Dispatch( |
72 |
+- NewRunnableMethod("net::WebSocketChannel::OnNetworkChanged", |
73 |
+- this, |
74 |
+- &WebSocketChannel::OnNetworkChanged), |
75 |
+- NS_DISPATCH_NORMAL); |
76 |
++ if (!mDataStarted) { |
77 |
++ LOG(("WebSocket: data not started yet, no ping needed")); |
78 |
++ return NS_OK; |
79 |
+ } |
80 |
+ |
81 |
++ return mSocketThread->Dispatch( |
82 |
++ NewRunnableMethod("net::WebSocketChannel::OnNetworkChanged", |
83 |
++ this, |
84 |
++ &WebSocketChannel::OnNetworkChanged), |
85 |
++ NS_DISPATCH_NORMAL); |
86 |
++} |
87 |
++ |
88 |
++nsresult |
89 |
++WebSocketChannel::OnNetworkChanged() |
90 |
++{ |
91 |
+ MOZ_ASSERT(OnSocketThread(), "not on socket thread"); |
92 |
+ |
93 |
+ LOG(("WebSocketChannel::OnNetworkChanged() - on socket thread %p", this)); |
94 |
|
95 |
diff --git a/www-client/seamonkey/seamonkey-2.53.7.1-r1.ebuild b/www-client/seamonkey/seamonkey-2.53.7.1-r1.ebuild |
96 |
index c3a2e4925ff..21db5a23e28 100644 |
97 |
--- a/www-client/seamonkey/seamonkey-2.53.7.1-r1.ebuild |
98 |
+++ b/www-client/seamonkey/seamonkey-2.53.7.1-r1.ebuild |
99 |
@@ -192,6 +192,9 @@ src_prepare() { |
100 |
# https://bugzilla.mozilla.org/show_bug.cgi?id=1623054 |
101 |
eapply "${FILESDIR}/${PN}-2.53.7-ownertab.patch" |
102 |
|
103 |
+ # https://github.com/JustOff/github-wc-polyfill/issues/10 |
104 |
+ eapply "${FILESDIR}/${PN}-2.53.7.1-cpu_hog_fix.patch" |
105 |
+ |
106 |
# Shell scripts sometimes contain DOS line endings; bug 391889 |
107 |
grep -rlZ --include="*.sh" $'\r$' . | |
108 |
while read -r -d $'\0' file ; do |