Commit 4bba0ea7 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[platform] Avoid duplicate task runner lookup

Minor refactoring, for readability and performance.

R=ahaas@chromium.org

Bug: v8:8015
Change-Id: I30c4a76998c8867aea0e08fd982b4425d4ae8fef
Reviewed-on: https://chromium-review.googlesource.com/1251163Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56285}
parent de5d1200
...@@ -140,11 +140,9 @@ bool DefaultPlatform::PumpMessageLoop(v8::Isolate* isolate, ...@@ -140,11 +140,9 @@ bool DefaultPlatform::PumpMessageLoop(v8::Isolate* isolate,
std::shared_ptr<DefaultForegroundTaskRunner> task_runner; std::shared_ptr<DefaultForegroundTaskRunner> task_runner;
{ {
base::LockGuard<base::Mutex> guard(&lock_); base::LockGuard<base::Mutex> guard(&lock_);
if (foreground_task_runner_map_.find(isolate) == auto it = foreground_task_runner_map_.find(isolate);
foreground_task_runner_map_.end()) { if (it == foreground_task_runner_map_.end()) return failed_result;
return failed_result; task_runner = it->second;
}
task_runner = foreground_task_runner_map_[isolate];
} }
std::unique_ptr<Task> task = task_runner->PopTaskFromQueue(wait_for_work); std::unique_ptr<Task> task = task_runner->PopTaskFromQueue(wait_for_work);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment