Bug 617539 - Remove nsIPluginHost_MOZILLA_2_0_BRANCH, nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH, and nsIPluginInstance_MOZILLA_2_0_BRANCH; r=jst
authorBenjamin Smedberg <benjamin@smedbergs.us>
Mon, 11 Apr 2011 16:00:30 -0400
changeset 67851 3aebb305dee5
parent 67850 7cf73914be2a
child 67852 a7ba826ccbdf
push id19441
push usereakhgari@mozilla.com
push dateMon, 11 Apr 2011 20:01:52 +0000
treeherdermozilla-central@a7ba826ccbdf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst
bugs617539
milestone2.2a1pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 617539 - Remove nsIPluginHost_MOZILLA_2_0_BRANCH, nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH, and nsIPluginInstance_MOZILLA_2_0_BRANCH; r=jst
browser/base/content/sanitize.js
browser/base/content/test/browser_clearplugindata.js
browser/components/privatebrowsing/src/nsPrivateBrowsingService.js
browser/components/privatebrowsing/test/browser/browser_privatebrowsing_clearplugindata.js
dom/base/nsGlobalWindow.cpp
dom/plugins/PluginInstanceParent.cpp
dom/plugins/PluginInstanceParent.h
dom/plugins/PluginLibrary.h
dom/plugins/PluginModuleParent.cpp
dom/plugins/PluginModuleParent.h
layout/generic/nsObjectFrame.cpp
modules/plugin/base/public/nsIPluginHost.idl
modules/plugin/base/public/nsIPluginInstance.idl
modules/plugin/base/public/nsIPluginInstanceOwner.idl
modules/plugin/base/src/PluginPRLibrary.cpp
modules/plugin/base/src/PluginPRLibrary.h
modules/plugin/base/src/nsNPAPIPlugin.cpp
modules/plugin/base/src/nsNPAPIPluginInstance.cpp
modules/plugin/base/src/nsNPAPIPluginInstance.h
modules/plugin/base/src/nsPluginHost.cpp
modules/plugin/base/src/nsPluginHost.h
modules/plugin/base/src/nsPluginStreamListenerPeer.cpp
modules/plugin/test/mochitest/test_clear_site_data.html
--- a/browser/base/content/sanitize.js
+++ b/browser/base/content/sanitize.js
@@ -152,17 +152,17 @@ Sanitizer.prototype = {
         }
         else {
           // Remove everything
           cookieMgr.removeAll();
         }
 
         // Clear plugin data.
         let ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
-        const phInterface = Ci.nsIPluginHost_MOZILLA_2_0_BRANCH;
+        const phInterface = Ci.nsIPluginHost;
         const FLAG_CLEAR_ALL = phInterface.FLAG_CLEAR_ALL;
         ph.QueryInterface(phInterface);
 
         // Determine age range in seconds. (-1 means clear all.) We don't know
         // that this.range[1] is actually now, so we compute age range based
         // on the lower bound. If this.range results in a negative age, do
         // nothing.
         let age = this.range ? (Date.now() / 1000 - this.range[0] / 1000000)
--- a/browser/base/content/test/browser_clearplugindata.js
+++ b/browser/base/content/test/browser_clearplugindata.js
@@ -5,17 +5,17 @@
 
 // Test clearing plugin data using sanitize.js.
 const testURL1 = "http://mochi.test:8888/browser/browser/base/content/test/browser_clearplugindata.html";
 const testURL2 = "http://mochi.test:8888/browser/browser/base/content/test/browser_clearplugindata_noage.html";
 
 Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader)
                                            .loadSubScript("chrome://browser/content/sanitize.js");
 
