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

Unified Diff: content/child/shared_memory_data_consumer_handle.cc

Issue 2177243002: Use per-frame TaskRunner instead of thread's default in DataConsumerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@data_consumer_handle_unique_ptr
Patch Set: update Created 4 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
Index: content/child/shared_memory_data_consumer_handle.cc
diff --git a/content/child/shared_memory_data_consumer_handle.cc b/content/child/shared_memory_data_consumer_handle.cc
index 3c9b7a26ff8e65e81374fbc3a9524c8323ac5d96..ba5e2cec2973ecb7853a545e46583a551cccd5b1 100644
--- a/content/child/shared_memory_data_consumer_handle.cc
+++ b/content/child/shared_memory_data_consumer_handle.cc
@@ -15,6 +15,7 @@
#include "base/single_thread_task_runner.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "components/scheduler/child/web_task_runner_impl.h"
#include "content/public/child/fixed_received_data.h"
namespace content {
@@ -119,7 +120,15 @@ class SharedMemoryDataConsumerHandle::Context final
lock_.AssertAcquired();
DCHECK(!notification_task_runner_);
DCHECK(!client_);
- notification_task_runner_ = base::ThreadTaskRunnerHandle::Get();
+
+ blink::WebTaskRunner* task_runner =
+ client ? client->getTaskRunner() : nullptr;
+ if (task_runner) {
+ notification_task_runner_ =
+ scheduler::WebTaskRunnerImpl::GetBaseTaskRunner(*task_runner);
kinuko 2016/07/28 15:41:31 Per Sami's comment this would be a tentative solut
+ } else {
+ notification_task_runner_ = base::ThreadTaskRunnerHandle::Get();
+ }
client_ = client;
if (client && !(IsEmpty() && result() == Ok)) {
// We cannot notify synchronously because the user doesn't have the reader

Powered by Google App Engine
This is Rietveld 408576698