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

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

Issue 1455833005: Convert ConnectToApplication to take a params class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 #if defined(OS_LINUX) && !defined(OS_ANDROID) 118 #if defined(OS_LINUX) && !defined(OS_ANDROID)
119 font_loader_ = skia::AdoptRef(new font_service::FontLoader(app_)); 119 font_loader_ = skia::AdoptRef(new font_service::FontLoader(app_));
120 SkFontConfigInterface::SetGlobal(font_loader_.get()); 120 SkFontConfigInterface::SetGlobal(font_loader_.get());
121 #endif 121 #endif
122 122
123 ui_init_.reset(new ui::mojo::UIInit( 123 ui_init_.reset(new ui::mojo::UIInit(
124 DisplaysFromSizeAndScale(screen_size_in_pixels_, device_pixel_ratio_))); 124 DisplaysFromSizeAndScale(screen_size_in_pixels_, device_pixel_ratio_)));
125 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_); 125 base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_);
126 126
127 mojo::URLRequestPtr request(mojo::URLRequest::New()); 127 app_->ConnectToService("mojo:mus", &gpu_service_);
128 request->url = mojo::String::From("mojo:mus");
129 app_->ConnectToService(request.Pass(), &gpu_service_);
130 gpu_service_->GetGpuInfo(base::Bind(&GlobalState::GetGpuInfoCallback, 128 gpu_service_->GetGpuInfo(base::Bind(&GlobalState::GetGpuInfoCallback,
131 base::Unretained(this))); 129 base::Unretained(this)));
132 130
133 renderer_scheduler_ = scheduler::RendererScheduler::Create(); 131 renderer_scheduler_ = scheduler::RendererScheduler::Create();
134 blink_platform_.reset( 132 blink_platform_.reset(
135 new BlinkPlatformImpl(this, app_, renderer_scheduler_.get())); 133 new BlinkPlatformImpl(this, app_, renderer_scheduler_.get()));
136 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) 134 #if defined(V8_USE_EXTERNAL_STARTUP_DATA)
137 gin::V8Initializer::LoadV8SnapshotFromFD( 135 gin::V8Initializer::LoadV8SnapshotFromFD(
138 resource_loader_.ReleaseFile(kResourceSnapshotBlob).TakePlatformFile(), 136 resource_loader_.ReleaseFile(kResourceSnapshotBlob).TakePlatformFile(),
139 0u, 0u); 137 0u, 0u);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 return gpu_info_.get(); 185 return gpu_info_.get();
188 } 186 }
189 187
190 void GlobalState::GetGpuInfoCallback(mus::mojom::GpuInfoPtr gpu_info) { 188 void GlobalState::GetGpuInfoCallback(mus::mojom::GpuInfoPtr gpu_info) {
191 CHECK(gpu_info); 189 CHECK(gpu_info);
192 gpu_info_ = gpu_info.Pass(); 190 gpu_info_ = gpu_info.Pass();
193 gpu_service_.reset(); 191 gpu_service_.reset();
194 } 192 }
195 193
196 } // namespace html_viewer 194 } // namespace html_viewer
OLDNEW
« no previous file with comments | « components/html_viewer/blink_platform_impl.cc ('k') | components/html_viewer/html_document_application_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698