-const pluginHostIface = Ci.nsIPluginHost_MOZILLA_2_0_BRANCH;
+const pluginHostIface = Ci.nsIPluginHost;
 var pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
 pluginHost.QueryInterface(pluginHostIface);
 
 var pluginTag;
 var s;
 
 function stored(needles) {
   var something = pluginHost.siteHasData(this.pluginTag, null);
--- a/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js
+++ b/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js
@@ -613,17 +613,17 @@ PrivateBrowsingService.prototype = {
       while (enumerator.hasMoreElements()) {
         let cookie = enumerator.getNext().QueryInterface(Ci.nsICookie);
         cm.remove(cookie.host, cookie.name, cookie.path, false);
       }
     }
 
     // Plugin data
     let (ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost)) {
-      const phInterface = Ci.nsIPluginHost_MOZILLA_2_0_BRANCH;
+      const phInterface = Ci.nsIPluginHost;
       const FLAG_CLEAR_ALL = phInterface.FLAG_CLEAR_ALL;
       ph.QueryInterface(phInterface);
 
       let tags = ph.getPluginTags();
       for (let i = 0; i < tags.length; i++) {
         try {
           ph.clearSiteData(tags[i], aDomain, FLAG_CLEAR_ALL, -1);
         } catch (e) {
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_clearplugindata.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_clearplugindata.js
@@ -1,17 +1,17 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Test clearing plugin data by domain using nsPrivateBrowsingService.
 const testURL = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_clearplugindata.html";
 
-const pluginHostIface = Ci.nsIPluginHost_MOZILLA_2_0_BRANCH;
+const pluginHostIface = Ci.nsIPluginHost;
 var pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
 pluginHost.QueryInterface(pluginHostIface);
 
 var pluginTag;
 
 function stored(needles) {
   var something = pluginHost.siteHasData(this.pluginTag, null);
   if (!needles)
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -512,16 +512,22 @@ NS_IMETHODIMP
 nsDummyJavaPluginOwner::GetWindow(NPWindow *&aWindow)
 {
   aWindow = nsnull;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
+nsDummyJavaPluginOwner::SetWindow()
+{
+  return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+NS_IMETHODIMP
 nsDummyJavaPluginOwner::GetMode(PRInt32 *aMode)
 {
   // This is wrong, but there's no better alternative.
   *aMode = NP_EMBED;
 
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
--- a/dom/plugins/PluginInstanceParent.cpp
+++ b/dom/plugins/PluginInstanceParent.cpp
@@ -592,26 +592,16 @@ PluginInstanceParent::AsyncSetWindow(NPW
     if (!SendAsyncSetWindow(gfxPlatform::GetPlatform()->ScreenReferenceSurface()->GetType(),
                             window))
         return NS_ERROR_FAILURE;
 
     return NS_OK;
 }
 
 nsresult
-PluginInstanceParent::GetSurface(gfxASurface** aSurface)
-{
-    if (mFrontSurface) {
-      NS_ADDREF(*aSurface = mFrontSurface);
-      return NS_OK;
-    }
-    return NS_ERROR_NOT_AVAILABLE;
-}
-
-nsresult
 PluginInstanceParent::GetImage(ImageContainer* aContainer, Image** aImage)
 {
 #ifdef XP_MACOSX
     if (!mFrontSurface && !mIOSurface)
 #else
     if (!mFrontSurface)
 #endif
         return NS_ERROR_NOT_AVAILABLE;
--- a/dom/plugins/PluginInstanceParent.h
+++ b/dom/plugins/PluginInstanceParent.h
@@ -275,17 +275,16 @@ public:
     virtual bool
     AnswerPluginFocusChange(const bool& gotFocus);
 
 #if defined(OS_MACOSX)
     void Invalidate();
 #endif // definied(OS_MACOSX)
 
     nsresult AsyncSetWindow(NPWindow* window);
-    nsresult GetSurface(gfxASurface** aSurface);
     nsresult GetImage(mozilla::layers::ImageContainer* aContainer, mozilla::layers::Image** aImage);
     nsresult GetImageSize(nsIntSize* aSize);
 #ifdef XP_MACOSX
     nsresult IsRemoteDrawingCoreAnimation(PRBool *aDrawing);
 #endif
     nsresult SetBackgroundUnknown();
     nsresult BeginUpdateBackground(const nsIntRect& aRect,
                                    gfxContext** aCtx);
--- a/dom/plugins/PluginLibrary.h
+++ b/dom/plugins/PluginLibrary.h
@@ -94,17 +94,16 @@ public:
                            char* argv[], NPSavedData* saved,
                            NPError* error) = 0;
 
   virtual nsresult NPP_ClearSiteData(const char* site, uint64_t flags,
                                      uint64_t maxAge) = 0;
   virtual nsresult NPP_GetSitesWithData(InfallibleTArray<nsCString>& aResult) = 0;
 
   virtual nsresult AsyncSetWindow(NPP instance, NPWindow* window) = 0;
-  virtual nsresult GetSurface(NPP instance, gfxASurface** aSurface) = 0;
   virtual nsresult GetImage(NPP instance, ImageContainer* aContainer, Image** aImage) = 0;
   virtual nsresult GetImageSize(NPP instance, nsIntSize* aSize) = 0;
   virtual bool UseAsyncPainting() = 0;
 #if defined(XP_MACOSX)
   virtual nsresult IsRemoteDrawingCoreAnimation(NPP instance, PRBool *aDrawing) = 0;
 #endif
   /**
    * The next three methods are the third leg in the trip to
--- a/dom/plugins/PluginModuleParent.cpp
+++ b/dom/plugins/PluginModuleParent.cpp
@@ -668,26 +668,16 @@ PluginModuleParent::AsyncSetWindow(NPP i
     PluginInstanceParent* i = InstCast(instance);
     if (!i)
         return NS_ERROR_FAILURE;
 
     return i->AsyncSetWindow(window);
 }
 
 nsresult
-PluginModuleParent::GetSurface(NPP instance, gfxASurface** aSurface)
-{
-    PluginInstanceParent* i = InstCast(instance);
-    if (!i)
-        return NS_ERROR_FAILURE;
-
-    return i->GetSurface(aSurface);
-}
-
-nsresult
 PluginModuleParent::GetImage(NPP instance,
                              mozilla::layers::ImageContainer* aContainer,
                              mozilla::layers::Image** aImage)
 {
     PluginInstanceParent* i = InstCast(instance);
     return !i ? NS_ERROR_FAILURE : i->GetImage(aContainer, aImage);
 }
 
--- a/dom/plugins/PluginModuleParent.h
+++ b/dom/plugins/PluginModuleParent.h
@@ -226,17 +226,16 @@ private:
                                 NPPVariable variable, void *ret_value);
     static NPError NPP_SetValue(NPP instance, NPNVariable variable,
                                 void *value);
     static void NPP_URLRedirectNotify(NPP instance, const char* url,
                                       int32_t status, void* notifyData);
 
     virtual bool HasRequiredFunctions();
     virtual nsresult AsyncSetWindow(NPP instance, NPWindow* window);
-    virtual nsresult GetSurface(NPP instance, gfxASurface** aSurface);
     virtual nsresult GetImage(NPP instance, mozilla::layers::ImageContainer* aContainer, mozilla::layers::Image** aImage);
     virtual nsresult GetImageSize(NPP instance, nsIntSize* aSize);
     NS_OVERRIDE virtual bool UseAsyncPainting() { return true; }
     NS_OVERRIDE
     virtual nsresult SetBackgroundUnknown(NPP instance);
     NS_OVERRIDE
     virtual nsresult BeginUpdateBackground(NPP instance,
                                            const nsIntRect& aRect,
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -265,33 +265,31 @@ public:
   nsEventStatus ProcessEvent(const nsGUIEvent& anEvent)
   {
     return nsEventStatus_eConsumeNoDefault;
   }
 };
 
 
 class nsPluginInstanceOwner : public nsIPluginInstanceOwner,
-                              public nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH,
                               public nsIPluginTagInfo,
                               public nsIDOMMouseListener,
                               public nsIDOMMouseMotionListener,
                               public nsIDOMKeyListener,
                               public nsIDOMFocusListener,
                               public nsIScrollPositionListener
 {
 public:
   nsPluginInstanceOwner();
   virtual ~nsPluginInstanceOwner();
 
   NS_DECL_ISUPPORTS
 
   //nsIPluginInstanceOwner interface
   NS_DECL_NSIPLUGININSTANCEOWNER
-  NS_DECL_NSIPLUGININSTANCEOWNER_MOZILLA_2_0_BRANCH
 
   NS_IMETHOD GetURL(const char *aURL, const char *aTarget,
                     nsIInputStream *aPostStream, 
                     void *aHeadersData, PRUint32 aHeadersDataLen);
 
   NS_IMETHOD ShowStatus(const PRUnichar *aStatusMsg);
 
   NPError    ShowNativeContextMenu(NPMenu* menu, void* event);
@@ -495,32 +493,21 @@ public:
              mPluginWindow->type == NPWindowTypeDrawable));
   }
 
 private:
 
   // return FALSE if LayerSurface dirty (newly created and don't have valid plugin content yet)
   PRBool IsUpToDate()
   {
-    nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = do_QueryInterface(mInstance);
-    if (!inst)
-      return PR_FALSE;
-
     nsIntSize size;
-    return NS_SUCCEEDED(inst->GetImageSize(&size)) &&
+    return NS_SUCCEEDED(mInstance->GetImageSize(&size)) &&
            size == nsIntSize(mPluginWindow->width, mPluginWindow->height);
   }
 
-  already_AddRefed<nsIPluginInstance_MOZILLA_2_0_BRANCH>
-  GetInstance()
-  {
-    nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = do_QueryInterface(mInstance);
-    return inst.forget();
-  }
-
   void FixUpURLS(const nsString &name, nsAString &value);
 
   nsPluginNativeWindow       *mPluginWindow;
   nsCOMPtr<nsIPluginInstance> mInstance;
   nsObjectFrame              *mObjectFrame; // owns nsPluginInstanceOwner
   nsCOMPtr<nsIContent>        mContent;
   nsCString                   mDocumentBase;
   char                       *mTagText;
@@ -1999,22 +1986,21 @@ nsObjectFrame::UpdateImageLayer(ImageCon
 #endif
 
   mInstanceOwner->SetCurrentImage(aContainer);
 }
 
 PRBool
 nsPluginInstanceOwner::SetCurrentImage(ImageContainer* aContainer)
 {
-  nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = do_QueryInterface(mInstance);
-  if (inst) {
+  if (mInstance) {
     nsRefPtr<Image> image;
-    // Every call to nsIPluginInstance_MOZILLA_2_0_BRANCH::GetImage() creates
+    // Every call to nsIPluginInstance::GetImage() creates
     // a new image.  See nsIPluginInstance.idl.
-    inst->GetImage(aContainer, getter_AddRefs(image));
+    mInstance->GetImage(aContainer, getter_AddRefs(image));
     if (image) {
 #ifdef XP_MACOSX
       if (image->GetFormat() == Image::MAC_IO_SURFACE && mObjectFrame) {
         MacIOSurfaceImage *oglImage = static_cast<MacIOSurfaceImage*>(image.get());
         NS_ADDREF_THIS();
         oglImage->SetUpdateCallback(&DrawPlugin, this);
         oglImage->SetDestroyCallback(&OnDestroyImage);
       }
@@ -2025,53 +2011,49 @@ nsPluginInstanceOwner::SetCurrentImage(I
   }
   aContainer->SetCurrentImage(nsnull);
   return PR_FALSE;
 }
 
 void
 nsPluginInstanceOwner::SetBackgroundUnknown()
 {
-  nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = GetInstance();
-  if (inst) {
-    inst->SetBackgroundUnknown();
+  if (mInstance) {
+    mInstance->SetBackgroundUnknown();
   }
 }
 
 already_AddRefed<gfxContext>
 nsPluginInstanceOwner::BeginUpdateBackground(const nsIntRect& aRect)
 {
   nsIntRect rect = aRect;
-  nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = GetInstance();
   nsRefPtr<gfxContext> ctx;
-  if (inst &&
-      NS_SUCCEEDED(inst->BeginUpdateBackground(&rect, getter_AddRefs(ctx)))) {
+  if (mInstance &&
+      NS_SUCCEEDED(mInstance->BeginUpdateBackground(&rect, getter_AddRefs(ctx)))) {
     return ctx.forget();
   }
   return nsnull;
 }
 
 void
 nsPluginInstanceOwner::EndUpdateBackground(gfxContext* aContext,
                                            const nsIntRect& aRect)
 {
   nsIntRect rect = aRect;
-  nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = GetInstance();
-  if (inst) {
-    inst->EndUpdateBackground(aContext, &rect);
+  if (mInstance) {
+    mInstance->EndUpdateBackground(aContext, &rect);
   }
 }
 
 nsIntSize
 nsPluginInstanceOwner::GetCurrentImageSize()
 {
-  nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = GetInstance();
   nsIntSize size(0,0);
-  if (inst) {
-    inst->GetImageSize(&size);
+  if (mInstance) {
+    mInstance->GetImageSize(&size);
   }
   return size;
 }
 
 LayerState
 nsObjectFrame::GetLayerState(nsDisplayListBuilder* aBuilder,
                              LayerManager* aManager)
 {
@@ -3303,17 +3285,16 @@ nsPluginInstanceOwner::~nsPluginInstance
  * nsISupports Implementation
  */
 
 NS_IMPL_ADDREF(nsPluginInstanceOwner)
 NS_IMPL_RELEASE(nsPluginInstanceOwner)
 
 NS_INTERFACE_MAP_BEGIN(nsPluginInstanceOwner)
   NS_INTERFACE_MAP_ENTRY(nsIPluginInstanceOwner)
-  NS_INTERFACE_MAP_ENTRY(nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH)
   NS_INTERFACE_MAP_ENTRY(nsIPluginTagInfo)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMouseListener)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMouseMotionListener)
   NS_INTERFACE_MAP_ENTRY(nsIDOMKeyListener)
   NS_INTERFACE_MAP_ENTRY(nsIDOMFocusListener)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEventListener, nsIDOMMouseListener)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIPluginInstanceOwner)
 NS_INTERFACE_MAP_END
@@ -4294,22 +4275,21 @@ NPDrawingModel nsPluginInstanceOwner::Ge
     return drawingModel;
 
   mInstance->GetDrawingModel((PRInt32*)&drawingModel);
   return drawingModel;
 }
 
 PRBool nsPluginInstanceOwner::IsRemoteDrawingCoreAnimation()
 {
-  nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = do_QueryInterface(mInstance);
-  if (!inst)
+  if (mInstance)
     return PR_FALSE;
 
   PRBool coreAnimation;
-  if (!NS_SUCCEEDED(inst->IsRemoteDrawingCoreAnimation(&coreAnimation)))
+  if (!NS_SUCCEEDED(mInstance->IsRemoteDrawingCoreAnimation(&coreAnimation)))
     return PR_FALSE;
 
   return coreAnimation;
 }
 
 NPEventModel nsPluginInstanceOwner::GetEventModel()
 {
   return mEventModel;
--- a/modules/plugin/base/public/nsIPluginHost.idl
+++ b/modules/plugin/base/public/nsIPluginHost.idl
@@ -136,26 +136,23 @@ interface nsIPluginHost : nsISupports
    *  host specified in the URL. This is used to prevent DNS-spoofing 
    *  attacks. Can be defaulted to NULL meaning use the host in the URL.
    * @param referrer - the referring URL (may be NULL)
    * @param forceJSEnabled - forces JavaScript to be enabled for 'javascript:'
    *  URLs, even if the user currently has JavaScript disabled (usually 
    *  specify PR_FALSE) 
    * @result - NS_OK if this operation was successful
    */
-%{C++
-  NS_IMETHOD
-  GetURL(nsISupports* pluginInst,
-         const char* url,
-         const char* target = NULL,
-         nsIPluginStreamListener* streamListener = NULL,
-         const char* altHost = NULL,
-         const char* referrer = NULL,
-         PRBool forceJSEnabled = PR_FALSE) = 0;
-%}
+  [noscript] void getURL(in nsISupports pluginInt,
+                         in string url,
+                         in string target,
+                         in nsIPluginStreamListener streamListener,
+                         in string altHost,
+                         in string referrer,
+                         in boolean forceJSEnabled);
 
   /**
    * Posts to a URL with post data and/or post headers.
    *
    * (Corresponds to NPN_PostURL and NPN_PostURLNotify.)
    *
    * @param pluginInst - the plugin making the request. If NULL, the URL
    *  is fetched in the background.
@@ -178,31 +175,28 @@ interface nsIPluginHost : nsISupports
    *  specify PR_FALSE) 
    * @param postHeadersLength - the length of postHeaders (if non-NULL)
    * @param postHeaders - the headers to POST. Must be in the form of
    * "HeaderName: HeaderValue\r\n".  Each header, including the last,
    * must be followed by "\r\n".  NULL specifies that there are no
    * post headers
    * @result - NS_OK if this operation was successful
    */
-%{C++
-  NS_IMETHOD
-  PostURL(nsISupports* pluginInst,
-          const char* url,
-          PRUint32 postDataLen,
-          const char* postData,
-          PRBool isFile = PR_FALSE,
-          const char* target = NULL,
-          nsIPluginStreamListener* streamListener = NULL,
-          const char* altHost = NULL,
-          const char* referrer = NULL,
-          PRBool forceJSEnabled = PR_FALSE,
-          PRUint32 postHeadersLength = 0,
-          const char* postHeaders = NULL) = 0;
-%}
+  [noscript] void postURL(in nsISupports pluginInst,
+                          in string url,
+                          in PRUint32 postDataLen,
+                          in string postData,
+                          in boolean isFile,
+                          in string target,
+                          in nsIPluginStreamListener streamListener,
+                          in string altHost,
+                          in string referrer,
+                          in boolean forceJSEnabled,
+                          in PRUint32 postHeadersLength,
+                          in string postHeaders);
 
   /**
    * Returns the proxy info for a given URL. The caller is required to
    * free the resulting memory with nsIMalloc::Free. The result will be in the
    * following format
    * 
    *   i)   "DIRECT"  -- no proxy
    *   ii)  "PROXY xxx.xxx.xxx.xxx"   -- use proxy
@@ -279,29 +273,19 @@ interface nsIPluginHost : nsISupports
 
   /**
    * Get the plugin tag associated with a given plugin instance.
    * @param aInstance the plugin instance object
    * @return plugin tag object
    */
   [noscript] nsIPluginTag getPluginTagForInstance(in nsIPluginInstance aInstance);
   
-%{C++
-  virtual void AddIdleTimeTarget(nsIPluginInstanceOwner* objectFrame, PRBool isVisible) = 0;
-  virtual void RemoveIdleTimeTarget(nsIPluginInstanceOwner* objectFrame) = 0;
-%}
-};
+  [noscript, notxpcom] void addIdleTimeTarget(in nsIPluginInstanceOwner objectFrame, in boolean isVisible);
+  [noscript, notxpcom] void removeIdleTimeTarget(in nsIPluginInstanceOwner objectFrame);
 
-/*
- * Methods for clearing plugin private data. These should be moved onto
- * nsIPluginHost proper post-Gecko 2.0.
- */
-[scriptable, uuid(0b0a2fb8-dc2b-4df2-b721-4b7a4008df6c)]
-interface nsIPluginHost_MOZILLA_2_0_BRANCH : nsISupports
-{
   /*
    * Flags for use with clearSiteData.
    *
    * FLAG_CLEAR_ALL: clear all data associated with a site.
    * FLAG_CLEAR_CACHE: clear cached data that can be retrieved again without
    *                   loss of functionality. To be used out of concern for
    *                   space and not necessarily privacy.
    */
--- a/modules/plugin/base/public/nsIPluginInstance.idl
+++ b/modules/plugin/base/public/nsIPluginInstance.idl
@@ -249,47 +249,38 @@ interface nsIPluginInstance : nsISupport
     void asyncSetWindow(in NPWindowPtr aWindow);
 
     /**
      * Call this each time after the plugin has been painted to the screen
      */
     void notifyPainted();
 
     /**
-     * This should return a valid gfxASurface pointer, or null if there is nothing to render yet.
-     * NO LONGER USED. Do not call.
-     */
-    void getSurface(out gfxASurfacePtr aSurface);
-
-    /**
      * @return true if plugin module supports async rendering
      */
     PRBool useAsyncPainting();
-};
-
 
-// XXX kill me after branching
-[noscript, uuid(24235105-ac5f-483b-86ec-7c9446ddcb8a)]
-interface nsIPluginInstance_MOZILLA_2_0_BRANCH : nsIPluginInstance
-{
     PRBool isRemoteDrawingCoreAnimation();
+
     /**
      * Returns a new Image object which draws an asynchronously-rendered
      * plugin. The Image is created using aContainer.
      * Fails if the plugin is using async rendering but no image has yet
      * been received, or if the plugin is not using async rendering.
      */
     void getImage(in ImageContainerPtr aContainer, out ImagePtr aImage);
+
     /**
      * Returns the size of the Image object that would be created if we called
      * getImage.
      * Fails if the plugin is using async rendering but no image has yet
      * been received, or if the plugin is not using async rendering.
      */
     void getImageSize(in nsIntSizePtr aSize);
+
     /**
      * This is the second leg in the trip to PluginInstanceParent.  It
      * approximately follows the ReadbackSink API.
      */
     void setBackgroundUnknown();
     void beginUpdateBackground(in nsIntRectPtr rect, out gfxContextPtr ctx);
     void endUpdateBackground(in gfxContextPtr ctx, in nsIntRectPtr rect);
 };
--- a/modules/plugin/base/public/nsIPluginInstanceOwner.idl
+++ b/modules/plugin/base/public/nsIPluginInstanceOwner.idl
@@ -143,21 +143,14 @@ interface nsIPluginInstanceOwner : nsISu
                                double *destX, double *destY, NPCoordinateSpace destSpace) = 0;
 %}
 
   void setEventModel(in PRInt32 eventModel);
 
 %{C++
   virtual void SendIdleEvent() = 0;
 %}
