2009-09-08 14:22:50 -07:00
|
|
|
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
|
|
|
|
/* vim: set sw=2 ts=2 et : */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2009-09-08 14:22:50 -07:00
|
|
|
|
|
|
|
#ifndef mozilla_plugins_StreamNotifyChild_h
|
|
|
|
#define mozilla_plugins_StreamNotifyChild_h
|
|
|
|
|
|
|
|
#include "mozilla/plugins/PStreamNotifyChild.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace plugins {
|
|
|
|
|
2010-03-06 13:03:05 -08:00
|
|
|
class BrowserStreamChild;
|
|
|
|
|
2009-09-08 14:22:50 -07:00
|
|
|
class StreamNotifyChild : public PStreamNotifyChild
|
|
|
|
{
|
|
|
|
friend class PluginInstanceChild;
|
2009-09-23 16:00:23 -07:00
|
|
|
friend class BrowserStreamChild;
|
2009-09-08 14:22:50 -07:00
|
|
|
|
2009-09-15 12:48:18 -07:00
|
|
|
public:
|
2014-09-01 17:49:25 -07:00
|
|
|
explicit StreamNotifyChild(const nsCString& aURL)
|
2009-09-08 14:22:50 -07:00
|
|
|
: mURL(aURL)
|
2013-10-23 13:34:46 -07:00
|
|
|
, mClosure(nullptr)
|
|
|
|
, mBrowserStream(nullptr)
|
2009-09-08 14:22:50 -07:00
|
|
|
{ }
|
|
|
|
|
2012-07-06 11:15:45 -07:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
2010-03-06 13:03:05 -08:00
|
|
|
|
2009-11-25 06:26:01 -08:00
|
|
|
void SetValid(void* aClosure) {
|
|
|
|
mClosure = aClosure;
|
|
|
|
}
|
|
|
|
|
2010-03-06 13:03:05 -08:00
|
|
|
void NPP_URLNotify(NPReason reason);
|
2009-12-03 00:16:14 -08:00
|
|
|
|
2009-09-08 14:22:50 -07:00
|
|
|
private:
|
2012-07-06 11:15:45 -07:00
|
|
|
virtual bool Recv__delete__(const NPReason& reason) MOZ_OVERRIDE;
|
2010-03-06 13:03:05 -08:00
|
|
|
|
2014-01-19 21:03:45 -08:00
|
|
|
bool RecvRedirectNotify(const nsCString& url, const int32_t& status) MOZ_OVERRIDE;
|
2011-01-05 11:44:21 -08:00
|
|
|
|
2010-03-06 13:03:05 -08:00
|
|
|
/**
|
|
|
|
* If a stream is created for this this URLNotify, we associate the objects
|
|
|
|
* so that the NPP_URLNotify call is not fired before the stream data is
|
|
|
|
* completely delivered. The BrowserStreamChild takes responsibility for
|
|
|
|
* calling NPP_URLNotify and deleting this object.
|
|
|
|
*/
|
|
|
|
void SetAssociatedStream(BrowserStreamChild* bs);
|
|
|
|
|
2009-09-08 14:22:50 -07:00
|
|
|
nsCString mURL;
|
|
|
|
void* mClosure;
|
2010-03-06 13:03:05 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If mBrowserStream is true, it is responsible for deleting this C++ object
|
|
|
|
* and DeallocPStreamNotify is not, so that the delayed delivery of
|
|
|
|
* NPP_URLNotify is possible.
|
|
|
|
*/
|
|
|
|
BrowserStreamChild* mBrowserStream;
|
2009-09-08 14:22:50 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace plugins
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|