diff options
author | jochen <jochen@chromium.org> | 2014-09-24 09:15:34 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-24 16:15:48 +0000 |
commit | 82b9096939b7e60095fc822c31975b25ee22e37b (patch) | |
tree | c77fea6b500fb5ce87ea995272647c7ee7d6fcb1 | |
parent | b96dffdfbe3f5beda0ab24bc0d4688c71dfd6286 (diff) | |
download | chromium_src-82b9096939b7e60095fc822c31975b25ee22e37b.zip chromium_src-82b9096939b7e60095fc822c31975b25ee22e37b.tar.gz chromium_src-82b9096939b7e60095fc822c31975b25ee22e37b.tar.bz2 |
Implement blink::Platform::yieldCurrentThread()
Since we use an embedder provided thread everywhere, we should also let
the embedder do the yielding.
BUG=301514
R=jamesr@chromium.org
Review URL: https://codereview.chromium.org/596243002
Cr-Commit-Position: refs/heads/master@{#296432}
-rw-r--r-- | content/child/blink_platform_impl.cc | 5 | ||||
-rw-r--r-- | content/child/blink_platform_impl.h | 1 | ||||
-rw-r--r-- | mojo/services/html_viewer/blink_platform_impl.cc | 5 | ||||
-rw-r--r-- | mojo/services/html_viewer/blink_platform_impl.h | 1 |
4 files changed, 12 insertions, 0 deletions
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc index dc71511..85a391c 100644 --- a/content/child/blink_platform_impl.cc +++ b/content/child/blink_platform_impl.cc @@ -25,6 +25,7 @@ #include "base/synchronization/lock.h" #include "base/synchronization/waitable_event.h" #include "base/sys_info.h" +#include "base/threading/platform_thread.h" #include "base/time/time.h" #include "blink/public/resources/grit/blink_resources.h" #include "content/app/resources/grit/content_resources.h" @@ -494,6 +495,10 @@ blink::WebThread* BlinkPlatformImpl::currentThread() { return thread; } +void BlinkPlatformImpl::yieldCurrentThread() { + base::PlatformThread::YieldCurrentThread(); +} + blink::WebWaitableEvent* BlinkPlatformImpl::createWaitableEvent() { return new WebWaitableEventImpl(); } diff --git a/content/child/blink_platform_impl.h b/content/child/blink_platform_impl.h index 797aae1..b39f1f8 100644 --- a/content/child/blink_platform_impl.h +++ b/content/child/blink_platform_impl.h @@ -86,6 +86,7 @@ class CONTENT_EXPORT BlinkPlatformImpl virtual bool isReservedIPAddress(const blink::WebURL&) const OVERRIDE; virtual blink::WebThread* createThread(const char* name); virtual blink::WebThread* currentThread(); + virtual void yieldCurrentThread(); virtual blink::WebWaitableEvent* createWaitableEvent(); virtual blink::WebWaitableEvent* waitMultipleEvents( const blink::WebVector<blink::WebWaitableEvent*>& events); diff --git a/mojo/services/html_viewer/blink_platform_impl.cc b/mojo/services/html_viewer/blink_platform_impl.cc index 315a850..8a7555b 100644 --- a/mojo/services/html_viewer/blink_platform_impl.cc +++ b/mojo/services/html_viewer/blink_platform_impl.cc @@ -9,6 +9,7 @@ #include "base/rand_util.h" #include "base/stl_util.h" #include "base/synchronization/waitable_event.h" +#include "base/threading/platform_thread.h" #include "base/time/time.h" #include "mojo/public/cpp/application/application_impl.h" #include "mojo/services/html_viewer/webclipboard_impl.h" @@ -221,6 +222,10 @@ blink::WebThread* BlinkPlatformImpl::currentThread() { return thread; } +void BlinkPlatformImpl::yieldCurrentThread() { + base::PlatformThread::YieldCurrentThread(); +} + blink::WebWaitableEvent* BlinkPlatformImpl::createWaitableEvent() { return new WebWaitableEventImpl(); } diff --git a/mojo/services/html_viewer/blink_platform_impl.h b/mojo/services/html_viewer/blink_platform_impl.h index 522f98d..9abd336 100644 --- a/mojo/services/html_viewer/blink_platform_impl.h +++ b/mojo/services/html_viewer/blink_platform_impl.h @@ -51,6 +51,7 @@ class BlinkPlatformImpl : public blink::Platform { virtual blink::WebURLError cancelledError(const blink::WebURL& url) const; virtual blink::WebThread* createThread(const char* name); virtual blink::WebThread* currentThread(); + virtual void yieldCurrentThread(); virtual blink::WebWaitableEvent* createWaitableEvent(); virtual blink::WebWaitableEvent* waitMultipleEvents( const blink::WebVector<blink::WebWaitableEvent*>& events); |