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

Side by Side Diff: services/ui/public/cpp/gpu_service.cc

Issue 2281583003: services/ui: Split GpuServiceInternal into gpu vs. ws pieces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DONE_2016.08.24_mus-ws-gpu-refactor
Patch Set: tot merge Created 4 years, 3 months 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
« no previous file with comments | « services/ui/gpu/mus_gpu_memory_buffer_manager.cc ('k') | services/ui/service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/ui/public/cpp/gpu_service.h" 5 #include "services/ui/public/cpp/gpu_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 void GpuService::OnEstablishedGpuChannel( 108 void GpuService::OnEstablishedGpuChannel(
109 int client_id, 109 int client_id,
110 mojo::ScopedMessagePipeHandle channel_handle, 110 mojo::ScopedMessagePipeHandle channel_handle,
111 const gpu::GPUInfo& gpu_info) { 111 const gpu::GPUInfo& gpu_info) {
112 DCHECK(IsMainThread()); 112 DCHECK(IsMainThread());
113 DCHECK(gpu_service_.get()); 113 DCHECK(gpu_service_.get());
114 DCHECK(!gpu_channel_); 114 DCHECK(!gpu_channel_);
115 115
116 if (client_id) { 116 if (client_id) {
117 // TODO(penghuang): Get the real gpu info from mus.
118 gpu_channel_ = gpu::GpuChannelHost::Create( 117 gpu_channel_ = gpu::GpuChannelHost::Create(
119 this, client_id, gpu::GPUInfo(), 118 this, client_id, gpu_info, IPC::ChannelHandle(channel_handle.release()),
120 IPC::ChannelHandle(channel_handle.release()), &shutdown_event_, 119 &shutdown_event_, gpu_memory_buffer_manager_.get());
121 gpu_memory_buffer_manager_.get());
122 } 120 }
123 121
124 gpu_service_.reset(); 122 gpu_service_.reset();
125 for (const auto& i : establish_callbacks_) 123 for (const auto& i : establish_callbacks_)
126 i.Run(gpu_channel_); 124 i.Run(gpu_channel_);
127 establish_callbacks_.clear(); 125 establish_callbacks_.clear();
128 } 126 }
129 127
130 bool GpuService::IsMainThread() { 128 bool GpuService::IsMainThread() {
131 return main_task_runner_->BelongsToCurrentThread(); 129 return main_task_runner_->BelongsToCurrentThread();
(...skipping 17 matching lines...) Expand all
149 MojoResult result = mojo::UnwrapSharedMemoryHandle( 147 MojoResult result = mojo::UnwrapSharedMemoryHandle(
150 std::move(handle), &platform_handle, &shared_memory_size, &readonly); 148 std::move(handle), &platform_handle, &shared_memory_size, &readonly);
151 if (result != MOJO_RESULT_OK) 149 if (result != MOJO_RESULT_OK)
152 return nullptr; 150 return nullptr;
153 DCHECK_EQ(shared_memory_size, size); 151 DCHECK_EQ(shared_memory_size, size);
154 152
155 return base::MakeUnique<base::SharedMemory>(platform_handle, readonly); 153 return base::MakeUnique<base::SharedMemory>(platform_handle, readonly);
156 } 154 }
157 155
158 } // namespace ui 156 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/gpu/mus_gpu_memory_buffer_manager.cc ('k') | services/ui/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698