OLD | NEW |
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "content/renderer/in_process_renderer_thread.h" | 43 #include "content/renderer/in_process_renderer_thread.h" |
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 |
| 54 #include "gin/public/isolate_holder.h" |
| 55 #endif |
| 56 |
53 #if defined(OS_ANDROID) | 57 #if defined(OS_ANDROID) |
54 #include "content/public/common/content_descriptors.h" | 58 #include "content/public/common/content_descriptors.h" |
55 #endif | 59 #endif |
56 | 60 |
57 #if defined(USE_TCMALLOC) | 61 #if defined(USE_TCMALLOC) |
58 #include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h" | 62 #include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h" |
59 #if defined(TYPE_PROFILING) | 63 #if defined(TYPE_PROFILING) |
60 #include "base/allocator/type_profiler.h" | 64 #include "base/allocator/type_profiler.h" |
61 #include "base/allocator/type_profiler_tcmalloc.h" | 65 #include "base/allocator/type_profiler_tcmalloc.h" |
62 #endif | 66 #endif |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 RegisterPathProvider(); | 713 RegisterPathProvider(); |
710 RegisterContentSchemes(true); | 714 RegisterContentSchemes(true); |
711 | 715 |
712 #if defined(OS_ANDROID) | 716 #if defined(OS_ANDROID) |
713 int icudata_fd = base::GlobalDescriptors::GetInstance()->MaybeGet( | 717 int icudata_fd = base::GlobalDescriptors::GetInstance()->MaybeGet( |
714 kAndroidICUDataDescriptor); | 718 kAndroidICUDataDescriptor); |
715 if (icudata_fd != -1) | 719 if (icudata_fd != -1) |
716 CHECK(base::i18n::InitializeICUWithFileDescriptor(icudata_fd)); | 720 CHECK(base::i18n::InitializeICUWithFileDescriptor(icudata_fd)); |
717 else | 721 else |
718 CHECK(base::i18n::InitializeICU()); | 722 CHECK(base::i18n::InitializeICU()); |
| 723 |
| 724 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 725 int v8_natives_fd = base::GlobalDescriptors::GetInstance()->MaybeGet( |
| 726 kV8NativesDataDescriptor); |
| 727 int v8_snapshot_fd = base::GlobalDescriptors::GetInstance()->MaybeGet( |
| 728 kV8SnapshotDataDescriptor); |
| 729 if (v8_natives_fd != -1 && v8_snapshot_fd != -1) { |
| 730 CHECK(gin::IsolateHolder::LoadV8SnapshotFD(v8_natives_fd, |
| 731 v8_snapshot_fd)); |
| 732 } else { |
| 733 CHECK(gin::IsolateHolder::LoadV8Snapshot()); |
| 734 } |
| 735 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
| 736 |
719 #else | 737 #else |
720 CHECK(base::i18n::InitializeICU()); | 738 CHECK(base::i18n::InitializeICU()); |
721 #endif | 739 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 740 CHECK(gin::IsolateHolder::LoadV8Snapshot()); |
| 741 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
| 742 #endif // OS_ANDROID |
722 | 743 |
723 InitializeStatsTable(command_line); | 744 InitializeStatsTable(command_line); |
724 | 745 |
725 if (delegate_) | 746 if (delegate_) |
726 delegate_->PreSandboxStartup(); | 747 delegate_->PreSandboxStartup(); |
727 | 748 |
728 if (!process_type.empty()) | 749 if (!process_type.empty()) |
729 CommonSubprocessInit(process_type); | 750 CommonSubprocessInit(process_type); |
730 | 751 |
731 #if defined(OS_WIN) | 752 #if defined(OS_WIN) |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 | 848 |
828 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 849 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
829 }; | 850 }; |
830 | 851 |
831 // static | 852 // static |
832 ContentMainRunner* ContentMainRunner::Create() { | 853 ContentMainRunner* ContentMainRunner::Create() { |
833 return new ContentMainRunnerImpl(); | 854 return new ContentMainRunnerImpl(); |
834 } | 855 } |
835 | 856 |
836 } // namespace content | 857 } // namespace content |
OLD | NEW |