| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 return; | 86 return; |
| 87 | 87 |
| 88 DCHECK_NE(0.f, device_pixel_ratio); | 88 DCHECK_NE(0.f, device_pixel_ratio); |
| 89 | 89 |
| 90 did_init_ = true; | 90 did_init_ = true; |
| 91 device_pixel_ratio_ = device_pixel_ratio; | 91 device_pixel_ratio_ = device_pixel_ratio; |
| 92 screen_size_in_pixels_ = screen_size_in_pixels; | 92 screen_size_in_pixels_ = screen_size_in_pixels; |
| 93 | 93 |
| 94 if (!resource_loader_.BlockUntilLoaded()) { | 94 if (!resource_loader_.BlockUntilLoaded()) { |
| 95 // Assume on error we're being shut down. | 95 // Assume on error we're being shut down. |
| 96 app_->Terminate(); | 96 app_->Quit(); |
| 97 return; | 97 return; |
| 98 } | 98 } |
| 99 | 99 |
| 100 #if defined(OS_LINUX) && !defined(OS_ANDROID) | 100 #if defined(OS_LINUX) && !defined(OS_ANDROID) |
| 101 SkFontConfigInterface::SetGlobal(new font_service::FontLoader(app_)); | 101 SkFontConfigInterface::SetGlobal(new font_service::FontLoader(app_)); |
| 102 #endif | 102 #endif |
| 103 | 103 |
| 104 ui_init_.reset( | 104 ui_init_.reset( |
| 105 new ui::mojo::UIInit(screen_size_in_pixels, device_pixel_ratio)); | 105 new ui::mojo::UIInit(screen_size_in_pixels, device_pixel_ratio)); |
| 106 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_); | 106 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 media_factory_.reset( | 148 media_factory_.reset( |
| 149 new MediaFactory(compositor_thread_.task_runner(), app_->shell())); | 149 new MediaFactory(compositor_thread_.task_runner(), app_->shell())); |
| 150 | 150 |
| 151 if (command_line->HasSwitch(kJavaScriptFlags)) { | 151 if (command_line->HasSwitch(kJavaScriptFlags)) { |
| 152 std::string flags(command_line->GetSwitchValueASCII(kJavaScriptFlags)); | 152 std::string flags(command_line->GetSwitchValueASCII(kJavaScriptFlags)); |
| 153 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); | 153 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); |
| 154 } | 154 } |
| 155 } | 155 } |
| 156 | 156 |
| 157 } // namespace html_viewer | 157 } // namespace html_viewer |
| OLD | NEW |