Skip to content

Commit

Permalink
Rename SignalObjectReleaseEvent to SignalObjectCountZero in ComServer…
Browse files Browse the repository at this point in the history
…Module

Bug: 734095
Change-Id: I13ad555008c546e71bf510acd4923a188277ad76
Reviewed-on: https://chromium-review.googlesource.com/923165
Reviewed-by: Greg Thompson <grt@chromium.org>
Commit-Queue: Xi Cheng <chengx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537683}
  • Loading branch information
Xi Cheng authored and Commit Bot committed Feb 19, 2018
1 parent 88fb0a0 commit 424f960
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
14 changes: 7 additions & 7 deletions notification_helper/com_server_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ namespace notification_helper {
// The reset policy of the event MUST BE set to MANUAL to avoid signaling the
// event in IsSignaled() itself, which is called by IsEventSignaled().
ComServerModule::ComServerModule()
: com_object_released_(base::WaitableEvent::ResetPolicy::MANUAL,
base::WaitableEvent::InitialState::NOT_SIGNALED) {}
: object_zero_count_(base::WaitableEvent::ResetPolicy::MANUAL,
base::WaitableEvent::InitialState::NOT_SIGNALED) {}

ComServerModule::~ComServerModule() = default;

Expand All @@ -41,7 +41,7 @@ HRESULT ComServerModule::RegisterClassObjects() {
// method is invoked when the last instance object of the module is released.
auto& module =
Microsoft::WRL::Module<Microsoft::WRL::OutOfProcDisableCaching>::Create(
this, &ComServerModule::SignalObjectReleaseEvent);
this, &ComServerModule::SignalObjectCountZero);

// Usually COM module classes statically define their CLSID at compile time
// through the use of various macros, and WRL::Module internals takes care of
Expand Down Expand Up @@ -99,15 +99,15 @@ void ComServerModule::UnregisterClassObjects() {
}

bool ComServerModule::IsEventSignaled() {
return com_object_released_.IsSignaled();
return object_zero_count_.IsSignaled();
}

void ComServerModule::WaitForZeroObjectCount() {
com_object_released_.Wait();
object_zero_count_.Wait();
}

void ComServerModule::SignalObjectReleaseEvent() {
com_object_released_.Signal();
void ComServerModule::SignalObjectCountZero() {
object_zero_count_.Signal();
}

} // namespace notification_helper
6 changes: 3 additions & 3 deletions notification_helper/com_server_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ class ComServerModule {
// Waits for all instance objects are released from the module.
void WaitForZeroObjectCount();

// Signals the COM object release event.
void SignalObjectReleaseEvent();
// 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 com_object_released_;
base::WaitableEvent object_zero_count_;

DISALLOW_COPY_AND_ASSIGN(ComServerModule);
};
Expand Down
1 change: 1 addition & 0 deletions notification_helper/notification_activator.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class NotificationActivator
protected:
~NotificationActivator() override;

private:
DISALLOW_COPY_AND_ASSIGN(NotificationActivator);
};

Expand Down

0 comments on commit 424f960

Please sign in to comment.