-};
 
-/**
- * This interface extends nsIPluginInstanceOwner for the 2.0 branch
- */
-[uuid(20504739-4519-45f3-a8f7-fc8afba7ea87)]
-interface nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH : nsISupports
-{
   /**
    * Call NPP_SetWindow on the plugin.
    */
   void setWindow();
 };
--- a/modules/plugin/base/src/PluginPRLibrary.cpp
+++ b/modules/plugin/base/src/PluginPRLibrary.cpp
@@ -242,22 +242,16 @@ nsresult
 PluginPRLibrary::AsyncSetWindow(NPP instance, NPWindow* window)
 {
   nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)instance->ndata;
   NS_ENSURE_TRUE(inst, NS_ERROR_NULL_POINTER);
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
-PluginPRLibrary::GetSurface(NPP instance, gfxASurface** aSurface)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-nsresult
 PluginPRLibrary::GetImage(NPP instance, ImageContainer* aContainer, Image** aImage)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
 PluginPRLibrary::GetImageSize(NPP instance, nsIntSize* aSize)
 {
--- a/modules/plugin/base/src/PluginPRLibrary.h
+++ b/modules/plugin/base/src/PluginPRLibrary.h
@@ -135,17 +135,16 @@ public:
                              char* argv[], NPSavedData* saved,
                              NPError* error);
 
     virtual nsresult NPP_ClearSiteData(const char* site, uint64_t flags,
                                        uint64_t maxAge);
     virtual nsresult NPP_GetSitesWithData(InfallibleTArray<nsCString>& result);
 
     virtual nsresult AsyncSetWindow(NPP instance, NPWindow* window);
