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

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: Feedback from sky 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
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/i18n/icu_util.h" 9 #include "base/i18n/icu_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 app_->Terminate(); 101 app_->Terminate();
102 return; 102 return;
103 } 103 }
104 104
105 ui_setup_.reset(new UISetup(screen_size_in_pixels, device_pixel_ratio)); 105 ui_setup_.reset(new UISetup(screen_size_in_pixels, device_pixel_ratio));
106 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_); 106 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_);
107 107
108 renderer_scheduler_ = scheduler::RendererScheduler::Create(); 108 renderer_scheduler_ = scheduler::RendererScheduler::Create();
109 blink_platform_.reset(new BlinkPlatformImpl(app_, renderer_scheduler_.get())); 109 blink_platform_.reset(new BlinkPlatformImpl(app_, renderer_scheduler_.get()));
110 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) 110 #if defined(V8_USE_EXTERNAL_STARTUP_DATA)
111 CHECK(gin::V8Initializer::LoadV8SnapshotFromFD( 111 gin::V8Initializer::LoadV8SnapshotFromFD(
112 resource_loader_.ReleaseFile(kResourceSnapshotBlob).TakePlatformFile(),
113 0u, 0u);
114 gin::V8Initializer::LoadV8NativesFromFD(
112 resource_loader_.ReleaseFile(kResourceNativesBlob).TakePlatformFile(), 0u, 115 resource_loader_.ReleaseFile(kResourceNativesBlob).TakePlatformFile(), 0u,
113 0u, 116 0u);
114 resource_loader_.ReleaseFile(kResourceSnapshotBlob).TakePlatformFile(),
115 0u, 0u));
116 #endif 117 #endif
117 blink::initialize(blink_platform_.get()); 118 blink::initialize(blink_platform_.get());
118 base::i18n::InitializeICUWithFileDescriptor( 119 base::i18n::InitializeICUWithFileDescriptor(
119 resource_loader_.ReleaseFile(kResourceIcudtl).TakePlatformFile(), 120 resource_loader_.ReleaseFile(kResourceIcudtl).TakePlatformFile(),
120 base::MemoryMappedFile::Region::kWholeFile); 121 base::MemoryMappedFile::Region::kWholeFile);
121 122
122 ui::RegisterPathProvider(); 123 ui::RegisterPathProvider();
123 124
124 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 125 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
125 126
(...skipping 22 matching lines...) Expand all
148 #else 149 #else
149 bool enable_mojo_media_renderer = 150 bool enable_mojo_media_renderer =
150 command_line->HasSwitch(kEnableMojoMediaRenderer); 151 command_line->HasSwitch(kEnableMojoMediaRenderer);
151 152
152 web_media_player_factory_.reset(new WebMediaPlayerFactory( 153 web_media_player_factory_.reset(new WebMediaPlayerFactory(
153 compositor_thread_.message_loop_proxy(), enable_mojo_media_renderer)); 154 compositor_thread_.message_loop_proxy(), enable_mojo_media_renderer));
154 #endif 155 #endif
155 } 156 }
156 157
157 } // namespace html_viewer 158 } // namespace html_viewer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698