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

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

Issue 1425853003: mandoline: Fix ICU initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't initialize ICU again in the shell. Created 5 years, 1 month 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/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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 new BlinkPlatformImpl(this, app_, renderer_scheduler_.get())); 135 new BlinkPlatformImpl(this, app_, renderer_scheduler_.get()));
137 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) 136 #if defined(V8_USE_EXTERNAL_STARTUP_DATA)
138 gin::V8Initializer::LoadV8SnapshotFromFD( 137 gin::V8Initializer::LoadV8SnapshotFromFD(
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::i18n::InitializeICUWithFileDescriptor(
147 resource_loader_.GetICUFile().TakePlatformFile(),
148 base::MemoryMappedFile::Region::kWholeFile);
149 145
150 ui::RegisterPathProvider(); 146 ui::RegisterPathProvider();
151 147
152 mojo::logging::InitLogging(); 148 mojo::logging::InitLogging();
153 149
154 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 150 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
155 151
156 if (command_line->HasSwitch(kDisableEncryptedMedia)) 152 if (command_line->HasSwitch(kDisableEncryptedMedia))
157 blink::WebRuntimeFeatures::enableEncryptedMedia(false); 153 blink::WebRuntimeFeatures::enableEncryptedMedia(false);
158 154
(...skipping 26 matching lines...) Expand all
185 return gpu_info_.get(); 181 return gpu_info_.get();
186 } 182 }
187 183
188 void GlobalState::GetGpuInfoCallback(mus::mojom::GpuInfoPtr gpu_info) { 184 void GlobalState::GetGpuInfoCallback(mus::mojom::GpuInfoPtr gpu_info) {
189 CHECK(gpu_info); 185 CHECK(gpu_info);
190 gpu_info_ = gpu_info.Pass(); 186 gpu_info_ = gpu_info.Pass();
191 gpu_service_.reset(); 187 gpu_service_.reset();
192 } 188 }
193 189
194 } // namespace html_viewer 190 } // namespace html_viewer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698