2009-09-09 01:22:50 +04:00
|
|
|
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
|
|
|
|
/* vim: set sw=2 ts=2 et : */
|
2012-05-21 15:12:37 +04: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-09 01:22:50 +04:00
|
|
|
|
|
|
|
#ifndef mozilla_plugins_StreamNotifyChild_h
|
|
|
|
#define mozilla_plugins_StreamNotifyChild_h
|
|
|
|
|
|
|
|
#include "mozilla/plugins/PStreamNotifyChild.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace plugins {
|
|
|
|
|
2010-03-07 00:03:05 +03:00
|
|
|
class BrowserStreamChild;
|
|
|
|
|
2009-09-09 01:22:50 +04:00
|
|
|
class StreamNotifyChild : public PStreamNotifyChild
|
|
|
|
{
|
|
|
|
friend class PluginInstanceChild;
|
2009-09-24 03:00:23 +04:00
|
|
|
friend class BrowserStreamChild;
|
2009-09-09 01:22:50 +04:00
|
|
|
|
2009-09-15 23:48:18 +04:00
|
|
|
public:
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit StreamNotifyChild(const nsCString& aURL)
|
2009-09-09 01:22:50 +04:00
|
|
|
: mURL(aURL)
|
2013-10-24 00:34:46 +04:00
|
|
|
, mClosure(nullptr)
|
|
|
|
, mBrowserStream(nullptr)
|
2009-09-09 01:22:50 +04:00
|
|
|
{ }
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason why) override;
|
2010-03-07 00:03:05 +03:00
|
|
|
|
2009-11-25 17:26:01 +03:00
|
|
|
void SetValid(void* aClosure) {
|
|
|
|
mClosure = aClosure;
|
|
|
|
}
|
|
|
|
|
2010-03-07 00:03:05 +03:00
|
|
|
void NPP_URLNotify(NPReason reason);
|
2009-12-03 11:16:14 +03:00
|
|
|
|
2009-09-09 01:22:50 +04:00
|
|
|
private:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool Recv__delete__(const NPReason& reason) override;
|
2010-03-07 00:03:05 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
bool RecvRedirectNotify(const nsCString& url, const int32_t& status) override;
|
2011-01-05 22:44:21 +03:00
|
|
|
|
2010-03-07 00:03:05 +03: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-09 01:22:50 +04:00
|
|
|
nsCString mURL;
|
|
|
|
void* mClosure;
|
2010-03-07 00:03:05 +03: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-09 01:22:50 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace plugins
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|