content/html/document/src/PluginDocument.cpp
author Brian Nicholson <bnicholson@mozilla.com>
Thu, 09 Aug 2012 23:30:46 -0700
changeset 102053 b5ae446888f54480e2d20e59dc1b8723799a5cbb
parent 101584 40a8737b62a1f1c74deac8cb4075fc316ea9799d
child 104106 3d9424eb6eb473cfd14309fd635ff7d6e29322c2
child 106637 97e8aecf1730e4ac12590ce33fd339ecf0aa8ec4
permissions -rw-r--r--
Bug 779796 - Part 6: Remove article generator function in Readability.js. r=lucasr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
     1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
94475
Gervase Markham <gerv@gerv.net>
parents: 90598
diff changeset
     2
/* This Source Code Form is subject to the terms of the Mozilla Public
Gervase Markham <gerv@gerv.net>
parents: 90598
diff changeset
     3
 * License, v. 2.0. If a copy of the MPL was not distributed with this
Gervase Markham <gerv@gerv.net>
parents: 90598
diff changeset
     4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
     5
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
     6
#include "MediaDocument.h"
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
     7
#include "nsIPluginDocument.h"
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
     8
#include "nsGkAtoms.h"
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
     9
#include "nsIPresShell.h"
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    10
#include "nsIObjectFrame.h"
69649
5ffdf4967deca4a6de8ca3f6ead80e7ea3df4a65 Bug 637253: Remove nsIPluginInstance interface. r=bsmedberg
Josh Aas <joshmoz@gmail.com>
parents: 58493
diff changeset
    11
#include "nsNPAPIPluginInstance.h"
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    12
#include "nsIDocShellTreeItem.h"
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    13
#include "nsNodeInfoManager.h"
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    14
#include "nsContentCreatorFunctions.h"
4838
2e005a9a0a72b1b2b7950e1cfea69e8a6dda5b9e Make HTML content objects use QI tables. Bug 389797, r+sr=jst, a=sicking.
bzbarsky@mit.edu
parents: 4164
diff changeset
    15
#include "nsContentPolicyUtils.h"
2e005a9a0a72b1b2b7950e1cfea69e8a6dda5b9e Make HTML content objects use QI tables. Bug 389797, r+sr=jst, a=sicking.
bzbarsky@mit.edu
parents: 4164
diff changeset
    16
#include "nsIPropertyBag2.h"
41930
f73367a60951078c79787dc386c5a51b5fda6445 Bug 562971. Include Element.h as mozilla/dom/Element.h and don't use 'using namespace' quite as much. r=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 41634
diff changeset
    17
#include "mozilla/dom/Element.h"
85844
15b00ab7f22d745ef331d89e766a261c770fd1d3 Bug 90268: Change plugin instance ownership from layout to content. r=roc r=bsmedberg
Josh Aas <joshmoz@gmail.com>
parents: 85285
diff changeset
    18
#include "nsObjectLoadingContent.h"
85285
6ae43e3c400be7d33ba7b60c7e94cc1ff12c31d0 Bug 719917. Add some more network and plugin related SAMPLE_LABELs. r=bgirard
Jeff Muizelaar <jmuizelaar@mozilla.com>
parents: 78840
diff changeset
    19
#include "sampler.h"
41634
bc10dcdc3b1e27e259ca1c7efa6c27aeea7de334 Bug 562688 part 4. Change GetRootContent and the like to return Elements. r=jst, sr=sicking
Boris Zbarsky <bzbarsky@mit.edu>
parents: 36655
diff changeset
    20
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    21
namespace mozilla {
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    22
namespace dom {
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    23
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    24
class PluginDocument : public MediaDocument
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    25
                     , public nsIPluginDocument
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    26
{
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    27
public:
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    28
  PluginDocument();
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    29
  virtual ~PluginDocument();
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    30
4838
2e005a9a0a72b1b2b7950e1cfea69e8a6dda5b9e Make HTML content objects use QI tables. Bug 389797, r+sr=jst, a=sicking.
bzbarsky@mit.edu
parents: 4164
diff changeset
    31
  NS_DECL_ISUPPORTS_INHERITED
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    32
  NS_DECL_NSIPLUGINDOCUMENT
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    33
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    34
  virtual nsresult StartDocumentLoad(const char*         aCommand,
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    35
                                     nsIChannel*         aChannel,
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    36
                                     nsILoadGroup*       aLoadGroup,
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    37
                                     nsISupports*        aContainer,
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    38
                                     nsIStreamListener** aDocListener,
77799
e7854b4d29ba905ae3994f821b160c989bac4260 Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
Michael Wu <mwu@mozilla.com>
parents: 76165
diff changeset
    39
                                     bool                aReset = true,
100844
b5c4b792f3f2a047e3517472d72842a76afb77cd Bug 777292 part 2 - Change all nsnull to nullptr
Aryeh Gregor <ayg@aryeh.name>
parents: 100734
diff changeset
    40
                                     nsIContentSink*     aSink = nullptr);
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    41
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    42
  virtual void SetScriptGlobalObject(nsIScriptGlobalObject* aScriptGlobalObject);
77799
e7854b4d29ba905ae3994f821b160c989bac4260 Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
Michael Wu <mwu@mozilla.com>
parents: 76165
diff changeset
    43
  virtual bool CanSavePresentation(nsIRequest *aNewRequest);
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    44
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    45
  const nsCString& GetType() const { return mMimeType; }
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    46
  nsIContent*      GetPluginContent() { return mPluginContent; }
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    47
22254
fdb12933052c4b060cce7afcef567d017233e39e Bug 466084. Fix reframing of plugin documents to reinstantiate the plugin correctly. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 22219
diff changeset
    48
  void AllowNormalInstantiation() {
78840
ec7577dec4fceef0ac2717416d9c48289402d935 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Ehsan Akhgari <ehsan@mozilla.com>
parents: 77799
diff changeset
    49
    mWillHandleInstantiation = false;
20110
9395c3a493b2136290adbd9bd7132f7662a93774 Bug 458100. Make sure that we'll also instantiate the plug-in even if the nsPluginDocument has no presshell yet at OnStartRequest time. Thanks to Evgeny <evg.salmin@gmail.com> for pointing out the problem. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 19747
diff changeset
    50
  }
9395c3a493b2136290adbd9bd7132f7662a93774 Bug 458100. Make sure that we'll also instantiate the plug-in even if the nsPluginDocument has no presshell yet at OnStartRequest time. Thanks to Evgeny <evg.salmin@gmail.com> for pointing out the problem. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 19747
diff changeset
    51
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    52
  void StartLayout() { MediaDocument::StartLayout(); }
23512
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
    53
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    54
  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(PluginDocument, MediaDocument)
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    55
protected:
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    56
  nsresult CreateSyntheticPluginDocument();
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    57
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    58
  nsCOMPtr<nsIContent>                     mPluginContent;
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    59
  nsRefPtr<MediaDocumentStreamListener>    mStreamListener;
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    60
  nsCString                                mMimeType;
20110
9395c3a493b2136290adbd9bd7132f7662a93774 Bug 458100. Make sure that we'll also instantiate the plug-in even if the nsPluginDocument has no presshell yet at OnStartRequest time. Thanks to Evgeny <evg.salmin@gmail.com> for pointing out the problem. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 19747
diff changeset
    61
9395c3a493b2136290adbd9bd7132f7662a93774 Bug 458100. Make sure that we'll also instantiate the plug-in even if the nsPluginDocument has no presshell yet at OnStartRequest time. Thanks to Evgeny <evg.salmin@gmail.com> for pointing out the problem. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 19747
diff changeset
    62
  // Hack to handle the fact that plug-in loading lives in frames and that the
9395c3a493b2136290adbd9bd7132f7662a93774 Bug 458100. Make sure that we'll also instantiate the plug-in even if the nsPluginDocument has no presshell yet at OnStartRequest time. Thanks to Evgeny <evg.salmin@gmail.com> for pointing out the problem. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 19747
diff changeset
    63
  // frames may not be around when we need to instantiate.  Once plug-in
9395c3a493b2136290adbd9bd7132f7662a93774 Bug 458100. Make sure that we'll also instantiate the plug-in even if the nsPluginDocument has no presshell yet at OnStartRequest time. Thanks to Evgeny <evg.salmin@gmail.com> for pointing out the problem. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 19747
diff changeset
    64
  // loading moves to content, this can all go away.
77799
e7854b4d29ba905ae3994f821b160c989bac4260 Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
Michael Wu <mwu@mozilla.com>
parents: 76165
diff changeset
    65
  bool                                     mWillHandleInstantiation;
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    66
};
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    67
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    68
class PluginStreamListener : public MediaDocumentStreamListener
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    69
{
23512
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
    70
public:
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    71
  PluginStreamListener(PluginDocument* doc)
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    72
    : MediaDocumentStreamListener(doc)
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    73
    , mPluginDoc(doc)
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    74
  {}
23512
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
    75
  NS_IMETHOD OnStartRequest(nsIRequest* request, nsISupports *ctxt);
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
    76
private:
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
    77
  nsresult SetupPlugin();
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
    78
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    79
  nsRefPtr<PluginDocument> mPluginDoc;
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    80
};
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    81
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    82
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    83
NS_IMETHODIMP
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    84
PluginStreamListener::OnStartRequest(nsIRequest* request, nsISupports *ctxt)
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
    85
{
85285
6ae43e3c400be7d33ba7b60c7e94cc1ff12c31d0 Bug 719917. Add some more network and plugin related SAMPLE_LABELs. r=bgirard
Jeff Muizelaar <jmuizelaar@mozilla.com>
parents: 78840
diff changeset
    86
  SAMPLE_LABEL("PluginStreamListener", "OnStartRequest");
23512
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
    87
  // Have to set up our plugin stuff before we call OnStartRequest, so
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
    88
  // that the plugin listener can get that call.
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
    89
  nsresult rv = SetupPlugin();
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
    90
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
    91
  NS_ASSERTION(NS_FAILED(rv) || mNextStream,
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
    92
               "We should have a listener by now");
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    93
  nsresult rv2 = MediaDocumentStreamListener::OnStartRequest(request, ctxt);
23512
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
    94
  return NS_SUCCEEDED(rv) ? rv2 : rv;
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
    95
}
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
    96
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
    97
nsresult
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
    98
PluginStreamListener::SetupPlugin()
23512
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
    99
{
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
   100
  NS_ENSURE_TRUE(mDocument, NS_ERROR_FAILURE);
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
   101
  mPluginDoc->StartLayout();
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   102
4164
81977eb555a1ab6a8a0db9f7f5e277dc1af32487 Flush layout before starting to pump data into plug-ins if we started the data
bzbarsky@mit.edu
parents: 981
diff changeset
   103
  nsCOMPtr<nsIContent> embed = mPluginDoc->GetPluginContent();
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   104
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   105
  // Now we have a frame for our <embed>, start the load
46225
0dd4e086cea5368862bf2a337d518114944e905f Bug 538362 - rename nsIDocument::GetPrimaryShell to nsIDocument::GetShell. r=smaug
Ms2ger@gmail.com
parents: 41930
diff changeset
   106
  nsCOMPtr<nsIPresShell> shell = mDocument->GetShell();
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   107
  if (!shell) {
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   108
    // Can't instantiate w/o a shell
22254
fdb12933052c4b060cce7afcef567d017233e39e Bug 466084. Fix reframing of plugin documents to reinstantiate the plugin correctly. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 22219
diff changeset
   109
    mPluginDoc->AllowNormalInstantiation();
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   110
    return NS_BINDING_ABORTED;
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   111
  }
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   112
4164
81977eb555a1ab6a8a0db9f7f5e277dc1af32487 Flush layout before starting to pump data into plug-ins if we started the data
bzbarsky@mit.edu
parents: 981
diff changeset
   113
  // Flush out layout before we go to instantiate, because some
81977eb555a1ab6a8a0db9f7f5e277dc1af32487 Flush layout before starting to pump data into plug-ins if we started the data
bzbarsky@mit.edu
parents: 981
diff changeset
   114
  // plug-ins depend on NPP_SetWindow() being called early enough and
81977eb555a1ab6a8a0db9f7f5e277dc1af32487 Flush layout before starting to pump data into plug-ins if we started the data
bzbarsky@mit.edu
parents: 981
diff changeset
   115
  // nsObjectFrame does that at the end of reflow.
81977eb555a1ab6a8a0db9f7f5e277dc1af32487 Flush layout before starting to pump data into plug-ins if we started the data
bzbarsky@mit.edu
parents: 981
diff changeset
   116
  shell->FlushPendingNotifications(Flush_Layout);
81977eb555a1ab6a8a0db9f7f5e277dc1af32487 Flush layout before starting to pump data into plug-ins if we started the data
bzbarsky@mit.edu
parents: 981
diff changeset
   117
85844
15b00ab7f22d745ef331d89e766a261c770fd1d3 Bug 90268: Change plugin instance ownership from layout to content. r=roc r=bsmedberg
Josh Aas <joshmoz@gmail.com>
parents: 85285
diff changeset
   118
  nsCOMPtr<nsIObjectLoadingContent> olc(do_QueryInterface(embed));
15b00ab7f22d745ef331d89e766a261c770fd1d3 Bug 90268: Change plugin instance ownership from layout to content. r=roc r=bsmedberg
Josh Aas <joshmoz@gmail.com>
parents: 85285
diff changeset
   119
  if (!olc) {
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   120
    return NS_ERROR_UNEXPECTED;
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   121
  }
85844
15b00ab7f22d745ef331d89e766a261c770fd1d3 Bug 90268: Change plugin instance ownership from layout to content. r=roc r=bsmedberg
Josh Aas <joshmoz@gmail.com>
parents: 85285
diff changeset
   122
  nsObjectLoadingContent* olcc = static_cast<nsObjectLoadingContent*>(olc.get());
101584
40a8737b62a1f1c74deac8cb4075fc316ea9799d Bug 745030 - Refactor nsObjectLoadingContent loading paths. r=josh,sr=jst
John Schoenick <jschoenick@mozilla.com>
parents: 100844
diff changeset
   123
  nsresult rv = olcc->InstantiatePluginInstance();
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   124
  if (NS_FAILED(rv)) {
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   125
    return rv;
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   126
  }
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   127
22254
fdb12933052c4b060cce7afcef567d017233e39e Bug 466084. Fix reframing of plugin documents to reinstantiate the plugin correctly. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 22219
diff changeset
   128
  // Now that we're done, allow normal instantiation in the future
fdb12933052c4b060cce7afcef567d017233e39e Bug 466084. Fix reframing of plugin documents to reinstantiate the plugin correctly. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 22219
diff changeset
   129
  // (say if there's a reframe of this entire presentation).
fdb12933052c4b060cce7afcef567d017233e39e Bug 466084. Fix reframing of plugin documents to reinstantiate the plugin correctly. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 22219
diff changeset
   130
  mPluginDoc->AllowNormalInstantiation();
fdb12933052c4b060cce7afcef567d017233e39e Bug 466084. Fix reframing of plugin documents to reinstantiate the plugin correctly. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 22219
diff changeset
   131
23512
96e5551239e6cb1f63a120eccf86dd5f58f61451 Bug 472239. Make sure to set up our listener before trying to call OnStartRequest on it. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 23511
diff changeset
   132
  return NS_OK;
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   133
}
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   134
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   135
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   136
  // NOTE! nsDocument::operator new() zeroes out all members, so don't
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   137
  // bother initializing members to 0.
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   138
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   139
PluginDocument::PluginDocument()
78840
ec7577dec4fceef0ac2717416d9c48289402d935 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Ehsan Akhgari <ehsan@mozilla.com>
parents: 77799
diff changeset
   140
  : mWillHandleInstantiation(true)
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   141
{
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   142
}
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   143
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   144
PluginDocument::~PluginDocument()
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   145
{
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   146
}
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   147
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   148
NS_IMPL_CYCLE_COLLECTION_CLASS(PluginDocument)
22219
d000c016b3233bcd6ac67c6939ba848c668a336c Bug 463424 - Make nsImageDocument/nsPluginDocument participate better in cycle collection, r+sr=peterv
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 20110
diff changeset
   149
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   150
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(PluginDocument, MediaDocument)
22219
d000c016b3233bcd6ac67c6939ba848c668a336c Bug 463424 - Make nsImageDocument/nsPluginDocument participate better in cycle collection, r+sr=peterv
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 20110
diff changeset
   151
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mPluginContent)
d000c016b3233bcd6ac67c6939ba848c668a336c Bug 463424 - Make nsImageDocument/nsPluginDocument participate better in cycle collection, r+sr=peterv
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 20110
diff changeset
   152
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
d000c016b3233bcd6ac67c6939ba848c668a336c Bug 463424 - Make nsImageDocument/nsPluginDocument participate better in cycle collection, r+sr=peterv
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 20110
diff changeset
   153
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   154
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(PluginDocument, MediaDocument)
22219
d000c016b3233bcd6ac67c6939ba848c668a336c Bug 463424 - Make nsImageDocument/nsPluginDocument participate better in cycle collection, r+sr=peterv
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 20110
diff changeset
   155
  NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mPluginContent)
d000c016b3233bcd6ac67c6939ba848c668a336c Bug 463424 - Make nsImageDocument/nsPluginDocument participate better in cycle collection, r+sr=peterv
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 20110
diff changeset
   156
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
d000c016b3233bcd6ac67c6939ba848c668a336c Bug 463424 - Make nsImageDocument/nsPluginDocument participate better in cycle collection, r+sr=peterv
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 20110
diff changeset
   157
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   158
NS_IMPL_ADDREF_INHERITED(PluginDocument, MediaDocument)
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   159
NS_IMPL_RELEASE_INHERITED(PluginDocument, MediaDocument)
58493
9fcb0a83c1a6314465f638aa23de27e763230739 Bug 614403: Make nsPluginDocument QI to its CC participant. r=peterv a=b:final
Kyle Huey <khuey@kylehuey.com>
parents: 56805
diff changeset
   160
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   161
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(PluginDocument)
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   162
  NS_INTERFACE_TABLE_INHERITED1(PluginDocument, nsIPluginDocument)
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   163
NS_INTERFACE_TABLE_TAIL_INHERITING(MediaDocument)
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   164
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   165
void
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   166
PluginDocument::SetScriptGlobalObject(nsIScriptGlobalObject* aScriptGlobalObject)
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   167
{
33072
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   168
  // Set the script global object on the superclass before doing
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   169
  // anything that might require it....
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   170
  MediaDocument::SetScriptGlobalObject(aScriptGlobalObject);
33072
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   171
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   172
  if (aScriptGlobalObject) {
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   173
    if (!mPluginContent) {
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   174
      // Create synthetic document
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   175
#ifdef DEBUG
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   176
      nsresult rv =
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   177
#endif
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   178
        CreateSyntheticPluginDocument();
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   179
      NS_ASSERTION(NS_SUCCEEDED(rv), "failed to create synthetic document");
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   180
    }
100734
fa6a84e7ba5384d49144b2b2477f9f34dfe49772 Bug 775467 - Make readyState progress through all states without duplicate transitions. r=bzbarsky.
Henri Sivonen <hsivonen@iki.fi>
parents: 100494
diff changeset
   181
    BecomeInteractive();
33072
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   182
  } else {
100844
b5c4b792f3f2a047e3517472d72842a76afb77cd Bug 777292 part 2 - Change all nsnull to nullptr
Aryeh Gregor <ayg@aryeh.name>
parents: 100734
diff changeset
   183
    mStreamListener = nullptr;
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   184
  }
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   185
}
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   186
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   187
77799
e7854b4d29ba905ae3994f821b160c989bac4260 Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
Michael Wu <mwu@mozilla.com>
parents: 76165
diff changeset
   188
bool
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   189
PluginDocument::CanSavePresentation(nsIRequest *aNewRequest)
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   190
{
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   191
  // Full-page plugins cannot be cached, currently, because we don't have
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   192
  // the stream listener data to feed to the plugin instance.
78840
ec7577dec4fceef0ac2717416d9c48289402d935 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Ehsan Akhgari <ehsan@mozilla.com>
parents: 77799
diff changeset
   193
  return false;
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   194
}
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   195
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   196
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   197
nsresult
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   198
PluginDocument::StartDocumentLoad(const char*         aCommand,
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   199
                                  nsIChannel*         aChannel,
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   200
                                  nsILoadGroup*       aLoadGroup,
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   201
                                  nsISupports*        aContainer,
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   202
                                  nsIStreamListener** aDocListener,
77799
e7854b4d29ba905ae3994f821b160c989bac4260 Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
Michael Wu <mwu@mozilla.com>
parents: 76165
diff changeset
   203
                                  bool                aReset,
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   204
                                  nsIContentSink*     aSink)
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   205
{
33072
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   206
  // do not allow message panes to host full-page plugins
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   207
  // returning an error causes helper apps to take over
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   208
  nsCOMPtr<nsIDocShellTreeItem> dsti (do_QueryInterface(aContainer));
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   209
  if (dsti) {
77799
e7854b4d29ba905ae3994f821b160c989bac4260 Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
Michael Wu <mwu@mozilla.com>
parents: 76165
diff changeset
   210
    bool isMsgPane = false;
33072
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   211
    dsti->NameEquals(NS_LITERAL_STRING("messagepane").get(), &isMsgPane);
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   212
    if (isMsgPane) {
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   213
      return NS_ERROR_FAILURE;
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   214
    }
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   215
  }
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   216
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   217
  nsresult rv =
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   218
    MediaDocument::StartDocumentLoad(aCommand, aChannel, aLoadGroup, aContainer,
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   219
                                     aDocListener, aReset, aSink);
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   220
  if (NS_FAILED(rv)) {
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   221
    return rv;
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   222
  }
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   223
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   224
  rv = aChannel->GetContentType(mMimeType);
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   225
  if (NS_FAILED(rv)) {
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   226
    return rv;
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   227
  }
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   228
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   229
  mStreamListener = new PluginStreamListener(this);
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   230
  if (!mStreamListener) {
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   231
    return NS_ERROR_OUT_OF_MEMORY;
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   232
  }
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   233
  NS_ASSERTION(aDocListener, "null aDocListener");
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   234
  NS_ADDREF(*aDocListener = mStreamListener);
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   235
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   236
  return rv;
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   237
}
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   238
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   239
nsresult
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   240
PluginDocument::CreateSyntheticPluginDocument()
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   241
{
46225
0dd4e086cea5368862bf2a337d518114944e905f Bug 538362 - rename nsIDocument::GetPrimaryShell to nsIDocument::GetShell. r=smaug
Ms2ger@gmail.com
parents: 41930
diff changeset
   242
  NS_ASSERTION(!GetShell() || !GetShell()->DidInitialReflow(),
33072
3ef7c0074486a90eedc945de82188e0379b3b23c Bug 371976 Create synthetic plugin document content later (like image documents) r=smaug
Neil Rashbrook <neil@parkwaycc.co.uk>
parents: 32799
diff changeset
   243
               "Creating synthetic plugin document content too late");
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   244
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   245
  // make our generic document
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   246
  nsresult rv = MediaDocument::CreateSyntheticDocument();
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   247
  NS_ENSURE_SUCCESS(rv, rv);
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   248
  // then attach our plugin
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   249
41634
bc10dcdc3b1e27e259ca1c7efa6c27aeea7de334 Bug 562688 part 4. Change GetRootContent and the like to return Elements. r=jst, sr=sicking
Boris Zbarsky <bzbarsky@mit.edu>
parents: 36655
diff changeset
   250
  Element* body = GetBodyElement();
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   251
  if (!body) {
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   252
    NS_WARNING("no body on plugin document!");
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   253
    return NS_ERROR_FAILURE;
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   254
  }
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   255
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   256
  // remove margins from body
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   257
  NS_NAMED_LITERAL_STRING(zero, "0");
78840
ec7577dec4fceef0ac2717416d9c48289402d935 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Ehsan Akhgari <ehsan@mozilla.com>
parents: 77799
diff changeset
   258
  body->SetAttr(kNameSpaceID_None, nsGkAtoms::marginwidth, zero, false);
ec7577dec4fceef0ac2717416d9c48289402d935 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Ehsan Akhgari <ehsan@mozilla.com>
parents: 77799
diff changeset
   259
  body->SetAttr(kNameSpaceID_None, nsGkAtoms::marginheight, zero, false);
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   260
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   261
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   262
  // make plugin content
90598
04aa64acdc6597872b8ff1f2df6c39026e2bddbc Back out b00bf7f3869c (bug 737976) for apparently causing mochitest-1 leaks on a CLOSED TREE
Phil Ringnalda <philringnalda@gmail.com>
parents: 90585
diff changeset
   263
  nsCOMPtr<nsINodeInfo> nodeInfo;
100844
b5c4b792f3f2a047e3517472d72842a76afb77cd Bug 777292 part 2 - Change all nsnull to nullptr
Aryeh Gregor <ayg@aryeh.name>
parents: 100734
diff changeset
   264
  nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::embed, nullptr,
71060
dd6e523b0b82af5da86c18bd3f1354a8f33f5b9f Bug 659539 Part 1: Give nsINodeInfos a nodeType, nodeName and localName. r=bz
Jonas Sicking <jonas@sicking.cc>
parents: 71049
diff changeset
   265
                                           kNameSpaceID_XHTML,
dd6e523b0b82af5da86c18bd3f1354a8f33f5b9f Bug 659539 Part 1: Give nsINodeInfos a nodeType, nodeName and localName. r=bz
Jonas Sicking <jonas@sicking.cc>
parents: 71049
diff changeset
   266
                                           nsIDOMNode::ELEMENT_NODE);
19747
514ea093a63fef004ee68d04f40ad58ced219d6c bug 455536: s/NS_ERROR_FAILURE/NS_ERROR_OOM/ outparamdelled nsNodeInfoManager::GetNodeInfo r+sr=jsr
Taras Glek <tglek@mozilla.com>
parents: 19197
diff changeset
   267
  NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
48124
58101a16aff7d619993819f642b117d940e7303e Bug 566466 - speed up createElement(), r=jst, peterv
Olli Pettay <Olli.Pettay@helsinki.fi>
parents: 46225
diff changeset
   268
  rv = NS_NewHTMLElement(getter_AddRefs(mPluginContent), nodeInfo.forget(),
56805
6aad432efa0240c8a922bdc85c3d4887f16e1708 Bug 594339 - Create a FromParser enum. r=hsivonen, sr=bzbarsky, a=jonas.
Ms2ger <ms2ger@gmail.com>
parents: 48124
diff changeset
   269
                         NOT_FROM_PARSER);
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   270
  NS_ENSURE_SUCCESS(rv, rv);
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   271
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   272
  // make it a named element
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   273
  mPluginContent->SetAttr(kNameSpaceID_None, nsGkAtoms::name,
78840
ec7577dec4fceef0ac2717416d9c48289402d935 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Ehsan Akhgari <ehsan@mozilla.com>
parents: 77799
diff changeset
   274
                          NS_LITERAL_STRING("plugin"), false);
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   275
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   276
  // fill viewport and auto-resize
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   277
  NS_NAMED_LITERAL_STRING(percent100, "100%");
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   278
  mPluginContent->SetAttr(kNameSpaceID_None, nsGkAtoms::width, percent100,
78840
ec7577dec4fceef0ac2717416d9c48289402d935 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Ehsan Akhgari <ehsan@mozilla.com>
parents: 77799
diff changeset
   279
                          false);
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   280
  mPluginContent->SetAttr(kNameSpaceID_None, nsGkAtoms::height, percent100,
78840
ec7577dec4fceef0ac2717416d9c48289402d935 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Ehsan Akhgari <ehsan@mozilla.com>
parents: 77799
diff changeset
   281
                          false);
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   282
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   283
  // set URL
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   284
  nsCAutoString src;
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   285
  mDocumentURI->GetSpec(src);
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   286
  mPluginContent->SetAttr(kNameSpaceID_None, nsGkAtoms::src,
78840
ec7577dec4fceef0ac2717416d9c48289402d935 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Ehsan Akhgari <ehsan@mozilla.com>
parents: 77799
diff changeset
   287
                          NS_ConvertUTF8toUTF16(src), false);
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   288
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   289
  // set mime type
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   290
  mPluginContent->SetAttr(kNameSpaceID_None, nsGkAtoms::type,
78840
ec7577dec4fceef0ac2717416d9c48289402d935 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Ehsan Akhgari <ehsan@mozilla.com>
parents: 77799
diff changeset
   291
                          NS_ConvertUTF8toUTF16(mMimeType), false);
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   292
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   293
  // This will not start the load because nsObjectLoadingContent checks whether
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   294
  // its document is an nsIPluginDocument
78840
ec7577dec4fceef0ac2717416d9c48289402d935 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Ehsan Akhgari <ehsan@mozilla.com>
parents: 77799
diff changeset
   295
  body->AppendChildTo(mPluginContent, false);
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   296
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   297
  return NS_OK;
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   298
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   299
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   300
}
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   301
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   302
NS_IMETHODIMP
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   303
PluginDocument::SetStreamListener(nsIStreamListener *aListener)
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   304
{
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   305
  if (mStreamListener) {
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   306
    mStreamListener->SetStreamListener(aListener);
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   307
  }
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   308
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   309
  MediaDocument::UpdateTitleAndCharset(mMimeType);
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   310
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   311
  return NS_OK;
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   312
}
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   313
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   314
NS_IMETHODIMP
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   315
PluginDocument::Print()
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   316
{
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   317
  NS_ENSURE_TRUE(mPluginContent, NS_ERROR_FAILURE);
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   318
36655
5824db6f9c71d84c20f8207239d7c88153a4ae87 Bug 500882 part 4. Switch content module to using the new GetPrimaryFrame API. r=smaug, sr=roc
Boris Zbarsky <bzbarsky@mit.edu>
parents: 33074
diff changeset
   319
  nsIObjectFrame* objectFrame =
5824db6f9c71d84c20f8207239d7c88153a4ae87 Bug 500882 part 4. Switch content module to using the new GetPrimaryFrame API. r=smaug, sr=roc
Boris Zbarsky <bzbarsky@mit.edu>
parents: 33074
diff changeset
   320
    do_QueryFrame(mPluginContent->GetPrimaryFrame());
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   321
  if (objectFrame) {
85844
15b00ab7f22d745ef331d89e766a261c770fd1d3 Bug 90268: Change plugin instance ownership from layout to content. r=roc r=bsmedberg
Josh Aas <joshmoz@gmail.com>
parents: 85285
diff changeset
   322
    nsRefPtr<nsNPAPIPluginInstance> pi;
69649
5ffdf4967deca4a6de8ca3f6ead80e7ea3df4a65 Bug 637253: Remove nsIPluginInstance interface. r=bsmedberg
Josh Aas <joshmoz@gmail.com>
parents: 58493
diff changeset
   323
    objectFrame->GetPluginInstance(getter_AddRefs(pi));
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   324
    if (pi) {
32799
da6d67c2c14027211aa74e1b51da885cad6b1a79 Gecko should use NPAPI directly, remove nsplugindefs.h abstractions. b=516661 r/sr=jst
Josh Aas <joshmoz@gmail.com>
parents: 29744
diff changeset
   325
      NPPrint npprint;
da6d67c2c14027211aa74e1b51da885cad6b1a79 Gecko should use NPAPI directly, remove nsplugindefs.h abstractions. b=516661 r/sr=jst
Josh Aas <joshmoz@gmail.com>
parents: 29744
diff changeset
   326
      npprint.mode = NP_FULL;
78840
ec7577dec4fceef0ac2717416d9c48289402d935 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Ehsan Akhgari <ehsan@mozilla.com>
parents: 77799
diff changeset
   327
      npprint.print.fullPrint.pluginPrinted = false;
ec7577dec4fceef0ac2717416d9c48289402d935 Bug 690892 - Replace PR_TRUE/PR_FALSE with true/false on mozilla-central; rs=dbaron
Ehsan Akhgari <ehsan@mozilla.com>
parents: 77799
diff changeset
   328
      npprint.print.fullPrint.printOne = false;
100844
b5c4b792f3f2a047e3517472d72842a76afb77cd Bug 777292 part 2 - Change all nsnull to nullptr
Aryeh Gregor <ayg@aryeh.name>
parents: 100734
diff changeset
   329
      npprint.print.fullPrint.platformPrint = nullptr;
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   330
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   331
      pi->Print(&npprint);
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   332
    }
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   333
  }
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   334
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   335
  return NS_OK;
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   336
}
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   337
20110
9395c3a493b2136290adbd9bd7132f7662a93774 Bug 458100. Make sure that we'll also instantiate the plug-in even if the nsPluginDocument has no presshell yet at OnStartRequest time. Thanks to Evgeny <evg.salmin@gmail.com> for pointing out the problem. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 19747
diff changeset
   338
NS_IMETHODIMP
77799
e7854b4d29ba905ae3994f821b160c989bac4260 Bug 675553 - Switch from PRBool to bool on a CLOSED TREE , r=bsmedberg,khuey,bz,cjones
Michael Wu <mwu@mozilla.com>
parents: 76165
diff changeset
   339
PluginDocument::GetWillHandleInstantiation(bool* aWillHandle)
20110
9395c3a493b2136290adbd9bd7132f7662a93774 Bug 458100. Make sure that we'll also instantiate the plug-in even if the nsPluginDocument has no presshell yet at OnStartRequest time. Thanks to Evgeny <evg.salmin@gmail.com> for pointing out the problem. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 19747
diff changeset
   340
{
9395c3a493b2136290adbd9bd7132f7662a93774 Bug 458100. Make sure that we'll also instantiate the plug-in even if the nsPluginDocument has no presshell yet at OnStartRequest time. Thanks to Evgeny <evg.salmin@gmail.com> for pointing out the problem. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 19747
diff changeset
   341
  *aWillHandle = mWillHandleInstantiation;
9395c3a493b2136290adbd9bd7132f7662a93774 Bug 458100. Make sure that we'll also instantiate the plug-in even if the nsPluginDocument has no presshell yet at OnStartRequest time. Thanks to Evgeny <evg.salmin@gmail.com> for pointing out the problem. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 19747
diff changeset
   342
  return NS_OK;
9395c3a493b2136290adbd9bd7132f7662a93774 Bug 458100. Make sure that we'll also instantiate the plug-in even if the nsPluginDocument has no presshell yet at OnStartRequest time. Thanks to Evgeny <evg.salmin@gmail.com> for pointing out the problem. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 19747
diff changeset
   343
}
9395c3a493b2136290adbd9bd7132f7662a93774 Bug 458100. Make sure that we'll also instantiate the plug-in even if the nsPluginDocument has no presshell yet at OnStartRequest time. Thanks to Evgeny <evg.salmin@gmail.com> for pointing out the problem. r+sr=jst
Boris Zbarsky <bzbarsky@mit.edu>
parents: 19747
diff changeset
   344
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   345
} // namespace dom
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   346
} // namespace mozilla
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   347
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   348
nsresult
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   349
NS_NewPluginDocument(nsIDocument** aResult)
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   350
{
70193
bc264b220828cabbeb93a5a5b56db6ba50ab3efe Bug 577138 - Move nsMediaDocument and subclasses into the mozilla::dom namespace; r=jst
Ms2ger <ms2ger@gmail.com>
parents: 69649
diff changeset
   351
  mozilla::dom::PluginDocument* doc = new mozilla::dom::PluginDocument();
1
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   352
  if (!doc) {
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   353
    return NS_ERROR_OUT_OF_MEMORY;
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   354
  }
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   355
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   356
  NS_ADDREF(doc);
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   357
  nsresult rv = doc->Init();
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   358
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   359
  if (NS_FAILED(rv)) {
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   360
    NS_RELEASE(doc);
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   361
  }
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   362
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   363
  *aResult = doc;
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   364
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   365
  return rv;
9b2a99adc05e53cd4010de512f50118594756650 Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,
hg@mozilla.com
parents:
diff changeset
   366
}