Bug 611505 - Fix 'TabParent not thread-safe' errors. r=honzab a=blocking-fennec
authorAlon Zakai <azakai@mozilla.com>
Sun, 21 Nov 2010 11:21:56 -0800
changeset 57973 5b540a5854b599cd21f0c4c4ec435fbc9fbb6ad7
parent 57972 4572c41755267cb0af3f7c98afe90acebca2b2f6
child 57974 5081913b695a728f1912a76816c64b7175c95639
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewershonzab, blocking-fennec
bugs611505
milestone2.0b8pre
Bug 611505 - Fix 'TabParent not thread-safe' errors. r=honzab a=blocking-fennec
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -78,21 +78,20 @@ using namespace mozilla::layout;
 // from the ones registered by webProgressListeners.
 #define NOTIFY_FLAG_SHIFT 16
 
 namespace mozilla {
 namespace dom {
 
 TabParent *TabParent::mIMETabParent = nsnull;
 
-NS_IMPL_ISUPPORTS4(TabParent, nsITabParent, nsIAuthPromptProvider, nsISSLStatusProvider, nsISecureBrowserUI)
+NS_IMPL_ISUPPORTS3(TabParent, nsITabParent, nsIAuthPromptProvider, nsISecureBrowserUI)
 
 TabParent::TabParent()
-  : mSecurityState(0)
-  , mIMECompositionEnding(PR_FALSE)
+  : mIMECompositionEnding(PR_FALSE)
   , mIMEComposing(PR_FALSE)
 {
 }
 
 TabParent::~TabParent()
 {
 }
 
@@ -194,35 +193,27 @@ TabParent::Init(nsIDOMWindow *window)
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TabParent::GetState(PRUint32 *aState)
 {
   NS_ENSURE_ARG(aState);
   NS_WARNING("SecurityState not valid here");
-  *aState = mSecurityState;
+  *aState = 0;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TabParent::GetTooltipText(nsAString & aTooltipText)
 {
-  aTooltipText = mSecurityTooltipText;
+  aTooltipText.Truncate();
   return NS_OK;
 }
 
-NS_IMETHODIMP
-TabParent::GetSSLStatus(nsISupports ** aStatus)
-{
-  NS_IF_ADDREF(*aStatus = mSecurityStatusObject);
-  return NS_OK;
-}
-
-
 PDocumentRendererParent*
 TabParent::AllocPDocumentRenderer(const nsRect& documentRect,
                                   const gfxMatrix& transform,
                                   const nsString& bgcolor,
                                   const PRUint32& renderFlags,
                                   const bool& flushLayout,
                                   const nsIntSize& renderSize)
 {
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -45,17 +45,16 @@
 
 #include "jsapi.h"
 #include "nsCOMPtr.h"
 #include "nsITabParent.h"
 #include "nsIBrowserDOMWindow.h"
 #include "nsWeakReference.h"
 #include "nsIDialogParamBlock.h"
 #include "nsIAuthPromptProvider.h"
-#include "nsISSLStatusProvider.h"
 #include "nsISecureBrowserUI.h"
 
 class nsFrameLoader;
 class nsIURI;
 class nsIDOMElement;
 struct gfxMatrix;
 
 struct JSContext;
@@ -65,17 +64,16 @@ namespace mozilla {
 namespace dom {
 
 class ContentDialogParent : public PContentDialogParent {};
 
 class TabParent : public PBrowserParent 
                 , public nsITabParent 
                 , public nsIAuthPromptProvider
                 , public nsISecureBrowserUI
-                , public nsISSLStatusProvider
 {
 public:
     TabParent();
     virtual ~TabParent();
     nsIDOMElement* GetOwnerElement() { return mFrameElement; }
     void SetOwnerElement(nsIDOMElement* aElement) { mFrameElement = aElement; }
     nsIBrowserDOMWindow *GetBrowserDOMWindow() { return mBrowserDOMWindow; }
     void SetBrowserDOMWindow(nsIBrowserDOMWindow* aBrowserDOMWindow) {
@@ -149,17 +147,16 @@ public:
             const bool& stickDocument);
     virtual bool DeallocPOfflineCacheUpdate(POfflineCacheUpdateParent* actor);
 
     JSBool GetGlobalJSObject(JSContext* cx, JSObject** globalp);
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSIAUTHPROMPTPROVIDER
     NS_DECL_NSISECUREBROWSERUI
-    NS_DECL_NSISSLSTATUSPROVIDER
 
     void HandleDelayedDialogs();
 
     static TabParent *GetIMETabParent() { return mIMETabParent; }
     bool HandleQueryContentEvent(nsQueryContentEvent& aEvent);
     bool SendCompositionEvent(nsCompositionEvent& event);
     bool SendTextEvent(nsTextEvent& event);
     bool SendSelectionEvent(nsSelectionEvent& event);
@@ -194,20 +191,16 @@ protected:
     PRBool ShouldDelayDialogs();
     PRBool AllowContentIME();
 
     NS_OVERRIDE
     virtual PRenderFrameParent* AllocPRenderFrame();
     NS_OVERRIDE
     virtual bool DeallocPRenderFrame(PRenderFrameParent* aFrame);
 
-    PRUint32 mSecurityState;
-    nsString mSecurityTooltipText;
-    nsCOMPtr<nsISupports> mSecurityStatusObject;
-
     // IME
     static TabParent *mIMETabParent;
     nsString mIMECacheText;
     PRUint32 mIMESelectionAnchor;
     PRUint32 mIMESelectionFocus;
     PRPackedBool mIMEComposing;
     PRPackedBool mIMECompositionEnding;
     // Buffer to store composition text during ResetInputState