382378 call NotifyContentObjectWrapper after the plugin has been instantiated so that scriptable plugins work correctly r+sr=bz

This commit is contained in:
cbiesinger@gmx.at 2007-08-02 14:15:05 -07:00
Родитель bae72986cf
Коммит b29067127d
4 изменённых файлов: 29 добавлений и 11 удалений

Просмотреть файл

@ -504,6 +504,14 @@ nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest, nsISupports *aConte
} }
#endif #endif
Fallback(PR_FALSE); Fallback(PR_FALSE);
} else if (mType == eType_Plugin) {
nsIObjectFrame* frame = GetFrame(PR_FALSE);
if (frame) {
// We have to notify the wrapper here instead of right after
// Instantiate because the plugin only gets instantiated by
// OnStartRequest, not by Instantiate.
frame->TryNotifyContentObjectWrapper();
}
} }
return rv; return rv;
} }

Просмотреть файл

@ -47,9 +47,9 @@
class nsIPluginInstance; class nsIPluginInstance;
// {F455B51F-7A1F-4bbe-B55D-679F033AD3FE} // {3e2df1fe-a898-4e2e-8763-4ca904fa338e}
#define NS_IOBJECTFRAME_IID \ #define NS_IOBJECTFRAME_IID \
{ 0xf455b51f, 0x7a1f, 0x4bbe, { 0xb5, 0x5d, 0x67, 0x9f, 0x3, 0x3a, 0xd3, 0xfe } } { 0x3e2df1fe, 0xa898, 0x4e2e, { 0x87, 0x63, 0x4c, 0xa9, 0x4, 0xfa, 0x33, 0x8e } }
class nsIObjectFrame : public nsISupports { class nsIObjectFrame : public nsISupports {
public: public:
@ -63,6 +63,8 @@ public:
*/ */
virtual nsresult Instantiate(nsIChannel* aChannel, nsIStreamListener** aStreamListener) = 0; virtual nsresult Instantiate(nsIChannel* aChannel, nsIStreamListener** aStreamListener) = 0;
virtual void TryNotifyContentObjectWrapper() = 0;
/** /**
* Instantiate a plugin that loads the data itself. * Instantiate a plugin that loads the data itself.
* @param aMimeType Type of the plugin to instantiate. May be null. * @param aMimeType Type of the plugin to instantiate. May be null.

Просмотреть файл

@ -1395,6 +1395,7 @@ nsObjectFrame::Instantiate(nsIChannel* aChannel, nsIStreamListener** aStreamList
// to FixupWindow. // to FixupWindow.
PresContext()->GetPresShell()-> PresContext()->GetPresShell()->
FrameNeedsReflow(this, nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY); FrameNeedsReflow(this, nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY);
return rv; return rv;
} }
@ -1418,6 +1419,15 @@ nsObjectFrame::Instantiate(const char* aMimeType, nsIURI* aURI)
// finish up // finish up
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
TryNotifyContentObjectWrapper();
}
return rv;
}
void
nsObjectFrame::TryNotifyContentObjectWrapper()
{
nsCOMPtr<nsIPluginInstance> inst; nsCOMPtr<nsIPluginInstance> inst;
mInstanceOwner->GetInstance(*getter_AddRefs(inst)); mInstanceOwner->GetInstance(*getter_AddRefs(inst));
if (inst) { if (inst) {
@ -1427,9 +1437,6 @@ nsObjectFrame::Instantiate(const char* aMimeType, nsIURI* aURI)
// said plugin instance. // said plugin instance.
NotifyContentObjectWrapper(); NotifyContentObjectWrapper();
} }
}
return rv;
} }
void void

Просмотреть файл

@ -110,6 +110,7 @@ public:
NS_IMETHOD GetPluginInstance(nsIPluginInstance*& aPluginInstance); NS_IMETHOD GetPluginInstance(nsIPluginInstance*& aPluginInstance);
virtual nsresult Instantiate(nsIChannel* aChannel, nsIStreamListener** aStreamListener); virtual nsresult Instantiate(nsIChannel* aChannel, nsIStreamListener** aStreamListener);
virtual nsresult Instantiate(const char* aMimeType, nsIURI* aURI); virtual nsresult Instantiate(const char* aMimeType, nsIURI* aURI);
virtual void TryNotifyContentObjectWrapper();
virtual void StopPlugin(); virtual void StopPlugin();