OLD | NEW |
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/global_state.h" | 5 #include "components/html_viewer/global_state.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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 return; | 82 return; |
83 | 83 |
84 DCHECK_NE(0.f, device_pixel_ratio); | 84 DCHECK_NE(0.f, device_pixel_ratio); |
85 | 85 |
86 did_init_ = true; | 86 did_init_ = true; |
87 device_pixel_ratio_ = device_pixel_ratio; | 87 device_pixel_ratio_ = device_pixel_ratio; |
88 screen_size_in_pixels_ = screen_size_in_pixels; | 88 screen_size_in_pixels_ = screen_size_in_pixels; |
89 | 89 |
90 if (!resource_loader_.BlockUntilLoaded()) { | 90 if (!resource_loader_.BlockUntilLoaded()) { |
91 // Assume on error we're being shut down. | 91 // Assume on error we're being shut down. |
92 app_->Quit(); | 92 app_->Terminate(); |
93 return; | 93 return; |
94 } | 94 } |
95 | 95 |
96 ui_init_.reset( | 96 ui_init_.reset( |
97 new ui::mojo::UIInit(screen_size_in_pixels, device_pixel_ratio)); | 97 new ui::mojo::UIInit(screen_size_in_pixels, device_pixel_ratio)); |
98 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_); | 98 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_); |
99 | 99 |
100 renderer_scheduler_ = scheduler::RendererScheduler::Create(); | 100 renderer_scheduler_ = scheduler::RendererScheduler::Create(); |
101 blink_platform_.reset(new BlinkPlatformImpl(app_, renderer_scheduler_.get())); | 101 blink_platform_.reset(new BlinkPlatformImpl(app_, renderer_scheduler_.get())); |
102 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) | 102 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 media_factory_.reset( | 140 media_factory_.reset( |
141 new MediaFactory(compositor_thread_.task_runner(), app_->shell())); | 141 new MediaFactory(compositor_thread_.task_runner(), app_->shell())); |
142 | 142 |
143 if (command_line->HasSwitch(kJavaScriptFlags)) { | 143 if (command_line->HasSwitch(kJavaScriptFlags)) { |
144 std::string flags(command_line->GetSwitchValueASCII(kJavaScriptFlags)); | 144 std::string flags(command_line->GetSwitchValueASCII(kJavaScriptFlags)); |
145 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); | 145 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
149 } // namespace html_viewer | 149 } // namespace html_viewer |
OLD | NEW |