blob: 16d00ed127fbd39b3328056f80b4afba2c25f967 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/synchronization/waitable_event.h"
#include "base/win/windows_types.h"
namespace notification_helper {
// This class is used to host the NotificationActivator COM component and serve
// as the module for an out-of-proc COM server.
class ComServerModule {
ComServerModule(const ComServerModule&) = delete;
ComServerModule& operator=(const ComServerModule&) = delete;
// Handles object registration and unregistration. Returns when all registered
// objects are released.
// Registers the NotificationActivator COM object so other applications can
// connect to it. Returns the registration status.
HRESULT RegisterClassObjects();
// Unregisters the NotificationActivator COM object. Returns the
// unregistration status.
HRESULT UnregisterClassObjects();
// Returns the state of the event.
bool IsEventSignaled();
// Waits for all instance objects are released from the module.
void WaitForZeroObjectCount();
// Sends out the signal that all objects are now released from the module.
void SignalObjectCountZero();
// Identifiers of registered class objects. Used for unregistration.
DWORD cookies_[1] = {0};
// This event starts "unsignaled", and is signaled when the last instance
// object is released from the module.
base::WaitableEvent object_zero_count_;
} // namespace notification_helper