| 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" |
| 11 #include "base/i18n/icu_util.h" | |
| 12 #include "base/logging.h" | 11 #include "base/logging.h" |
| 13 #include "components/html_viewer/blink_platform_impl.h" | 12 #include "components/html_viewer/blink_platform_impl.h" |
| 14 #include "components/html_viewer/blink_settings_impl.h" | 13 #include "components/html_viewer/blink_settings_impl.h" |
| 15 #include "components/html_viewer/media_factory.h" | 14 #include "components/html_viewer/media_factory.h" |
| 16 #include "components/scheduler/renderer/renderer_scheduler.h" | 15 #include "components/scheduler/renderer/renderer_scheduler.h" |
| 17 #include "gin/v8_initializer.h" | 16 #include "gin/v8_initializer.h" |
| 18 #include "mojo/application/public/cpp/application_impl.h" | 17 #include "mojo/application/public/cpp/application_impl.h" |
| 19 #include "mojo/logging/init_logging.h" | 18 #include "mojo/logging/init_logging.h" |
| 20 #include "mojo/services/tracing/public/cpp/tracing_impl.h" | 19 #include "mojo/services/tracing/public/cpp/tracing_impl.h" |
| 21 #include "third_party/WebKit/public/web/WebKit.h" | 20 #include "third_party/WebKit/public/web/WebKit.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 resource_loader_.ReleaseFile(kResourceSnapshotBlob).TakePlatformFile(), | 138 resource_loader_.ReleaseFile(kResourceSnapshotBlob).TakePlatformFile(), |
| 140 0u, 0u); | 139 0u, 0u); |
| 141 gin::V8Initializer::LoadV8NativesFromFD( | 140 gin::V8Initializer::LoadV8NativesFromFD( |
| 142 resource_loader_.ReleaseFile(kResourceNativesBlob).TakePlatformFile(), 0u, | 141 resource_loader_.ReleaseFile(kResourceNativesBlob).TakePlatformFile(), 0u, |
| 143 0u); | 142 0u); |
| 144 #endif | 143 #endif |
| 145 blink::initialize(blink_platform_.get()); | 144 blink::initialize(blink_platform_.get()); |
| 146 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 145 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 147 base::File pak_file = resource_loader_.ReleaseFile(kResourceResourcesPak); | 146 base::File pak_file = resource_loader_.ReleaseFile(kResourceResourcesPak); |
| 148 | 147 |
| 149 bool initialize_icu_and_ui = true; | 148 bool initialize_ui = true; |
| 150 #if defined(COMPONENT_BUILD) | 149 #if defined(COMPONENT_BUILD) |
| 151 if (command_line->HasSwitch("single-process")) | 150 if (command_line->HasSwitch("single-process")) |
| 152 initialize_icu_and_ui = false; | 151 initialize_ui = false; |
| 153 #endif | 152 #endif |
| 154 if (initialize_icu_and_ui) { | 153 if (initialize_ui) { |
| 155 base::i18n::InitializeICUWithFileDescriptor( | |
| 156 resource_loader_.GetICUFile().TakePlatformFile(), | |
| 157 base::MemoryMappedFile::Region::kWholeFile); | |
| 158 ui::RegisterPathProvider(); | 154 ui::RegisterPathProvider(); |
| 159 base::File pak_file_2 = pak_file.Duplicate(); | 155 base::File pak_file_2 = pak_file.Duplicate(); |
| 160 ui::ResourceBundle::InitSharedInstanceWithPakFileRegion( | 156 ui::ResourceBundle::InitSharedInstanceWithPakFileRegion( |
| 161 pak_file_2.Pass(), base::MemoryMappedFile::Region::kWholeFile); | 157 pak_file_2.Pass(), base::MemoryMappedFile::Region::kWholeFile); |
| 162 } | 158 } |
| 163 | 159 |
| 164 mojo::logging::InitLogging(); | 160 mojo::logging::InitLogging(); |
| 165 | 161 |
| 166 if (command_line->HasSwitch(kDisableEncryptedMedia)) | 162 if (command_line->HasSwitch(kDisableEncryptedMedia)) |
| 167 blink::WebRuntimeFeatures::enableEncryptedMedia(false); | 163 blink::WebRuntimeFeatures::enableEncryptedMedia(false); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 191 return gpu_info_.get(); | 187 return gpu_info_.get(); |
| 192 } | 188 } |
| 193 | 189 |
| 194 void GlobalState::GetGpuInfoCallback(mus::mojom::GpuInfoPtr gpu_info) { | 190 void GlobalState::GetGpuInfoCallback(mus::mojom::GpuInfoPtr gpu_info) { |
| 195 CHECK(gpu_info); | 191 CHECK(gpu_info); |
| 196 gpu_info_ = gpu_info.Pass(); | 192 gpu_info_ = gpu_info.Pass(); |
| 197 gpu_service_.reset(); | 193 gpu_service_.reset(); |
| 198 } | 194 } |
| 199 | 195 |
| 200 } // namespace html_viewer | 196 } // namespace html_viewer |
| OLD | NEW |