Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1098)

Unified Diff: content/child/blink_platform_impl.cc

Issue 1225243002: WebWaitableEvent: implement new API with ResetPolicy and InitialState arguments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: done Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/blink_platform_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/blink_platform_impl.cc
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
index e7a7be110b634835886a6c1dd799371179966b58..a5db5a489fc273a4a82c505556d3abe012ace282 100644
--- a/content/child/blink_platform_impl.cc
+++ b/content/child/blink_platform_impl.cc
@@ -90,9 +90,14 @@ namespace {
class WebWaitableEventImpl : public blink::WebWaitableEvent {
public:
- WebWaitableEventImpl() : impl_(new base::WaitableEvent(false, false)) {}
+ WebWaitableEventImpl(ResetPolicy policy, InitialState state) {
+ bool manual_reset = policy == ResetPolicy::Manual;
+ bool initially_signaled = state == InitialState::Signaled;
+ impl_.reset(new base::WaitableEvent(manual_reset, initially_signaled));
+ }
virtual ~WebWaitableEventImpl() {}
+ virtual void reset() { impl_->Reset(); }
virtual void wait() { impl_->Wait(); }
virtual void signal() { impl_->Signal(); }
@@ -539,8 +544,17 @@ void BlinkPlatformImpl::yieldCurrentThread() {
base::PlatformThread::YieldCurrentThread();
}
+// TODO(toyoshim): Remove no arguments version after the transition.
blink::WebWaitableEvent* BlinkPlatformImpl::createWaitableEvent() {
- return new WebWaitableEventImpl();
+ return new WebWaitableEventImpl(
+ blink::WebWaitableEvent::ResetPolicy::Auto,
+ blink::WebWaitableEvent::InitialState::NonSignaled);
+}
+
+blink::WebWaitableEvent* BlinkPlatformImpl::createWaitableEvent(
+ blink::WebWaitableEvent::ResetPolicy policy,
+ blink::WebWaitableEvent::InitialState state) {
+ return new WebWaitableEventImpl(policy, state);
}
blink::WebWaitableEvent* BlinkPlatformImpl::waitMultipleEvents(
« no previous file with comments | « content/child/blink_platform_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698