michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * vim: sw=4 ts=8 et : michael@0: */ 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: include protocol PPluginInstance; michael@0: michael@0: namespace mozilla { michael@0: namespace plugins { michael@0: michael@0: /** michael@0: * This protocol exists to allow us to correctly destroy background michael@0: * surfaces. The browser owns the surfaces, but shares a "reference" michael@0: * with the plugin. The browser needs to notify the plugin when the michael@0: * background is going to be destroyed, but it can't rely on the michael@0: * plugin to destroy it because the plugin may crash at any time. So michael@0: * the plugin instance relinquishes destruction of the its old michael@0: * background to actors of this protocol, which can deal with crashy michael@0: * corner cases more easily than the instance. michael@0: */ michael@0: protocol PPluginBackgroundDestroyer { michael@0: manager PPluginInstance; michael@0: michael@0: // The ctor message for this protocol serves double-duty as michael@0: // notification that that the background is stale. michael@0: michael@0: parent: michael@0: __delete__(); michael@0: michael@0: state DESTROYING: michael@0: recv __delete__; michael@0: }; michael@0: michael@0: } // namespace plugins michael@0: } // namespace mozilla