From 37a321a601204d2a375ef50124bfe60a942de04a Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Mon, 18 Dec 2017 18:55:03 +1100 Subject: [PATCH] Fix super fast hash and blocking pool --- .../chrome/browser/media/native_desktop_media_list.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/chromium_src/chrome/browser/media/native_desktop_media_list.cc b/chromium_src/chrome/browser/media/native_desktop_media_list.cc index f0eb075eba9..8b95d53dcd8 100644 --- a/chromium_src/chrome/browser/media/native_desktop_media_list.cc +++ b/chromium_src/chrome/browser/media/native_desktop_media_list.cc @@ -14,6 +14,7 @@ using base::PlatformThreadRef; #include "base/logging.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" +#include "base/task_scheduler/post_task.h" #include "base/threading/sequenced_worker_pool.h" #include "chrome/browser/media/desktop_media_list_observer.h" #include "content/public/browser/browser_thread.h" @@ -28,6 +29,8 @@ using base::PlatformThreadRef; using content::BrowserThread; using content::DesktopMediaID; +extern "C" uint32_t SuperFastHash(const char* data, int len); + namespace { // Update the list every second. @@ -37,7 +40,7 @@ const int kDefaultUpdatePeriod = 1000; // media source has changed. uint32_t GetFrameHash(webrtc::DesktopFrame* frame) { int data_size = frame->stride() * frame->size().height(); - return base::SuperFastHash(reinterpret_cast(frame->data()), data_size); + return SuperFastHash(reinterpret_cast(frame->data()), data_size); } gfx::ImageSkia ScaleDesktopFrame(std::unique_ptr frame, @@ -235,9 +238,8 @@ NativeDesktopMediaList::NativeDesktopMediaList( view_dialog_id_(-1), observer_(NULL), weak_factory_(this) { - base::SequencedWorkerPool* worker_pool = BrowserThread::GetBlockingPool(); - capture_task_runner_ = worker_pool->GetSequencedTaskRunner( - worker_pool->GetSequenceToken()); + capture_task_runner_ = base::CreateSequencedTaskRunnerWithTraits( + {base::MayBlock()}); } NativeDesktopMediaList::~NativeDesktopMediaList() {