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

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

Issue 2686243002: content/ui[Android]: Remove ContextProviderFactory. (Closed)
Patch Set: more rebase Created 3 years, 9 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
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/gpu.h" 5 #include "services/ui/public/cpp/gpu/gpu.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/threading/thread_task_runner_handle.h" 8 #include "base/threading/thread_task_runner_handle.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "mojo/public/cpp/bindings/sync_call_restrictions.h" 10 #include "mojo/public/cpp/bindings/sync_call_restrictions.h"
(...skipping 28 matching lines...) Expand all
39 io_thread_.reset(new base::Thread("GPUIOThread")); 39 io_thread_.reset(new base::Thread("GPUIOThread"));
40 base::Thread::Options thread_options(base::MessageLoop::TYPE_IO, 0); 40 base::Thread::Options thread_options(base::MessageLoop::TYPE_IO, 0);
41 thread_options.priority = base::ThreadPriority::NORMAL; 41 thread_options.priority = base::ThreadPriority::NORMAL;
42 CHECK(io_thread_->StartWithOptions(thread_options)); 42 CHECK(io_thread_->StartWithOptions(thread_options));
43 io_task_runner_ = io_thread_->task_runner(); 43 io_task_runner_ = io_thread_->task_runner();
44 } 44 }
45 } 45 }
46 46
47 Gpu::~Gpu() { 47 Gpu::~Gpu() {
48 DCHECK(IsMainThread()); 48 DCHECK(IsMainThread());
49 for (const auto& callback : establish_callbacks_)
50 callback.Run(nullptr);
51 shutdown_event_.Signal(); 49 shutdown_event_.Signal();
52 if (gpu_channel_) 50 if (gpu_channel_)
53 gpu_channel_->DestroyChannel(); 51 gpu_channel_->DestroyChannel();
54 } 52 }
55 53
56 // static 54 // static
57 std::unique_ptr<Gpu> Gpu::Create( 55 std::unique_ptr<Gpu> Gpu::Create(
58 service_manager::Connector* connector, 56 service_manager::Connector* connector,
59 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { 57 scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
60 return base::WrapUnique(new Gpu(connector, nullptr, std::move(task_runner))); 58 return base::WrapUnique(new Gpu(connector, nullptr, std::move(task_runner)));
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 MojoResult result = mojo::UnwrapSharedMemoryHandle( 181 MojoResult result = mojo::UnwrapSharedMemoryHandle(
184 std::move(handle), &platform_handle, &shared_memory_size, &readonly); 182 std::move(handle), &platform_handle, &shared_memory_size, &readonly);
185 if (result != MOJO_RESULT_OK) 183 if (result != MOJO_RESULT_OK)
186 return nullptr; 184 return nullptr;
187 DCHECK_EQ(shared_memory_size, size); 185 DCHECK_EQ(shared_memory_size, size);
188 186
189 return base::MakeUnique<base::SharedMemory>(platform_handle, readonly); 187 return base::MakeUnique<base::SharedMemory>(platform_handle, readonly);
190 } 188 }
191 189
192 } // namespace ui 190 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/public/cpp/gpu/command_buffer_metrics.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698