Disable bfcache for pages with active PeerConnections

RESOLVED FIXED in mozilla19

Status

()

Core
WebRTC
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: anant, Assigned: anant)

Tracking

Trunk
mozilla19
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [qa-])

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
There was some discussion about the bfcache and PeerConnection in bug 694808, and it was decided to disable it for pages with active connections. This should clean up associated data channels as well.
(Assignee)

Comment 1

5 years ago
Created attachment 679928 [details] [diff] [review]
Disable bfcache - v1
Assignee: nobody → anant
Status: NEW → ASSIGNED
Attachment #679928 - Flags: review?(rjesup)
Attachment #679928 - Flags: review?(bugs)

Comment 2

5 years ago
Comment on attachment 679928 [details] [diff] [review]
Disable bfcache - v1

># HG changeset patch
># Parent c0713f3e03f676db0959fa823ba5a1677e7c9a58
>
>diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp
>--- a/content/base/src/nsDocument.cpp
>+++ b/content/base/src/nsDocument.cpp
>@@ -138,16 +138,17 @@
> #include "nsIDOMPageTransitionEvent.h"
> #include "nsFrameLoader.h"
> #include "nsEscape.h"
> #include "nsObjectLoadingContent.h"
> #include "nsHtml5TreeOpExecutor.h"
> #ifdef MOZ_MEDIA
> #include "nsHTMLMediaElement.h"
> #endif // MOZ_MEDIA
>+#include "IPeerConnection.h"
> 
> #include "mozAutoDocUpdate.h"
> #include "nsGlobalWindow.h"
> #include "mozilla/dom/EncodingUtils.h"
> #include "mozilla/dom/indexedDB/IndexedDatabaseManager.h"
> #include "nsDOMNavigationTiming.h"
> #include "nsEventStateManager.h"
> 
>@@ -6737,16 +6738,29 @@ nsDocument::CanSavePresentation(nsIReque
> 
>   // Check if we have running IndexedDB transactions
>   indexedDB::IndexedDatabaseManager* idbManager =
>     indexedDB::IndexedDatabaseManager::Get();
>   if (idbManager && idbManager->HasOpenTransactions(win)) {
>     return false;
>   }
> 
>+  // Check if we have active PeerConnections
>+  nsresult rv;
>+  nsCOMPtr<IPeerConnectionManager> pcManager =
>+    do_GetService(IPEERCONNECTION_MANAGER_CONTRACTID, &rv);
Just 
nsCOMPtr<IPeerConnectionManager> pcManager = 
  do_GetService(IPEERCONNECTION_MANAGER_CONTRACTID);

>+
>+  if (pcManager && win && win->IsInnerWindow()) {
No need to check win->IsInnerWindow(). Null check for win is in theory needed.
>+interface IPeerConnectionManager : nsISupports

>+{
>+  boolean hasActivePeerConnection(in unsigned long windowID);
>+};
s/windowID/innerWindowID/
Attachment #679928 - Flags: review?(bugs) → review+

Updated

5 years ago
Attachment #679928 - Flags: review?(rjesup) → review+
(Assignee)

Comment 3

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/6550240a3cb7

Comment 4

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/34b4e47ebf60

Backed out due to bustage on Android/B2G. Try is your friend!
(Assignee)

Comment 5

5 years ago
Thanks Jim, sorry for the trouble!

https://tbpl.mozilla.org/?tree=Try&rev=6999e5f3fa20
(Assignee)

Comment 6

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/f19782bd70a0
https://hg.mozilla.org/mozilla-central/rev/f19782bd70a0
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19

Updated

5 years ago
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.