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

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: Turn static variables into pointers and remove v8 init in net Created 6 years, 3 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 25 matching lines...) Expand all
36 #include "content/public/browser/content_browser_client.h" 36 #include "content/public/browser/content_browser_client.h"
37 #include "content/public/common/content_client.h" 37 #include "content/public/common/content_client.h"
38 #include "content/public/common/content_constants.h" 38 #include "content/public/common/content_constants.h"
39 #include "content/public/common/content_paths.h" 39 #include "content/public/common/content_paths.h"
40 #include "content/public/common/content_switches.h" 40 #include "content/public/common/content_switches.h"
41 #include "content/public/common/main_function_params.h" 41 #include "content/public/common/main_function_params.h"
42 #include "content/public/common/sandbox_init.h" 42 #include "content/public/common/sandbox_init.h"
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 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
47 #include "gin/public/isolate_holder.h"
48 #endif // V8_USE_EXTERNAL_STARTUP_DATA
46 #include "ipc/ipc_descriptors.h" 49 #include "ipc/ipc_descriptors.h"
47 #include "ipc/ipc_switches.h" 50 #include "ipc/ipc_switches.h"
48 #include "media/base/media.h" 51 #include "media/base/media.h"
49 #include "sandbox/win/src/sandbox_types.h" 52 #include "sandbox/win/src/sandbox_types.h"
50 #include "ui/base/ui_base_paths.h" 53 #include "ui/base/ui_base_paths.h"
51 #include "ui/base/ui_base_switches.h" 54 #include "ui/base/ui_base_switches.h"
52 55
53 #if defined(OS_ANDROID) 56 #if defined(OS_ANDROID)
54 #include "content/public/common/content_descriptors.h" 57 #include "content/public/common/content_descriptors.h"
55 #endif 58 #endif
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 RegisterPathProvider(); 711 RegisterPathProvider();
709 RegisterContentSchemes(true); 712 RegisterContentSchemes(true);
710 713
711 #if defined(OS_ANDROID) 714 #if defined(OS_ANDROID)
712 int icudata_fd = base::GlobalDescriptors::GetInstance()->MaybeGet( 715 int icudata_fd = base::GlobalDescriptors::GetInstance()->MaybeGet(
713 kAndroidICUDataDescriptor); 716 kAndroidICUDataDescriptor);
714 if (icudata_fd != -1) 717 if (icudata_fd != -1)
715 CHECK(base::i18n::InitializeICUWithFileDescriptor(icudata_fd)); 718 CHECK(base::i18n::InitializeICUWithFileDescriptor(icudata_fd));
716 else 719 else
717 CHECK(base::i18n::InitializeICU()); 720 CHECK(base::i18n::InitializeICU());
721
722 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
723 int v8_natives_fd = base::GlobalDescriptors::GetInstance()->MaybeGet(
724 kV8NativesDataDescriptor);
725 int v8_snapshot_fd = base::GlobalDescriptors::GetInstance()->MaybeGet(
726 kV8SnapshotDataDescriptor);
727 if (v8_natives_fd != -1 && v8_snapshot_fd != -1)
728 CHECK(gin::IsolateHolder::LoadV8SnapshotFD(v8_natives_fd,
729 v8_snapshot_fd));
730 else
731 CHECK(gin::IsolateHolder::LoadV8Snapshot());
732 #endif // V8_USE_EXTERNAL_STARTUP_DATA
733
718 #else 734 #else
719 CHECK(base::i18n::InitializeICU()); 735 CHECK(base::i18n::InitializeICU());
720 #endif 736 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
737 CHECK(gin::IsolateHolder::LoadV8Snapshot());
738 #endif // V8_USE_EXTERNAL_STARTUP_DATA
739 #endif // OS_ANDROID
721 740
722 InitializeStatsTable(command_line); 741 InitializeStatsTable(command_line);
723 742
724 if (delegate_) 743 if (delegate_)
725 delegate_->PreSandboxStartup(); 744 delegate_->PreSandboxStartup();
726 745
727 if (!process_type.empty()) 746 if (!process_type.empty())
728 CommonSubprocessInit(process_type); 747 CommonSubprocessInit(process_type);
729 748
730 #if defined(OS_WIN) 749 #if defined(OS_WIN)
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 845
827 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); 846 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl);
828 }; 847 };
829 848
830 // static 849 // static
831 ContentMainRunner* ContentMainRunner::Create() { 850 ContentMainRunner* ContentMainRunner::Create() {
832 return new ContentMainRunnerImpl(); 851 return new ContentMainRunnerImpl();
833 } 852 }
834 853
835 } // namespace content 854 } // namespace content
OLDNEW
« no previous file with comments | « content/DEPS ('k') | content/public/common/content_descriptors.h » ('j') | gin/isolate_holder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698