summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authoroth <oth@chromium.org>2015-04-05 07:30:57 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-05 14:31:16 +0000
commit05c26fde422600a25247a22f9670463216d0519a (patch)
treea2443f512888c10b64f892b4f78f200d18c4575d /content
parentf13b7592e312f69e70062fbcf72b746eefaf13fc (diff)
downloadchromium_src-05c26fde422600a25247a22f9670463216d0519a.zip
chromium_src-05c26fde422600a25247a22f9670463216d0519a.tar.gz
chromium_src-05c26fde422600a25247a22f9670463216d0519a.tar.bz2
Move V8 snapshot loading code from isolate_holder to gin/v8_startup_data.{h,cc}.
isolate_holder.h is public and used by blink and therefore cannot refer to types from base. As part of porting this to other platforms we needed to load snapshots from BaseFile descriptors. BUG=421063 Review URL: https://codereview.chromium.org/1011133006 Cr-Commit-Position: refs/heads/master@{#323886}
Diffstat (limited to 'content')
-rw-r--r--content/app/DEPS1
-rw-r--r--content/app/content_main_runner.cc8
-rw-r--r--content/public/test/DEPS2
-rw-r--r--content/public/test/content_test_suite_base.cc4
-rw-r--r--content/shell/DEPS1
-rw-r--r--content/shell/browser/shell_content_browser_client.cc8
-rw-r--r--content/test/DEPS2
-rw-r--r--content/test/content_test_launcher.cc4
-rw-r--r--content/test/test_blink_web_unit_test_support.cc4
9 files changed, 18 insertions, 16 deletions
diff --git a/content/app/DEPS b/content/app/DEPS
index 61f7537..b6d8307 100644
--- a/content/app/DEPS
+++ b/content/app/DEPS
@@ -5,5 +5,6 @@ include_rules = [
# For loading V8's initial snapshot from external files.
"+gin/public/isolate_holder.h",
"+gin/public/snapshot_fd_data.h",
+ "+gin/v8_initializer.h",
"+media/base", # For initializing media library.
]
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index 7c8e7eb..f14c6eb 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -51,7 +51,7 @@
#include "ui/base/ui_base_switches.h"
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
-#include "gin/public/isolate_holder.h"
+#include "gin/v8_initializer.h"
#endif
#if defined(USE_TCMALLOC)
@@ -718,14 +718,14 @@ class ContentMainRunnerImpl : public ContentMainRunner {
if (v8_natives_fd != -1 && v8_snapshot_fd != -1) {
auto v8_natives_region = g_fds->GetRegion(kV8NativesDataDescriptor);
auto v8_snapshot_region = g_fds->GetRegion(kV8SnapshotDataDescriptor);
- CHECK(gin::IsolateHolder::LoadV8SnapshotFd(
+ CHECK(gin::V8Initializer::LoadV8SnapshotFromFD(
v8_natives_fd, v8_natives_region.offset, v8_natives_region.size,
v8_snapshot_fd, v8_snapshot_region.offset, v8_snapshot_region.size));
} else {
- CHECK(gin::IsolateHolder::LoadV8Snapshot());
+ CHECK(gin::V8Initializer::LoadV8Snapshot());
}
#else
- CHECK(gin::IsolateHolder::LoadV8Snapshot());
+ CHECK(gin::V8Initializer::LoadV8Snapshot());
#endif // OS_POSIX && !OS_MACOSX
#endif // V8_USE_EXTERNAL_STARTUP_DATA
diff --git a/content/public/test/DEPS b/content/public/test/DEPS
index 43a7d3c..e897ad3 100644
--- a/content/public/test/DEPS
+++ b/content/public/test/DEPS
@@ -9,7 +9,7 @@ specific_include_rules = {
".*\.cc": [
# Testing utilities can access anything in content/
"+content",
- "+gin/public/isolate_holder.h",
+ "+gin/v8_initializer.h",
"+media/base",
"+third_party/iaccessible2",
"+ui/base/resource/resource_bundle.h",
diff --git a/content/public/test/content_test_suite_base.cc b/content/public/test/content_test_suite_base.cc
index 81821b0..a19b03f 100644
--- a/content/public/test/content_test_suite_base.cc
+++ b/content/public/test/content_test_suite_base.cc
@@ -44,7 +44,7 @@
#endif
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
-#include "gin/public/isolate_holder.h"
+#include "gin/v8_initializer.h"
#endif
namespace content {
@@ -73,7 +73,7 @@ void ContentTestSuiteBase::Initialize() {
base::StatisticsRecorder::Initialize();
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
- gin::IsolateHolder::LoadV8Snapshot();
+ gin::V8Initializer::LoadV8Snapshot();
#endif
#if defined(OS_ANDROID)
diff --git a/content/shell/DEPS b/content/shell/DEPS
index a46f5cf..3dfeb6b 100644
--- a/content/shell/DEPS
+++ b/content/shell/DEPS
@@ -1,5 +1,6 @@
include_rules = [
"+gin/public",
+ "+gin/v8_initializer.h",
"+v8/include",
# For chromeos build config
diff --git a/content/shell/browser/shell_content_browser_client.cc b/content/shell/browser/shell_content_browser_client.cc
index c10761f..9cf8473 100644
--- a/content/shell/browser/shell_content_browser_client.cc
+++ b/content/shell/browser/shell_content_browser_client.cc
@@ -34,7 +34,7 @@
#include "content/shell/common/shell_messages.h"
#include "content/shell/common/shell_switches.h"
#include "content/shell/common/webkit_test_helpers.h"
-#include "gin/public/isolate_holder.h"
+#include "gin/v8_initializer.h"
#include "net/url_request/url_request_context_getter.h"
#include "url/gurl.h"
@@ -335,14 +335,14 @@ void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
if (v8_snapshot_fd_.get() == -1 && v8_natives_fd_.get() == -1) {
base::FilePath v8_data_path;
- PathService::Get(gin::IsolateHolder::kV8SnapshotBasePathKey, &v8_data_path);
+ PathService::Get(gin::V8Initializer::kV8SnapshotBasePathKey, &v8_data_path);
DCHECK(!v8_data_path.empty());
int file_flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
base::FilePath v8_natives_data_path =
- v8_data_path.AppendASCII(gin::IsolateHolder::kNativesFileName);
+ v8_data_path.AppendASCII(gin::V8Initializer::kNativesFileName);
base::FilePath v8_snapshot_data_path =
- v8_data_path.AppendASCII(gin::IsolateHolder::kSnapshotFileName);
+ v8_data_path.AppendASCII(gin::V8Initializer::kSnapshotFileName);
base::File v8_natives_data_file(v8_natives_data_path, file_flags);
base::File v8_snapshot_data_file(v8_snapshot_data_path, file_flags);
DCHECK(v8_natives_data_file.IsValid());
diff --git a/content/test/DEPS b/content/test/DEPS
index 7d1b3d9..b0b89c0 100644
--- a/content/test/DEPS
+++ b/content/test/DEPS
@@ -4,7 +4,7 @@ include_rules = [
# Testing utilities can access anything in content/
"+content",
# For loading V8's initial snapshot from external files.
- "+gin/public/isolate_holder.h",
+ "+gin/v8_initializer.h",
"+media/audio", # For AudioParameters in WebRTC tests.
"+media/base", # For ChannelLayout in WebRTC tests.
"+ui/base/resource/data_pack.h",
diff --git a/content/test/content_test_launcher.cc b/content/test/content_test_launcher.cc
index 7c7eb27..9b30fdb 100644
--- a/content/test/content_test_launcher.cc
+++ b/content/test/content_test_launcher.cc
@@ -21,7 +21,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
-#include "gin/public/isolate_holder.h"
+#include "gin/v8_initializer.h"
#endif
#if defined(OS_ANDROID)
@@ -57,7 +57,7 @@ class ContentBrowserTestSuite : public ContentTestSuiteBase {
base::i18n::InitializeICU();
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
- gin::IsolateHolder::LoadV8Snapshot();
+ gin::V8Initializer::LoadV8Snapshot();
#endif
// This needs to be done before base::TestSuite::Initialize() is called,
diff --git a/content/test/test_blink_web_unit_test_support.cc b/content/test/test_blink_web_unit_test_support.cc
index 9010d0d..1326e7d 100644
--- a/content/test/test_blink_web_unit_test_support.cc
+++ b/content/test/test_blink_web_unit_test_support.cc
@@ -39,7 +39,7 @@
#endif
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
-#include "gin/public/isolate_holder.h"
+#include "gin/v8_initializer.h"
#endif
namespace content {
@@ -53,7 +53,7 @@ TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport() {
mock_clipboard_.reset(new MockWebClipboardImpl());
#ifdef V8_USE_EXTERNAL_STARTUP_DATA
- gin::IsolateHolder::LoadV8Snapshot();
+ gin::V8Initializer::LoadV8Snapshot();
#endif
if (base::MessageLoopProxy::current()) {