Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
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/. */
7 #ifndef mozilla_plugins_MiniShmChild_h
8 #define mozilla_plugins_MiniShmChild_h
10 #include "MiniShmBase.h"
12 #include <string>
14 namespace mozilla {
15 namespace plugins {
17 /**
18 * This class provides a lightweight shared memory interface for a child
19 * process in Win32.
20 * This code assumes that there is a parent-child relationship between
21 * processes, as it inherits handles from the parent process.
22 * Note that this class is *not* an IPDL actor.
23 *
24 * @see MiniShmParent
25 */
26 class MiniShmChild : public MiniShmBase
27 {
28 public:
29 MiniShmChild();
30 virtual ~MiniShmChild();
32 /**
33 * Initialize shared memory on the child side.
34 *
35 * @param aObserver A MiniShmObserver object to receive event notifications.
36 * @param aCookie Cookie obtained from MiniShmParent::GetCookie
37 * @param aTimeout Timeout in milliseconds.
38 * @return nsresult error code
39 */
40 nsresult
41 Init(MiniShmObserver* aObserver, const std::wstring& aCookie,
42 const DWORD aTimeout);
44 virtual nsresult
45 Send() MOZ_OVERRIDE;
47 protected:
48 void
49 OnEvent() MOZ_OVERRIDE;
51 private:
52 HANDLE mParentEvent;
53 HANDLE mParentGuard;
54 HANDLE mChildEvent;
55 HANDLE mChildGuard;
56 HANDLE mFileMapping;
57 HANDLE mRegWait;
58 LPVOID mView;
59 DWORD mTimeout;
61 DISALLOW_COPY_AND_ASSIGN(MiniShmChild);
62 };
64 } // namespace plugins
65 } // namespace mozilla
67 #endif // mozilla_plugins_MiniShmChild_h