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

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

Issue 594603003: Infrastructure for reading V8's initial snapshot from external files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable external snapshot for webview Created 6 years, 2 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 RegisterPathProvider(); 714 RegisterPathProvider();
711 RegisterContentSchemes(true); 715 RegisterContentSchemes(true);
712 716
713 #if defined(OS_ANDROID) 717 #if defined(OS_ANDROID)
714 int icudata_fd = base::GlobalDescriptors::GetInstance()->MaybeGet( 718 int icudata_fd = base::GlobalDescriptors::GetInstance()->MaybeGet(
715 kAndroidICUDataDescriptor); 719 kAndroidICUDataDescriptor);
716 if (icudata_fd != -1) 720 if (icudata_fd != -1)
717 CHECK(base::i18n::InitializeICUWithFileDescriptor(icudata_fd)); 721 CHECK(base::i18n::InitializeICUWithFileDescriptor(icudata_fd));
718 else 722 else
719 CHECK(base::i18n::InitializeICU()); 723 CHECK(base::i18n::InitializeICU());
724
725 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
726 int v8_natives_fd = base::GlobalDescriptors::GetInstance()->MaybeGet(
727 kV8NativesDataDescriptor);
728 int v8_snapshot_fd = base::GlobalDescriptors::GetInstance()->MaybeGet(
729 kV8SnapshotDataDescriptor);
730 if (v8_natives_fd != -1 && v8_snapshot_fd != -1) {
731 CHECK(gin::IsolateHolder::LoadV8SnapshotFD(v8_natives_fd,
732 v8_snapshot_fd));
733 } else {
734 CHECK(gin::IsolateHolder::LoadV8Snapshot());
jochen (gone - plz use gerrit) 2014/10/17 13:38:34 then you don't need the call in the network stack,
baixo1 2014/10/20 10:44:23 Yes. That call is only needed for the tests. There
735 }
736 #endif // V8_USE_EXTERNAL_STARTUP_DATA
737
720 #else 738 #else
721 CHECK(base::i18n::InitializeICU()); 739 CHECK(base::i18n::InitializeICU());
722 #endif 740 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
741 CHECK(gin::IsolateHolder::LoadV8Snapshot());
742 #endif // V8_USE_EXTERNAL_STARTUP_DATA
743 #endif // OS_ANDROID
723 744
724 InitializeStatsTable(command_line); 745 InitializeStatsTable(command_line);
725 746
726 if (delegate_) 747 if (delegate_)
727 delegate_->PreSandboxStartup(); 748 delegate_->PreSandboxStartup();
728 749
729 if (!process_type.empty()) 750 if (!process_type.empty())
730 CommonSubprocessInit(process_type); 751 CommonSubprocessInit(process_type);
731 752
732 #if defined(OS_WIN) 753 #if defined(OS_WIN)
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 849
829 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); 850 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl);
830 }; 851 };
831 852
832 // static 853 // static
833 ContentMainRunner* ContentMainRunner::Create() { 854 ContentMainRunner* ContentMainRunner::Create() {
834 return new ContentMainRunnerImpl(); 855 return new ContentMainRunnerImpl();
835 } 856 }
836 857
837 } // namespace content 858 } // namespace content
OLDNEW
« no previous file with comments | « content/app/DEPS ('k') | content/content.gyp » ('j') | gin/isolate_holder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698