-    virtual nsresult GetSurface(NPP instance, gfxASurface** aSurface);
     virtual nsresult GetImage(NPP instance, ImageContainer* aContainer, Image** aImage);
     virtual nsresult GetImageSize(NPP instance, nsIntSize* aSize);
     NS_OVERRIDE virtual bool UseAsyncPainting() { return false; }
 #if defined(XP_MACOSX)
     virtual nsresult IsRemoteDrawingCoreAnimation(NPP instance, PRBool *aDrawing);
 #endif
     NS_OVERRIDE
     virtual nsresult SetBackgroundUnknown(NPP instance);
--- a/modules/plugin/base/src/nsNPAPIPlugin.cpp
+++ b/modules/plugin/base/src/nsNPAPIPlugin.cpp
@@ -614,23 +614,24 @@ MakeNewNPAPIStreamInternal(NPP npp, cons
     if (listener) {
       static_cast<nsNPAPIPluginStreamListener*>(listener.get())->SetCallNotify(PR_FALSE);
     }
   }
 
   switch (type) {
   case eNPPStreamTypeInternal_Get:
     {
-      if (NS_FAILED(pluginHost->GetURL(inst, relativeURL, target, listener)))
+      if (NS_FAILED(pluginHost->GetURL(inst, relativeURL, target, listener,
+                                       NULL, NULL, false)))
         return NPERR_GENERIC_ERROR;
       break;
     }
   case eNPPStreamTypeInternal_Post:
     {
-      if (NS_FAILED(pluginHost->PostURL(inst, relativeURL, len, buf, file, target, listener)))
+      if (NS_FAILED(pluginHost->PostURL(inst, relativeURL, len, buf, file, target, listener, NULL, NULL, false, 0, NULL)))
         return NPERR_GENERIC_ERROR;
       break;
     }
   default:
     NS_ERROR("how'd I get here");
   }
 
   if (listener) {
--- a/modules/plugin/base/src/nsNPAPIPluginInstance.cpp
+++ b/modules/plugin/base/src/nsNPAPIPluginInstance.cpp
@@ -60,17 +60,17 @@
 #include "nsPluginStreamListenerPeer.h"
 
 using namespace mozilla;
 using namespace mozilla::plugins::parent;
 
 static NS_DEFINE_IID(kIOutputStreamIID, NS_IOUTPUTSTREAM_IID);
 static NS_DEFINE_IID(kIPluginStreamListenerIID, NS_IPLUGINSTREAMLISTENER_IID);
 
-NS_IMPL_ISUPPORTS2(nsNPAPIPluginInstance, nsIPluginInstance, nsIPluginInstance_MOZILLA_2_0_BRANCH)
+NS_IMPL_ISUPPORTS1(nsNPAPIPluginInstance, nsIPluginInstance)
 
 nsNPAPIPluginInstance::nsNPAPIPluginInstance(nsNPAPIPlugin* plugin)
   :
 #ifdef XP_MACOSX
 #ifdef NP_NO_QUICKDRAW
     mDrawingModel(NPDrawingModelCoreGraphics),
 #else
     mDrawingModel(NPDrawingModelQuickDraw),
@@ -874,29 +874,16 @@ nsNPAPIPluginInstance::AsyncSetWindow(NP
   AutoPluginLibraryCall library(this);
   if (!library)
     return NS_ERROR_FAILURE;
 
   return library->AsyncSetWindow(&mNPP, window);
 }
 
 NS_IMETHODIMP
-nsNPAPIPluginInstance::GetSurface(gfxASurface** aSurface)
-{
-  if (RUNNING != mRunning)
-    return NS_OK;
-
-  AutoPluginLibraryCall library(this);
-  if (!library)
-    return NS_ERROR_FAILURE;
-
-  return library->GetSurface(&mNPP, aSurface);
-}
-
-NS_IMETHODIMP
 nsNPAPIPluginInstance::GetImage(ImageContainer* aContainer, Image** aImage)
 {
   *aImage = nsnull;
 
   if (RUNNING != mRunning)
     return NS_OK;
 
   AutoPluginLibraryCall library(this);
--- a/modules/plugin/base/src/nsNPAPIPluginInstance.h
+++ b/modules/plugin/base/src/nsNPAPIPluginInstance.h
@@ -62,25 +62,24 @@ class nsNPAPITimer
 {
 public:
   NPP npp;
   uint32_t id;
   nsCOMPtr<nsITimer> timer;
   void (*callback)(NPP npp, uint32_t timerID);
 };
 
-class nsNPAPIPluginInstance : public nsIPluginInstance_MOZILLA_2_0_BRANCH
+class nsNPAPIPluginInstance : public nsIPluginInstance
 {
 private:
   typedef mozilla::PluginLibrary PluginLibrary;
 
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIPLUGININSTANCE
-  NS_DECL_NSIPLUGININSTANCE_MOZILLA_2_0_BRANCH
 
   nsNPAPIPlugin* GetPlugin();
 
   nsresult GetNPP(NPP * aNPP);
 
   void SetURI(nsIURI* uri);
   nsIURI* GetURI();
 
--- a/modules/plugin/base/src/nsPluginHost.cpp
+++ b/modules/plugin/base/src/nsPluginHost.cpp
@@ -426,19 +426,18 @@ nsPluginHost::nsPluginHost()
 nsPluginHost::~nsPluginHost()
 {
   PLUGIN_LOG(PLUGIN_LOG_ALWAYS,("nsPluginHost::dtor\n"));
 
   Destroy();
   sInst = nsnull;
 }
 
-NS_IMPL_ISUPPORTS5(nsPluginHost,
+NS_IMPL_ISUPPORTS4(nsPluginHost,
                    nsIPluginHost,
-                   nsIPluginHost_MOZILLA_2_0_BRANCH,
                    nsIObserver,
                    nsITimerCallback,
                    nsISupportsWeakReference)
 
 nsPluginHost*
 nsPluginHost::GetInst()
 {
   if (!sInst) {
@@ -1103,19 +1102,17 @@ nsPluginHost::DoInstantiateEmbeddedPlugi
   // if we are here then we have loaded a plugin for this mimetype
   nsNPAPIPluginInstance *instance = static_cast<nsNPAPIPluginInstance*>(instanceCOMPtr.get());
 
   if (instance) {
     instance->Start();
     aOwner->CreateWidget();
 
     // If we've got a native window, the let the plugin know about it.
-    nsCOMPtr<nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH> owner = do_QueryInterface(aOwner);
-    if (owner)
-      owner->SetWindow();
+    aOwner->SetWindow();
 
     // create an initial stream with data
     // don't make the stream if it's a java applet or we don't have SRC or DATA attribute
     PRBool havedata = PR_FALSE;
 
     nsCOMPtr<nsIPluginTagInfo> pti(do_QueryInterface(aOwner, &rv));
 
     if (pti) {
@@ -1180,25 +1177,22 @@ NS_IMETHODIMP nsPluginHost::InstantiateF
     NPWindow* win = nsnull;
     aOwner->GetWindow(win);
 
     if (win && instance) {
       instance->Start();
       aOwner->CreateWidget();
 
       // If we've got a native window, the let the plugin know about it.
-      nsCOMPtr<nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH> owner = do_QueryInterface(aOwner);
-      if (owner)
-        owner->SetWindow();
+      aOwner->SetWindow();
 
       rv = NewFullPagePluginStream(aURI, instance, aStreamListener);
 
       // If we've got a native window, the let the plugin know about it.
-      if (owner)
-        owner->SetWindow();
+      aOwner->SetWindow();
     }
   }
 
   PLUGIN_LOG(PLUGIN_LOG_NORMAL,
   ("nsPluginHost::InstantiateFullPagePlugin End mime=%s, rv=%d, owner=%p, url=%s\n",
   aMimeType, rv, aOwner, urlSpec.get()));
 
   return rv;
@@ -1243,19 +1237,17 @@ nsresult nsPluginHost::FindStoppedPlugin
   if (instance && !instance->IsRunning()) {
     aOwner->SetInstance(instance);
     instance->SetOwner(aOwner);
 
     instance->Start();
     aOwner->CreateWidget();
 
     // If we've got a native window, the let the plugin know about it.
-    nsCOMPtr<nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH> owner = do_QueryInterface(aOwner);
-    if (owner)
-      owner->SetWindow();
+    aOwner->SetWindow();
 
     return NS_OK;
   }
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP nsPluginHost::SetUpPluginInstance(const char *aMimeType,
                                                 nsIURI *aURL,
--- a/modules/plugin/base/src/nsPluginHost.h
+++ b/modules/plugin/base/src/nsPluginHost.h
@@ -85,58 +85,33 @@ public:
   PRInt64     mLastModifiedTime;
   bool        mSeen;
   
   nsRefPtr<nsInvalidPluginTag> mPrev;
   nsRefPtr<nsInvalidPluginTag> mNext;
 };
 
 class nsPluginHost : public nsIPluginHost,
-                     public nsIPluginHost_MOZILLA_2_0_BRANCH,
                      public nsIObserver,
                      public nsITimerCallback,
                      public nsSupportsWeakReference
 {
 public:
   nsPluginHost();
   virtual ~nsPluginHost();
 
   static nsPluginHost* GetInst();
 
   NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIPLUGINHOST
-  NS_DECL_NSIPLUGINHOST_MOZILLA_2_0_BRANCH
   NS_DECL_NSIOBSERVER
   NS_DECL_NSITIMERCALLBACK
 
-  NS_IMETHOD
-  GetURL(nsISupports* pluginInst, 
-         const char* url, 
-         const char* target = NULL,
-         nsIPluginStreamListener* streamListener = NULL,
-         const char* altHost = NULL,
-         const char* referrer = NULL,
-         PRBool forceJSEnabled = PR_FALSE);
-  
-  NS_IMETHOD
-  PostURL(nsISupports* pluginInst,
-          const char* url,
-          PRUint32 postDataLen, 
-          const char* postData,
-          PRBool isFile = PR_FALSE,
-          const char* target = NULL,
-          nsIPluginStreamListener* streamListener = NULL,
-          const char* altHost = NULL, 
-          const char* referrer = NULL,
-          PRBool forceJSEnabled = PR_FALSE,
-          PRUint32 postHeadersLength = 0, 
-          const char* postHeaders = NULL);
-
   nsresult
   NewPluginURLStream(const nsString& aURL, 
                      nsNPAPIPluginInstance *aInstance, 
                      nsIPluginStreamListener *aListener,
                      nsIInputStream *aPostStream = nsnull,
                      const char *aHeadersData = nsnull, 
                      PRUint32 aHeadersDataLen = 0);
 
@@ -168,19 +143,16 @@ public:
   // checks whether aTag is a "java" plugin tag (a tag for a plugin
   // that does Java)
   static PRBool IsJavaMIMEType(const char *aType);
 
   static nsresult GetPrompt(nsIPluginInstanceOwner *aOwner, nsIPrompt **aPrompt);
 
   static nsresult PostPluginUnloadEvent(PRLibrary* aLibrary);
 
-  void AddIdleTimeTarget(nsIPluginInstanceOwner* objectFrame, PRBool isVisible);
-  void RemoveIdleTimeTarget(nsIPluginInstanceOwner* objectFrame);
-
   void PluginCrashed(nsNPAPIPlugin* plugin,
                      const nsAString& pluginDumpID,
                      const nsAString& browserDumpID);
 
   nsNPAPIPluginInstance *FindInstance(const char *mimetype);
   nsNPAPIPluginInstance *FindStoppedInstance(const char * url);
   nsNPAPIPluginInstance *FindOldestStoppedInstance();
   PRUint32 StoppedInstanceCount();
--- a/modules/plugin/base/src/nsPluginStreamListenerPeer.cpp
+++ b/modules/plugin/base/src/nsPluginStreamListenerPeer.cpp
@@ -667,19 +667,17 @@ nsPluginStreamListenerPeer::OnStartReque
       
       if (NS_OK == rv) {
         mOwner->GetInstance(getter_AddRefs(pluginInstCOMPtr));
         mPluginInstance = static_cast<nsNPAPIPluginInstance*>(pluginInstCOMPtr.get());
         if (mPluginInstance) {
           mPluginInstance->Start();
           mOwner->CreateWidget();
           // If we've got a native window, the let the plugin know about it.
-          nsCOMPtr<nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH> owner = do_QueryInterface(mOwner);
-          if (owner)
-            owner->SetWindow();
+          mOwner->SetWindow();
         }
       }
     }
   }
   
   // Set up the stream listener...
   rv = SetUpStreamListener(request, aURL);
   if (NS_FAILED(rv)) return rv;
@@ -871,19 +869,17 @@ nsresult nsPluginStreamListenerPeer::Ser
     // Should call GetPluginPort() here.
     // This part is copied from nsPluginInstanceOwner::GetPluginPort(). 
     nsCOMPtr<nsIWidget> widget;
     ((nsPluginNativeWindow*)window)->GetPluginWidget(getter_AddRefs(widget));
     if (widget) {
       window->window = widget->GetNativeData(NS_NATIVE_PLUGIN_PORT);
     }
 #endif
-    nsCOMPtr<nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH> owner = do_QueryInterface(mOwner);
-    if (owner)
-      owner->SetWindow();
+    mOwner->SetWindow();
   }
   
   mSeekable = PR_FALSE;
   mPStreamListener->OnStartBinding(this);
   mStreamOffset = 0;
   
   // force the plugin to use stream as file
   mStreamType = NP_ASFILE;
--- a/modules/plugin/test/mochitest/test_clear_site_data.html
+++ b/modules/plugin/test/mochitest/test_clear_site_data.html
@@ -7,17 +7,17 @@
 </head>
 <body>
   <embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
 
   <script class="testbody" type="application/javascript">
     netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
     SimpleTest.waitForExplicitFinish();
 
-    const pluginHostIface = Components.interfaces.nsIPluginHost_MOZILLA_2_0_BRANCH;
+    const pluginHostIface = Components.interfaces.nsIPluginHost;
     var pluginHost = Components.classes["@mozilla.org/plugin/host;1"].
                      getService(pluginHostIface);
     const FLAG_CLEAR_ALL = pluginHostIface.FLAG_CLEAR_ALL;
     const FLAG_CLEAR_CACHE = pluginHostIface.FLAG_CLEAR_CACHE;
 
     // Make sure clearing by timerange is supported.
     var p = document.getElementById("plugin1");
     p.setSitesWithDataCapabilities(true);