Closed Bug 810164 Opened 12 years ago Closed 12 years ago

Disable bfcache for pages with active PeerConnections

Categories

(Core :: WebRTC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla19

People

(Reporter: anant, Assigned: anant)

Details

(Whiteboard: [qa-])

Attachments

(1 file)

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: nobody → anant
Status: NEW → ASSIGNED
Attachment #679928 - Flags: review?(rjesup)
Attachment #679928 - Flags: review?(bugs)
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+
Attachment #679928 - Flags: review?(rjesup) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/34b4e47ebf60

Backed out due to bustage on Android/B2G. Try is your friend!
Thanks Jim, sorry for the trouble!

https://tbpl.mozilla.org/?tree=Try&rev=6999e5f3fa20
https://hg.mozilla.org/mozilla-central/rev/f19782bd70a0
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: