From 373117fdb807eb094b942da82404558db4007b75 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Mon, 27 Oct 2014 21:50:35 -0700 Subject: [PATCH] Delete WebWaitableEvent We don't use this interface. In the future, we can just use the base version directly. R=eseidel@chromium.org, ojan@chromium.org Review URL: https://codereview.chromium.org/681173002 --- engine/public/platform/Platform.h | 13 ------ engine/public/platform/WebWaitableEvent.h | 55 ----------------------- engine/testing/platform/platform_impl.cc | 36 --------------- engine/testing/platform/platform_impl.h | 3 -- viewer/platform/platform_impl.cc | 33 -------------- viewer/platform/platform_impl.h | 3 -- 6 files changed, 143 deletions(-) delete mode 100644 engine/public/platform/WebWaitableEvent.h diff --git a/engine/public/platform/Platform.h b/engine/public/platform/Platform.h index 4bce22f9a..9ebeb4989 100644 --- a/engine/public/platform/Platform.h +++ b/engine/public/platform/Platform.h @@ -73,7 +73,6 @@ class WebThemeEngine; class WebURL; class WebURLLoader; class WebUnitTestSupport; -class WebWaitableEvent; struct WebLocalizedString; struct WebSize; @@ -203,18 +202,6 @@ public: virtual WebString queryLocalizedString(WebLocalizedString::Name, const WebString& parameter1, const WebString& parameter2) { return WebString(); } - // WaitableEvent ------------------------------------------------------- - - // Creates an embedder-defined waitable event object. - virtual WebWaitableEvent* createWaitableEvent() { return 0; } - - // Waits on multiple events and returns the event object that has been - // signaled. This may return 0 if it fails to wait events. - // Any event objects given to this method must not deleted while this - // wait is happening. - virtual WebWaitableEvent* waitMultipleEvents(const WebVector& events) { return 0; } - - // Profiling ----------------------------------------------------------- virtual void decrementStatsCounter(const char* name) { } diff --git a/engine/public/platform/WebWaitableEvent.h b/engine/public/platform/WebWaitableEvent.h deleted file mode 100644 index f1b59f0a2..000000000 --- a/engine/public/platform/WebWaitableEvent.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef WebWaitableEvent_h -#define WebWaitableEvent_h - -#include "WebCommon.h" - -namespace blink { - -// Provides a thread synchronization that can be used to allow one thread to -// wait until another thread to finish some work. -class WebWaitableEvent { -public: - virtual ~WebWaitableEvent() { } - - // Waits indefinitely for the event to be signaled. - virtual void wait() = 0; - - // Puts the event in the signaled state. Causing any thread blocked on Wait - // to be woken up. The event state is reset to non-signaled after - // a waiting thread has been released. - virtual void signal() = 0; -}; - -} // namespace blink - -#endif // WebWaitableEvent_h diff --git a/engine/testing/platform/platform_impl.cc b/engine/testing/platform/platform_impl.cc index 62147eef4..6deb6089a 100644 --- a/engine/testing/platform/platform_impl.cc +++ b/engine/testing/platform/platform_impl.cc @@ -13,29 +13,8 @@ #include "net/base/data_url.h" #include "net/base/mime_util.h" #include "net/base/net_errors.h" -#include "sky/engine/public/platform/WebWaitableEvent.h" namespace sky { -namespace { - -class WebWaitableEventImpl : public blink::WebWaitableEvent { - public: - WebWaitableEventImpl() : impl_(new base::WaitableEvent(false, false)) {} - virtual ~WebWaitableEventImpl() {} - - virtual void wait() { impl_->Wait(); } - virtual void signal() { impl_->Signal(); } - - base::WaitableEvent* impl() { - return impl_.get(); - } - - private: - scoped_ptr impl_; - DISALLOW_COPY_AND_ASSIGN(WebWaitableEventImpl); -}; - -} // namespace PlatformImpl::PlatformImpl() : main_loop_(base::MessageLoop::current()), @@ -145,19 +124,4 @@ blink::WebData PlatformImpl::parseDataURL( return blink::WebData(); } -blink::WebWaitableEvent* PlatformImpl::createWaitableEvent() { - return new WebWaitableEventImpl(); -} - -blink::WebWaitableEvent* PlatformImpl::waitMultipleEvents( - const blink::WebVector& web_events) { - std::vector events; - for (size_t i = 0; i < web_events.size(); ++i) - events.push_back(static_cast(web_events[i])->impl()); - size_t idx = base::WaitableEvent::WaitMany( - vector_as_array(&events), events.size()); - DCHECK_LT(idx, web_events.size()); - return web_events[idx]; -} - } // namespace sky diff --git a/engine/testing/platform/platform_impl.h b/engine/testing/platform/platform_impl.h index 31660bd20..e957ebea7 100644 --- a/engine/testing/platform/platform_impl.h +++ b/engine/testing/platform/platform_impl.h @@ -38,9 +38,6 @@ class PlatformImpl : public blink::Platform { virtual blink::WebData parseDataURL( const blink::WebURL& url, blink::WebString& mime_type, blink::WebString& charset); - virtual blink::WebWaitableEvent* createWaitableEvent(); - virtual blink::WebWaitableEvent* waitMultipleEvents( - const blink::WebVector& events); virtual blink::WebScrollbarBehavior* scrollbarBehavior(); virtual const unsigned char* getTraceCategoryEnabledFlag( const char* category_name); diff --git a/viewer/platform/platform_impl.cc b/viewer/platform/platform_impl.cc index d5627768d..637849a2e 100644 --- a/viewer/platform/platform_impl.cc +++ b/viewer/platform/platform_impl.cc @@ -16,29 +16,11 @@ #include "net/base/mime_util.h" #include "net/base/net_errors.h" #include "sky/engine/public/platform/WebConvertableToTraceFormat.h" -#include "sky/engine/public/platform/WebWaitableEvent.h" #include "sky/viewer/platform/weburlloader_impl.h" namespace sky { namespace { -class WebWaitableEventImpl : public blink::WebWaitableEvent { - public: - WebWaitableEventImpl() : impl_(new base::WaitableEvent(false, false)) {} - virtual ~WebWaitableEventImpl() {} - - virtual void wait() { impl_->Wait(); } - virtual void signal() { impl_->Signal(); } - - base::WaitableEvent* impl() { - return impl_.get(); - } - - private: - scoped_ptr impl_; - DISALLOW_COPY_AND_ASSIGN(WebWaitableEventImpl); -}; - class ConvertableToTraceFormatWrapper : public base::debug::ConvertableToTraceFormat { public: @@ -186,21 +168,6 @@ blink::WebURLError PlatformImpl::cancelledError(const blink::WebURL& url) return error; } -blink::WebWaitableEvent* PlatformImpl::createWaitableEvent() { - return new WebWaitableEventImpl(); -} - -blink::WebWaitableEvent* PlatformImpl::waitMultipleEvents( - const blink::WebVector& web_events) { - std::vector events; - for (size_t i = 0; i < web_events.size(); ++i) - events.push_back(static_cast(web_events[i])->impl()); - size_t idx = base::WaitableEvent::WaitMany( - vector_as_array(&events), events.size()); - DCHECK_LT(idx, web_events.size()); - return web_events[idx]; -} - const unsigned char* PlatformImpl::getTraceCategoryEnabledFlag( const char* category_group) { return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group); diff --git a/viewer/platform/platform_impl.h b/viewer/platform/platform_impl.h index be65126d2..67b2f7cdb 100644 --- a/viewer/platform/platform_impl.h +++ b/viewer/platform/platform_impl.h @@ -47,9 +47,6 @@ class PlatformImpl : public blink::Platform { const blink::WebURL& url, blink::WebString& mime_type, blink::WebString& charset); virtual blink::WebURLError cancelledError(const blink::WebURL& url) const; - virtual blink::WebWaitableEvent* createWaitableEvent(); - virtual blink::WebWaitableEvent* waitMultipleEvents( - const blink::WebVector& events); virtual blink::WebScrollbarBehavior* scrollbarBehavior(); virtual const unsigned char* getTraceCategoryEnabledFlag( const char* category_name); -- GitLab