|
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
|
2 * vim: sw=4 ts=4 et : |
|
3 * This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #ifndef dom_plugins_PluginProcessParent_h |
|
8 #define dom_plugins_PluginProcessParent_h 1 |
|
9 |
|
10 #include "mozilla/Attributes.h" |
|
11 #include "base/basictypes.h" |
|
12 |
|
13 #include "base/file_path.h" |
|
14 #include "base/scoped_ptr.h" |
|
15 #include "base/thread.h" |
|
16 #include "base/waitable_event.h" |
|
17 #include "chrome/common/child_process_host.h" |
|
18 |
|
19 #include "mozilla/ipc/GeckoChildProcessHost.h" |
|
20 |
|
21 namespace mozilla { |
|
22 namespace plugins { |
|
23 //----------------------------------------------------------------------------- |
|
24 |
|
25 class PluginProcessParent : public mozilla::ipc::GeckoChildProcessHost |
|
26 { |
|
27 public: |
|
28 PluginProcessParent(const std::string& aPluginFilePath); |
|
29 ~PluginProcessParent(); |
|
30 |
|
31 /** |
|
32 * Synchronously launch the plugin process. If the process fails to launch |
|
33 * after timeoutMs, this method will return false. |
|
34 */ |
|
35 bool Launch(int32_t timeoutMs); |
|
36 |
|
37 void Delete(); |
|
38 |
|
39 virtual bool CanShutdown() MOZ_OVERRIDE |
|
40 { |
|
41 return true; |
|
42 } |
|
43 |
|
44 const std::string& GetPluginFilePath() { return mPluginFilePath; } |
|
45 |
|
46 using mozilla::ipc::GeckoChildProcessHost::GetShutDownEvent; |
|
47 using mozilla::ipc::GeckoChildProcessHost::GetChannel; |
|
48 |
|
49 private: |
|
50 std::string mPluginFilePath; |
|
51 |
|
52 DISALLOW_EVIL_CONSTRUCTORS(PluginProcessParent); |
|
53 }; |
|
54 |
|
55 |
|
56 } // namespace plugins |
|
57 } // namespace mozilla |
|
58 |
|
59 #endif // ifndef dom_plugins_PluginProcessParent_h |