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

Side by Side Diff: components/html_viewer/setup.cc

Issue 1164483003: Allow startup with missing V8 snapshot file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix misplaced ifdef for Windows Created 5 years, 6 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
« no previous file with comments | « components/html_viewer/ax_provider_impl_unittest.cc ('k') | content/app/content_main_runner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/html_viewer/setup.h" 5 #include "components/html_viewer/setup.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 app_->Terminate(); 107 app_->Terminate();
108 return; 108 return;
109 } 109 }
110 110
111 ui_setup_.reset(new UISetup(screen_size_in_pixels, device_pixel_ratio)); 111 ui_setup_.reset(new UISetup(screen_size_in_pixels, device_pixel_ratio));
112 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_); 112 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_);
113 113
114 renderer_scheduler_ = scheduler::RendererScheduler::Create(); 114 renderer_scheduler_ = scheduler::RendererScheduler::Create();
115 blink_platform_.reset(new BlinkPlatformImpl(app_, renderer_scheduler_.get())); 115 blink_platform_.reset(new BlinkPlatformImpl(app_, renderer_scheduler_.get()));
116 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) 116 #if defined(V8_USE_EXTERNAL_STARTUP_DATA)
117 CHECK(gin::V8Initializer::LoadV8SnapshotFromFD( 117 gin::V8Initializer::LoadV8SnapshotFromFD(
118 resource_loader_.ReleaseFile(kResourceSnapshotBlob).TakePlatformFile(),
119 0u, 0u);
120 gin::V8Initializer::LoadV8NativesFromFD(
118 resource_loader_.ReleaseFile(kResourceNativesBlob).TakePlatformFile(), 0u, 121 resource_loader_.ReleaseFile(kResourceNativesBlob).TakePlatformFile(), 0u,
119 0u, 122 0u);
120 resource_loader_.ReleaseFile(kResourceSnapshotBlob).TakePlatformFile(),
121 0u, 0u));
122 #endif 123 #endif
123 blink::initialize(blink_platform_.get()); 124 blink::initialize(blink_platform_.get());
124 base::i18n::InitializeICUWithFileDescriptor( 125 base::i18n::InitializeICUWithFileDescriptor(
125 resource_loader_.ReleaseFile(kResourceIcudtl).TakePlatformFile(), 126 resource_loader_.ReleaseFile(kResourceIcudtl).TakePlatformFile(),
126 base::MemoryMappedFile::Region::kWholeFile); 127 base::MemoryMappedFile::Region::kWholeFile);
127 128
128 ui::RegisterPathProvider(); 129 ui::RegisterPathProvider();
129 130
130 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 131 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
131 132
(...skipping 20 matching lines...) Expand all
152 media_factory_.reset( 153 media_factory_.reset(
153 new MediaFactory(compositor_thread_.message_loop_proxy(), app_->shell())); 154 new MediaFactory(compositor_thread_.message_loop_proxy(), app_->shell()));
154 155
155 if (command_line->HasSwitch(kJavaScriptFlags)) { 156 if (command_line->HasSwitch(kJavaScriptFlags)) {
156 std::string flags(command_line->GetSwitchValueASCII(kJavaScriptFlags)); 157 std::string flags(command_line->GetSwitchValueASCII(kJavaScriptFlags));
157 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); 158 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size()));
158 } 159 }
159 } 160 }
160 161
161 } // namespace html_viewer 162 } // namespace html_viewer
OLDNEW
« no previous file with comments | « components/html_viewer/ax_provider_impl_unittest.cc ('k') | content/app/content_main_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698