michael@0: /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */ michael@0: /* vim: set sw=2 ts=2 et : */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_plugins_StreamNotifyParent_h michael@0: #define mozilla_plugins_StreamNotifyParent_h michael@0: michael@0: #include "mozilla/plugins/PStreamNotifyParent.h" michael@0: michael@0: namespace mozilla { michael@0: namespace plugins { michael@0: michael@0: class StreamNotifyParent : public PStreamNotifyParent michael@0: { michael@0: friend class PluginInstanceParent; michael@0: michael@0: StreamNotifyParent() michael@0: : mDestructionFlag(nullptr) michael@0: { } michael@0: ~StreamNotifyParent() { michael@0: if (mDestructionFlag) michael@0: *mDestructionFlag = true; michael@0: } michael@0: michael@0: public: michael@0: // If we are destroyed within the call to NPN_GetURLNotify, notify the caller michael@0: // so that we aren't destroyed again. see bug 536437. michael@0: void SetDestructionFlag(bool* flag) { michael@0: mDestructionFlag = flag; michael@0: } michael@0: void ClearDestructionFlag() { michael@0: mDestructionFlag = nullptr; michael@0: } michael@0: michael@0: private: michael@0: bool RecvRedirectNotifyResponse(const bool& allow) MOZ_OVERRIDE; michael@0: michael@0: bool* mDestructionFlag; michael@0: }; michael@0: michael@0: } // namespace plugins michael@0: } // namespace mozilla michael@0: michael@0: #endif