public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Lars Wendler" <polynomial-c@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/seamonkey/files/, www-client/seamonkey/
Date: Tue,  4 May 2021 08:30:19 +0000 (UTC)	[thread overview]
Message-ID: <1620117008.a748522a120615f64e00d471acafb53e2b4aff5e.polynomial-c@gentoo> (raw)

commit:     a748522a120615f64e00d471acafb53e2b4aff5e
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Tue May  4 08:09:57 2021 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Tue May  4 08:30:08 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a748522a

www-client/seamonkey: Fix CPU hogging with polyfill addon

Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 .../files/seamonkey-2.53.7.1-cpu_hog_fix.patch     | 72 ++++++++++++++++++++++
 www-client/seamonkey/seamonkey-2.53.7.1-r1.ebuild  |  3 +
 2 files changed, 75 insertions(+)

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
new file mode 100644
index 00000000000..51894c48501
--- /dev/null
+++ b/www-client/seamonkey/files/seamonkey-2.53.7.1-cpu_hog_fix.patch
@@ -0,0 +1,72 @@
+https://github.com/JustOff/github-wc-polyfill/issues/10
+
+--- a/netwerk/protocol/websocket/WebSocketChannel.h
++++ b/netwerk/protocol/websocket/WebSocketChannel.h
+@@ -151,6 +151,7 @@ private:
+   void GeneratePong(uint8_t *payload, uint32_t len);
+   void GeneratePing();
+ 
++  MOZ_MUST_USE nsresult OnNetworkChangedTargetThread();
+   MOZ_MUST_USE nsresult OnNetworkChanged();
+   MOZ_MUST_USE nsresult StartPinging();
+ 
+--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
++++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
+@@ -1270,14 +1270,14 @@ WebSocketChannel::Observe(nsISupports *s
+         // Next we check mDataStarted, which we need to do on mTargetThread.
+         if (!IsOnTargetThread()) {
+           mTargetThread->Dispatch(
+-            NewRunnableMethod("net::WebSocketChannel::OnNetworkChanged",
++            NewRunnableMethod("net::WebSocketChannel::OnNetworkChangedTargetThread",
+                               this,
+-                              &WebSocketChannel::OnNetworkChanged),
++                              &WebSocketChannel::OnNetworkChangedTargetThread),
+             NS_DISPATCH_NORMAL);
+         } else {
+-          nsresult rv = OnNetworkChanged();
++          nsresult rv = OnNetworkChangedTargetThread();
+           if (NS_FAILED(rv)) {
+-            LOG(("WebSocket: OnNetworkChanged failed (%08" PRIx32 ")",
++            LOG(("WebSocket: OnNetworkChangedTargetThread failed (%08" PRIx32 ")",
+                  static_cast<uint32_t>(rv)));
+           }
+         }
+@@ -1289,23 +1289,25 @@ WebSocketChannel::Observe(nsISupports *s
+ }
+ 
+ nsresult
+-WebSocketChannel::OnNetworkChanged()
++WebSocketChannel::OnNetworkChangedTargetThread()
+ {
+-  if (IsOnTargetThread()) {
+-    LOG(("WebSocketChannel::OnNetworkChanged() - on target thread %p", this));
+-
+-    if (!mDataStarted) {
+-      LOG(("WebSocket: data not started yet, no ping needed"));
+-      return NS_OK;
+-    }
++  LOG(("WebSocketChannel::OnNetworkChangedTargetThread() - on target thread %p", this));
+ 
+-    return mSocketThread->Dispatch(
+-      NewRunnableMethod("net::WebSocketChannel::OnNetworkChanged",
+-                        this,
+-                        &WebSocketChannel::OnNetworkChanged),
+-      NS_DISPATCH_NORMAL);
++  if (!mDataStarted) {
++    LOG(("WebSocket: data not started yet, no ping needed"));
++    return NS_OK;
+   }
+ 
++  return mSocketThread->Dispatch(
++    NewRunnableMethod("net::WebSocketChannel::OnNetworkChanged",
++                      this,
++                      &WebSocketChannel::OnNetworkChanged),
++    NS_DISPATCH_NORMAL);
++}
++
++nsresult
++WebSocketChannel::OnNetworkChanged()
++{
+   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
+ 
+   LOG(("WebSocketChannel::OnNetworkChanged() - on socket thread %p", this));

diff --git a/www-client/seamonkey/seamonkey-2.53.7.1-r1.ebuild b/www-client/seamonkey/seamonkey-2.53.7.1-r1.ebuild
index c3a2e4925ff..21db5a23e28 100644
--- a/www-client/seamonkey/seamonkey-2.53.7.1-r1.ebuild
+++ b/www-client/seamonkey/seamonkey-2.53.7.1-r1.ebuild
@@ -192,6 +192,9 @@ src_prepare() {
 	# https://bugzilla.mozilla.org/show_bug.cgi?id=1623054
 	eapply "${FILESDIR}/${PN}-2.53.7-ownertab.patch"
 
+	# https://github.com/JustOff/github-wc-polyfill/issues/10
+	eapply "${FILESDIR}/${PN}-2.53.7.1-cpu_hog_fix.patch"
+
 	# Shell scripts sometimes contain DOS line endings; bug 391889
 	grep -rlZ --include="*.sh" $'\r$' . |
 	while read -r -d $'\0' file ; do


             reply	other threads:[~2021-05-04  8:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04  8:30 Lars Wendler [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-08-13  7:53 [gentoo-commits] repo/gentoo:master commit in: www-client/seamonkey/files/, www-client/seamonkey/ Lars Wendler
2021-08-08 20:42 Lars Wendler
2021-08-08 18:57 Lars Wendler
2021-05-14 10:17 Lars Wendler
2021-04-15  8:30 Lars Wendler
2020-10-01  7:17 Lars Wendler
2019-10-14  6:43 Lars Wendler
2016-12-23  0:08 Lars Wendler
2015-09-28  5:37 Lars Wendler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1620117008.a748522a120615f64e00d471acafb53e2b4aff5e.polynomial-c@gentoo \
    --to=polynomial-c@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox