[gin] Implement v8::TaskRunners

With this CL the gin platform implements the new v8::Platform API
functions {GetForegroundTaskRunner} and {GetBackgroundTaskRunner}.

The existing task posting function of the V8Platform now also use these
taskrunners to post tasks. Thereby we can move some of the
implementation from the V8Platform and the PerIsolateData to the new
taskrunners.

[email protected]

Change-Id: I27ea6dd5f6ef8409e394f23ad914f468c09ded4a
Reviewed-on: https://chromium-review.googlesource.com/758578
Commit-Queue: Andreas Haas <[email protected]>
Reviewed-by: François Doray <[email protected]>
Reviewed-by: Ross McIlroy <[email protected]>
Cr-Commit-Position: refs/heads/master@{#517067}
diff --git a/gin/v8_foreground_task_runner_base.cc b/gin/v8_foreground_task_runner_base.cc
new file mode 100644
index 0000000..53f6104
--- /dev/null
+++ b/gin/v8_foreground_task_runner_base.cc
@@ -0,0 +1,22 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "v8_foreground_task_runner_base.h"
+
+namespace gin {
+
+V8ForegroundTaskRunnerBase::V8ForegroundTaskRunnerBase() {}
+
+V8ForegroundTaskRunnerBase::~V8ForegroundTaskRunnerBase() {}
+
+void V8ForegroundTaskRunnerBase::EnableIdleTasks(
+    std::unique_ptr<V8IdleTaskRunner> idle_task_runner) {
+  idle_task_runner_ = std::move(idle_task_runner);
+}
+
+bool V8ForegroundTaskRunnerBase::IdleTasksEnabled() {
+  return idle_task_runner() != nullptr;
+}
+
+}  // namespace gin