summaryrefslogtreecommitdiff
path: root/chromium/gin
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-07-31 15:50:41 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-08-30 12:35:23 +0000
commit7b2ffa587235a47d4094787d72f38102089f402a (patch)
tree30e82af9cbab08a7fa028bb18f4f2987a3f74dfa /chromium/gin
parentd94af01c90575348c4e81a418257f254b6f8d225 (diff)
downloadqtwebengine-chromium-7b2ffa587235a47d4094787d72f38102089f402a.tar.gz
BASELINE: Update Chromium to 76.0.3809.94
Change-Id: I321c3f5f929c105aec0f98c5091ef6108822e647 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/gin')
-rw-r--r--chromium/gin/gin_features.cc4
-rw-r--r--chromium/gin/gin_features.h1
-rw-r--r--chromium/gin/shell/gin_main.cc8
-rw-r--r--chromium/gin/v8_initializer.cc7
-rw-r--r--chromium/gin/v8_isolate_memory_dump_provider_unittest.cc3
-rw-r--r--chromium/gin/v8_platform.cc34
6 files changed, 49 insertions, 8 deletions
diff --git a/chromium/gin/gin_features.cc b/chromium/gin/gin_features.cc
index 0000db391df..3e6f1cc2fe2 100644
--- a/chromium/gin/gin_features.cc
+++ b/chromium/gin/gin_features.cc
@@ -18,4 +18,8 @@ const base::Feature kV8FlushBytecode{"V8FlushBytecode",
const base::Feature kV8MemoryReducerForSmallHeaps{
"V8MemoryReducerForSmallHeaps", base::FEATURE_ENABLED_BY_DEFAULT};
+// Increase V8 heap size to 4GB if the physical memory is bigger than 16 GB.
+const base::Feature kV8HugeMaxOldGenerationSize{
+ "V8HugeMaxOldGenerationSize", base::FEATURE_DISABLED_BY_DEFAULT};
+
} // namespace features
diff --git a/chromium/gin/gin_features.h b/chromium/gin/gin_features.h
index 9edc5ffe343..f5f18b3ab25 100644
--- a/chromium/gin/gin_features.h
+++ b/chromium/gin/gin_features.h
@@ -13,6 +13,7 @@ namespace features {
GIN_EXPORT extern const base::Feature kV8OptimizeJavascript;
GIN_EXPORT extern const base::Feature kV8FlushBytecode;
GIN_EXPORT extern const base::Feature kV8MemoryReducerForSmallHeaps;
+GIN_EXPORT extern const base::Feature kV8HugeMaxOldGenerationSize;
} // namespace features
diff --git a/chromium/gin/shell/gin_main.cc b/chromium/gin/shell/gin_main.cc
index 884b902f71b..0f05ac7c9d1 100644
--- a/chromium/gin/shell/gin_main.cc
+++ b/chromium/gin/shell/gin_main.cc
@@ -11,9 +11,9 @@
#include "base/location.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
-#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
+#include "base/task/single_thread_task_executor.h"
#include "base/task/thread_pool/thread_pool.h"
#include "base/threading/thread_task_runner_handle.h"
#include "gin/array_buffer.h"
@@ -74,8 +74,8 @@ int main(int argc, char** argv) {
gin::V8Initializer::LoadV8Natives();
#endif
- base::MessageLoop message_loop;
- base::ThreadPool::CreateAndStartWithDefaultParams("gin");
+ base::SingleThreadTaskExecutor main_thread_task_executor;
+ base::ThreadPoolInstance::CreateAndStartWithDefaultParams("gin");
// Initialize the base::FeatureList since IsolateHolder can depend on it.
base::FeatureList::SetInstance(base::WrapUnique(new base::FeatureList));
@@ -112,7 +112,7 @@ int main(int argc, char** argv) {
// gin::IsolateHolder waits for tasks running in ThreadPool in its
// destructor and thus must be destroyed before ThreadPool starts skipping
// CONTINUE_ON_SHUTDOWN tasks.
- base::ThreadPool::GetInstance()->Shutdown();
+ base::ThreadPoolInstance::Get()->Shutdown();
return 0;
}
diff --git a/chromium/gin/v8_initializer.cc b/chromium/gin/v8_initializer.cc
index c8baaa5e755..770f3cb5299 100644
--- a/chromium/gin/v8_initializer.cc
+++ b/chromium/gin/v8_initializer.cc
@@ -232,6 +232,13 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode) {
sizeof(no_memory_reducer) - 1);
}
+ if (base::FeatureList::IsEnabled(features::kV8HugeMaxOldGenerationSize)) {
+ static const char huge_max_old_generation_size[] =
+ "--huge_max_old_generation_size";
+ v8::V8::SetFlagsFromString(huge_max_old_generation_size,
+ sizeof(huge_max_old_generation_size) - 1);
+ }
+
if (IsolateHolder::kStrictMode == mode) {
static const char use_strict[] = "--use_strict";
v8::V8::SetFlagsFromString(use_strict, sizeof(use_strict) - 1);
diff --git a/chromium/gin/v8_isolate_memory_dump_provider_unittest.cc b/chromium/gin/v8_isolate_memory_dump_provider_unittest.cc
index a4241085b0d..26962eed61f 100644
--- a/chromium/gin/v8_isolate_memory_dump_provider_unittest.cc
+++ b/chromium/gin/v8_isolate_memory_dump_provider_unittest.cc
@@ -31,8 +31,7 @@ TEST_F(V8MemoryDumpProviderTest, DumpStatistics) {
// not set before V8::InitializePlatform the sizes will not be accurate, but
// this serves the purpose of this test.
const char track_objects_flag[] = "--track-gc-object-stats";
- v8::V8::SetFlagsFromString(track_objects_flag,
- static_cast<int>(strlen(track_objects_flag)));
+ v8::V8::SetFlagsFromString(track_objects_flag, strlen(track_objects_flag));
base::trace_event::MemoryDumpArgs dump_args = {
base::trace_event::MemoryDumpLevelOfDetail::DETAILED};
diff --git a/chromium/gin/v8_platform.cc b/chromium/gin/v8_platform.cc
index 53263bf382e..037beda0203 100644
--- a/chromium/gin/v8_platform.cc
+++ b/chromium/gin/v8_platform.cc
@@ -321,6 +321,36 @@ class V8Platform::TracingControllerImpl : public v8::TracingController {
memcpy(&result, &handle, sizeof(result));
return result;
}
+ uint64_t AddTraceEventWithTimestamp(
+ char phase,
+ const uint8_t* category_enabled_flag,
+ const char* name,
+ const char* scope,
+ uint64_t id,
+ uint64_t bind_id,
+ int32_t num_args,
+ const char** arg_names,
+ const uint8_t* arg_types,
+ const uint64_t* arg_values,
+ std::unique_ptr<v8::ConvertableToTraceFormat>* arg_convertables,
+ unsigned int flags,
+ int64_t timestampMicroseconds) override {
+ base::trace_event::TraceArguments args(
+ num_args, arg_names, arg_types,
+ reinterpret_cast<const unsigned long long*>(arg_values),
+ arg_convertables);
+ DCHECK_LE(num_args, 2);
+ base::TimeTicks timestamp =
+ base::TimeTicks() +
+ base::TimeDelta::FromMicroseconds(timestampMicroseconds);
+ base::trace_event::TraceEventHandle handle =
+ TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP(
+ phase, category_enabled_flag, name, scope, id, bind_id,
+ TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, &args, flags);
+ uint64_t result;
+ memcpy(&result, &handle, sizeof(result));
+ return result;
+ }
void UpdateTraceEventDuration(const uint8_t* category_enabled_flag,
const char* name,
uint64_t handle) override {
@@ -371,11 +401,11 @@ int V8Platform::NumberOfWorkerThreads() {
// V8Platform assumes the scheduler uses the same set of workers for default
// and user blocking tasks.
const int num_foreground_workers =
- base::ThreadPool::GetInstance()
+ base::ThreadPoolInstance::Get()
->GetMaxConcurrentNonBlockedTasksWithTraitsDeprecated(
kDefaultTaskTraits);
DCHECK_EQ(num_foreground_workers,
- base::ThreadPool::GetInstance()
+ base::ThreadPoolInstance::Get()
->GetMaxConcurrentNonBlockedTasksWithTraitsDeprecated(
kBlockingTaskTraits));
return std::max(1, num_foreground_workers);