Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(620)

Side by Side Diff: content/app/content_main_runner.cc

Issue 1011133006: Move V8 snapshot loading code from isolate_holder to gin/v8_startup_data.{h,cc}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DEPS tweak suggested by jochen. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/app/content_main_runner.h" 5 #include "content/public/app/content_main_runner.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "base/allocator/allocator_extension.h" 9 #include "base/allocator/allocator_extension.h"
10 #include "base/at_exit.h" 10 #include "base/at_exit.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "content/utility/in_process_utility_thread.h" 44 #include "content/utility/in_process_utility_thread.h"
45 #include "crypto/nss_util.h" 45 #include "crypto/nss_util.h"
46 #include "ipc/ipc_descriptors.h" 46 #include "ipc/ipc_descriptors.h"
47 #include "ipc/ipc_switches.h" 47 #include "ipc/ipc_switches.h"
48 #include "media/base/media.h" 48 #include "media/base/media.h"
49 #include "sandbox/win/src/sandbox_types.h" 49 #include "sandbox/win/src/sandbox_types.h"
50 #include "ui/base/ui_base_paths.h" 50 #include "ui/base/ui_base_paths.h"
51 #include "ui/base/ui_base_switches.h" 51 #include "ui/base/ui_base_switches.h"
52 52
53 #ifdef V8_USE_EXTERNAL_STARTUP_DATA 53 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
54 #include "gin/public/isolate_holder.h" 54 #include "gin/v8_initializer.h"
55 #endif 55 #endif
56 56
57 #if defined(USE_TCMALLOC) 57 #if defined(USE_TCMALLOC)
58 #include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h" 58 #include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h"
59 #if defined(TYPE_PROFILING) 59 #if defined(TYPE_PROFILING)
60 #include "base/allocator/type_profiler.h" 60 #include "base/allocator/type_profiler.h"
61 #include "base/allocator/type_profiler_tcmalloc.h" 61 #include "base/allocator/type_profiler_tcmalloc.h"
62 #endif 62 #endif
63 #endif 63 #endif
64 64
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 g_fds->Set( 710 g_fds->Set(
711 kV8SnapshotDataDescriptor, 711 kV8SnapshotDataDescriptor,
712 kV8SnapshotDataDescriptor + base::GlobalDescriptors::kBaseDescriptor); 712 kV8SnapshotDataDescriptor + base::GlobalDescriptors::kBaseDescriptor);
713 } 713 }
714 #endif // !OS_ANDROID 714 #endif // !OS_ANDROID
715 int v8_natives_fd = g_fds->MaybeGet(kV8NativesDataDescriptor); 715 int v8_natives_fd = g_fds->MaybeGet(kV8NativesDataDescriptor);
716 int v8_snapshot_fd = g_fds->MaybeGet(kV8SnapshotDataDescriptor); 716 int v8_snapshot_fd = g_fds->MaybeGet(kV8SnapshotDataDescriptor);
717 if (v8_natives_fd != -1 && v8_snapshot_fd != -1) { 717 if (v8_natives_fd != -1 && v8_snapshot_fd != -1) {
718 auto v8_natives_region = g_fds->GetRegion(kV8NativesDataDescriptor); 718 auto v8_natives_region = g_fds->GetRegion(kV8NativesDataDescriptor);
719 auto v8_snapshot_region = g_fds->GetRegion(kV8SnapshotDataDescriptor); 719 auto v8_snapshot_region = g_fds->GetRegion(kV8SnapshotDataDescriptor);
720 CHECK(gin::IsolateHolder::LoadV8SnapshotFd( 720 CHECK(gin::V8Initializer::LoadV8SnapshotFromFD(
721 v8_natives_fd, v8_natives_region.offset, v8_natives_region.size, 721 v8_natives_fd, v8_natives_region.offset, v8_natives_region.size,
722 v8_snapshot_fd, v8_snapshot_region.offset, v8_snapshot_region.size)); 722 v8_snapshot_fd, v8_snapshot_region.offset, v8_snapshot_region.size));
723 } else { 723 } else {
724 CHECK(gin::IsolateHolder::LoadV8Snapshot()); 724 CHECK(gin::V8Initializer::LoadV8Snapshot());
725 } 725 }
726 #else 726 #else
727 CHECK(gin::IsolateHolder::LoadV8Snapshot()); 727 CHECK(gin::V8Initializer::LoadV8Snapshot());
728 #endif // OS_POSIX && !OS_MACOSX 728 #endif // OS_POSIX && !OS_MACOSX
729 #endif // V8_USE_EXTERNAL_STARTUP_DATA 729 #endif // V8_USE_EXTERNAL_STARTUP_DATA
730 730
731 if (delegate_) 731 if (delegate_)
732 delegate_->PreSandboxStartup(); 732 delegate_->PreSandboxStartup();
733 733
734 if (!process_type.empty()) 734 if (!process_type.empty())
735 CommonSubprocessInit(process_type); 735 CommonSubprocessInit(process_type);
736 736
737 #if defined(OS_WIN) 737 #if defined(OS_WIN)
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 833
834 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); 834 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl);
835 }; 835 };
836 836
837 // static 837 // static
838 ContentMainRunner* ContentMainRunner::Create() { 838 ContentMainRunner* ContentMainRunner::Create() {
839 return new ContentMainRunnerImpl(); 839 return new ContentMainRunnerImpl();
840 } 840 }
841 841
842 } // namespace content 842 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698