summaryrefslogtreecommitdiff
path: root/chromium/gin
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-04-05 14:08:31 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-04-11 07:46:53 +0000
commit6a4cabb866f66d4128a97cdc6d9d08ce074f1247 (patch)
treeab00f70a5e89278d6a0d16ff0c42578dc4d84a2d /chromium/gin
parente733310db58160074f574c429d48f8308c0afe17 (diff)
downloadqtwebengine-chromium-6a4cabb866f66d4128a97cdc6d9d08ce074f1247.tar.gz
BASELINE: Update Chromium to 57.0.2987.144
Change-Id: I29db402ff696c71a04c4dbaec822c2e53efe0267 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'chromium/gin')
-rw-r--r--chromium/gin/function_template.h2
-rw-r--r--chromium/gin/gin_features.cc7
-rw-r--r--chromium/gin/isolate_holder.cc12
-rw-r--r--chromium/gin/per_isolate_data.cc11
-rw-r--r--chromium/gin/per_isolate_data.h3
-rw-r--r--chromium/gin/public/gin_features.h2
-rw-r--r--chromium/gin/public/isolate_holder.h11
-rw-r--r--chromium/gin/shell/gin_main.cc3
-rw-r--r--chromium/gin/shell_runner_unittest.cc3
-rw-r--r--chromium/gin/v8_initializer.cc4
10 files changed, 36 insertions, 22 deletions
diff --git a/chromium/gin/function_template.h b/chromium/gin/function_template.h
index 69ce797c721..a4c22f2f96e 100644
--- a/chromium/gin/function_template.h
+++ b/chromium/gin/function_template.h
@@ -17,8 +17,6 @@
namespace gin {
-class PerIsolateData;
-
enum CreateFunctionTemplateFlags {
HolderIsFirstArgument = 1 << 0,
};
diff --git a/chromium/gin/gin_features.cc b/chromium/gin/gin_features.cc
index b474b191ac3..7699db7a286 100644
--- a/chromium/gin/gin_features.cc
+++ b/chromium/gin/gin_features.cc
@@ -6,9 +6,10 @@
namespace features {
-// Enables or disables the V8 Ignition interpreter.
-const base::Feature kV8Ignition {
- "V8Ignition", base::FEATURE_DISABLED_BY_DEFAULT
+// Enables or disables the future compiler pipeline of V8, with the Ignition
+// interpreter and TurboFan compiler.
+const base::Feature kV8Future {
+ "V8Future", base::FEATURE_DISABLED_BY_DEFAULT
};
// Enables or disables the V8 Ignition interpreter on low end
diff --git a/chromium/gin/isolate_holder.cc b/chromium/gin/isolate_holder.cc
index 04449d26ab5..e38190c4285 100644
--- a/chromium/gin/isolate_holder.cc
+++ b/chromium/gin/isolate_holder.cc
@@ -27,10 +27,13 @@ namespace {
v8::ArrayBuffer::Allocator* g_array_buffer_allocator = nullptr;
} // namespace
-IsolateHolder::IsolateHolder() : IsolateHolder(AccessMode::kSingleThread) {
-}
+IsolateHolder::IsolateHolder(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner)
+ : IsolateHolder(std::move(task_runner), AccessMode::kSingleThread) {}
-IsolateHolder::IsolateHolder(AccessMode access_mode)
+IsolateHolder::IsolateHolder(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner,
+ AccessMode access_mode)
: access_mode_(access_mode) {
v8::ArrayBuffer::Allocator* allocator = g_array_buffer_allocator;
CHECK(allocator) << "You need to invoke gin::IsolateHolder::Initialize first";
@@ -41,7 +44,8 @@ IsolateHolder::IsolateHolder(AccessMode access_mode)
base::SysInfo::AmountOfVirtualMemory());
params.array_buffer_allocator = allocator;
isolate_ = v8::Isolate::New(params);
- isolate_data_.reset(new PerIsolateData(isolate_, allocator, access_mode));
+ isolate_data_.reset(
+ new PerIsolateData(isolate_, allocator, access_mode, task_runner));
isolate_memory_dump_provider_.reset(new V8IsolateMemoryDumpProvider(this));
#if defined(OS_WIN)
{
diff --git a/chromium/gin/per_isolate_data.cc b/chromium/gin/per_isolate_data.cc
index 261782eeaa5..029b93d5f7a 100644
--- a/chromium/gin/per_isolate_data.cc
+++ b/chromium/gin/per_isolate_data.cc
@@ -21,13 +21,16 @@ using v8::ObjectTemplate;
namespace gin {
-PerIsolateData::PerIsolateData(Isolate* isolate,
- ArrayBuffer::Allocator* allocator,
- IsolateHolder::AccessMode access_mode)
+PerIsolateData::PerIsolateData(
+ Isolate* isolate,
+ ArrayBuffer::Allocator* allocator,
+ IsolateHolder::AccessMode access_mode,
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner)
: isolate_(isolate),
allocator_(allocator),
access_mode_(access_mode),
- task_runner_(base::ThreadTaskRunnerHandle::Get()) {
+ task_runner_(
+ task_runner ? task_runner : base::ThreadTaskRunnerHandle::Get()) {
isolate_->SetData(kEmbedderNativeGin, this);
}
diff --git a/chromium/gin/per_isolate_data.h b/chromium/gin/per_isolate_data.h
index 4b4037b1b8b..ac0cf95ab35 100644
--- a/chromium/gin/per_isolate_data.h
+++ b/chromium/gin/per_isolate_data.h
@@ -32,7 +32,8 @@ class GIN_EXPORT PerIsolateData {
public:
PerIsolateData(v8::Isolate* isolate,
v8::ArrayBuffer::Allocator* allocator,
- IsolateHolder::AccessMode access_mode);
+ IsolateHolder::AccessMode access_mode,
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner);
~PerIsolateData();
static PerIsolateData* From(v8::Isolate* isolate);
diff --git a/chromium/gin/public/gin_features.h b/chromium/gin/public/gin_features.h
index 1a8a70456d0..69170c54071 100644
--- a/chromium/gin/public/gin_features.h
+++ b/chromium/gin/public/gin_features.h
@@ -13,7 +13,7 @@
namespace features {
-GIN_EXPORT extern const base::Feature kV8Ignition;
+GIN_EXPORT extern const base::Feature kV8Future;
GIN_EXPORT extern const base::Feature kV8IgnitionLowEnd;
} // namespace features
diff --git a/chromium/gin/public/isolate_holder.h b/chromium/gin/public/isolate_holder.h
index 7cf3d94ac89..62b87108580 100644
--- a/chromium/gin/public/isolate_holder.h
+++ b/chromium/gin/public/isolate_holder.h
@@ -8,10 +8,15 @@
#include <memory>
#include "base/macros.h"
+#include "base/memory/ref_counted.h"
#include "gin/gin_export.h"
#include "gin/public/v8_idle_task_runner.h"
#include "v8/include/v8.h"
+namespace base {
+class SingleThreadTaskRunner;
+}
+
namespace gin {
class PerIsolateData;
@@ -42,8 +47,10 @@ class GIN_EXPORT IsolateHolder {
kStableAndExperimentalV8Extras,
};
- IsolateHolder();
- explicit IsolateHolder(AccessMode access_mode);
+ explicit IsolateHolder(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner);
+ IsolateHolder(scoped_refptr<base::SingleThreadTaskRunner> task_runner,
+ AccessMode access_mode);
~IsolateHolder();
// Should be invoked once before creating IsolateHolder instances to
diff --git a/chromium/gin/shell/gin_main.cc b/chromium/gin/shell/gin_main.cc
index e73ce1f6dd0..c7cf598756d 100644
--- a/chromium/gin/shell/gin_main.cc
+++ b/chromium/gin/shell/gin_main.cc
@@ -80,8 +80,7 @@ int main(int argc, char** argv) {
gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode,
gin::IsolateHolder::kStableV8Extras,
gin::ArrayBufferAllocator::SharedInstance());
- gin::IsolateHolder instance;
-
+ gin::IsolateHolder instance(base::ThreadTaskRunnerHandle::Get());
gin::GinShellRunnerDelegate delegate;
gin::ShellRunner runner(&delegate, instance.isolate());
diff --git a/chromium/gin/shell_runner_unittest.cc b/chromium/gin/shell_runner_unittest.cc
index abd4f3cb755..0743ededb62 100644
--- a/chromium/gin/shell_runner_unittest.cc
+++ b/chromium/gin/shell_runner_unittest.cc
@@ -6,6 +6,7 @@
#include "base/compiler_specific.h"
#include "base/message_loop/message_loop.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "gin/array_buffer.h"
#include "gin/converter.h"
#include "gin/public/isolate_holder.h"
@@ -35,7 +36,7 @@ TEST(RunnerTest, Run) {
gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode,
gin::IsolateHolder::kStableV8Extras,
gin::ArrayBufferAllocator::SharedInstance());
- gin::IsolateHolder instance;
+ gin::IsolateHolder instance(base::ThreadTaskRunnerHandle::Get());
ShellRunnerDelegate delegate;
Isolate* isolate = instance.isolate();
diff --git a/chromium/gin/v8_initializer.cc b/chromium/gin/v8_initializer.cc
index 99276f4a272..9abea43866b 100644
--- a/chromium/gin/v8_initializer.cc
+++ b/chromium/gin/v8_initializer.cc
@@ -419,9 +419,9 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
}
const char* ignition_enabled_crash_key = "N";
- if (base::FeatureList::IsEnabled(features::kV8Ignition)) {
+ if (base::FeatureList::IsEnabled(features::kV8Future)) {
ignition_enabled_crash_key = "Y";
- std::string flag("--ignition-staging");
+ std::string flag("--future");
v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size()));
} else if (base::FeatureList::IsEnabled(features::kV8IgnitionLowEnd) &&
base::SysInfo::IsLowEndDevice()) {