Commit 424f960b authored by Xi Cheng's avatar Xi Cheng Committed by Commit Bot

Rename SignalObjectReleaseEvent to SignalObjectCountZero in ComServerModule

Bug: 734095
Change-Id: I13ad555008c546e71bf510acd4923a188277ad76
Reviewed-on: https://chromium-review.googlesource.com/923165Reviewed-by: default avatarGreg Thompson <grt@chromium.org>
Commit-Queue: Xi Cheng <chengx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537683}
parent 88fb0a0e
...@@ -22,8 +22,8 @@ namespace notification_helper { ...@@ -22,8 +22,8 @@ namespace notification_helper {
// The reset policy of the event MUST BE set to MANUAL to avoid signaling the // The reset policy of the event MUST BE set to MANUAL to avoid signaling the
// event in IsSignaled() itself, which is called by IsEventSignaled(). // event in IsSignaled() itself, which is called by IsEventSignaled().
ComServerModule::ComServerModule() ComServerModule::ComServerModule()
: com_object_released_(base::WaitableEvent::ResetPolicy::MANUAL, : object_zero_count_(base::WaitableEvent::ResetPolicy::MANUAL,
base::WaitableEvent::InitialState::NOT_SIGNALED) {} base::WaitableEvent::InitialState::NOT_SIGNALED) {}
ComServerModule::~ComServerModule() = default; ComServerModule::~ComServerModule() = default;
...@@ -41,7 +41,7 @@ HRESULT ComServerModule::RegisterClassObjects() { ...@@ -41,7 +41,7 @@ HRESULT ComServerModule::RegisterClassObjects() {
// method is invoked when the last instance object of the module is released. // method is invoked when the last instance object of the module is released.
auto& module = auto& module =
Microsoft::WRL::Module<Microsoft::WRL::OutOfProcDisableCaching>::Create( Microsoft::WRL::Module<Microsoft::WRL::OutOfProcDisableCaching>::Create(
this, &ComServerModule::SignalObjectReleaseEvent); this, &ComServerModule::SignalObjectCountZero);
// Usually COM module classes statically define their CLSID at compile time // Usually COM module classes statically define their CLSID at compile time
// through the use of various macros, and WRL::Module internals takes care of // through the use of various macros, and WRL::Module internals takes care of
...@@ -99,15 +99,15 @@ void ComServerModule::UnregisterClassObjects() { ...@@ -99,15 +99,15 @@ void ComServerModule::UnregisterClassObjects() {
} }
bool ComServerModule::IsEventSignaled() { bool ComServerModule::IsEventSignaled() {
return com_object_released_.IsSignaled(); return object_zero_count_.IsSignaled();
} }
void ComServerModule::WaitForZeroObjectCount() { void ComServerModule::WaitForZeroObjectCount() {
com_object_released_.Wait(); object_zero_count_.Wait();
} }
void ComServerModule::SignalObjectReleaseEvent() { void ComServerModule::SignalObjectCountZero() {
com_object_released_.Signal(); object_zero_count_.Signal();
} }
} // namespace notification_helper } // namespace notification_helper
...@@ -35,15 +35,15 @@ class ComServerModule { ...@@ -35,15 +35,15 @@ class ComServerModule {
// Waits for all instance objects are released from the module. // Waits for all instance objects are released from the module.
void WaitForZeroObjectCount(); void WaitForZeroObjectCount();
// Signals the COM object release event. // Sends out the signal that all objects are now released from the module.
void SignalObjectReleaseEvent(); void SignalObjectCountZero();
// Identifiers of registered class objects. Used for unregistration. // Identifiers of registered class objects. Used for unregistration.
DWORD cookies_[1] = {0}; DWORD cookies_[1] = {0};
// This event starts "unsignaled", and is signaled when the last instance // This event starts "unsignaled", and is signaled when the last instance
// object is released from the module. // object is released from the module.
base::WaitableEvent com_object_released_; base::WaitableEvent object_zero_count_;
DISALLOW_COPY_AND_ASSIGN(ComServerModule); DISALLOW_COPY_AND_ASSIGN(ComServerModule);
}; };
......
...@@ -33,6 +33,7 @@ class NotificationActivator ...@@ -33,6 +33,7 @@ class NotificationActivator
protected: protected:
~NotificationActivator() override; ~NotificationActivator() override;
private:
DISALLOW_COPY_AND_ASSIGN(NotificationActivator); DISALLOW_COPY_AND_ASSIGN(NotificationActivator);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment