dom/plugins/ipc/PluginProcessParent.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/plugins/ipc/PluginProcessParent.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,59 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     1.5 + * vim: sw=4 ts=4 et :
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef dom_plugins_PluginProcessParent_h
    1.11 +#define dom_plugins_PluginProcessParent_h 1
    1.12 +
    1.13 +#include "mozilla/Attributes.h"
    1.14 +#include "base/basictypes.h"
    1.15 +
    1.16 +#include "base/file_path.h"
    1.17 +#include "base/scoped_ptr.h"
    1.18 +#include "base/thread.h"
    1.19 +#include "base/waitable_event.h"
    1.20 +#include "chrome/common/child_process_host.h"
    1.21 +
    1.22 +#include "mozilla/ipc/GeckoChildProcessHost.h"
    1.23 +
    1.24 +namespace mozilla {
    1.25 +namespace plugins {
    1.26 +//-----------------------------------------------------------------------------
    1.27 +
    1.28 +class PluginProcessParent : public mozilla::ipc::GeckoChildProcessHost
    1.29 +{
    1.30 +public:
    1.31 +    PluginProcessParent(const std::string& aPluginFilePath);
    1.32 +    ~PluginProcessParent();
    1.33 +
    1.34 +    /**
    1.35 +     * Synchronously launch the plugin process. If the process fails to launch
    1.36 +     * after timeoutMs, this method will return false.
    1.37 +     */
    1.38 +    bool Launch(int32_t timeoutMs);
    1.39 +
    1.40 +    void Delete();
    1.41 +
    1.42 +    virtual bool CanShutdown() MOZ_OVERRIDE
    1.43 +    {
    1.44 +        return true;
    1.45 +    }
    1.46 +
    1.47 +    const std::string& GetPluginFilePath() { return mPluginFilePath; }
    1.48 +
    1.49 +    using mozilla::ipc::GeckoChildProcessHost::GetShutDownEvent;
    1.50 +    using mozilla::ipc::GeckoChildProcessHost::GetChannel;
    1.51 +
    1.52 +private:
    1.53 +    std::string mPluginFilePath;
    1.54 +
    1.55 +    DISALLOW_EVIL_CONSTRUCTORS(PluginProcessParent);
    1.56 +};
    1.57 +
    1.58 +
    1.59 +} // namespace plugins
    1.60 +} // namespace mozilla
    1.61 +
    1.62 +#endif // ifndef dom_plugins_PluginProcessParent_h

mercurial