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

Unified Diff: content/gpu/gpu_child_thread.cc

Issue 2289553002: gpu: Introduce GpuInit. (Closed)
Patch Set: . 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/gpu/gpu_child_thread.h ('k') | content/gpu/gpu_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/gpu/gpu_child_thread.cc
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
index a0ba2b6bcdb30e2a123819c408b0fc8cfdf663f1..10201cabd226c2c7eaee72b22891eb4592745abf 100644
--- a/content/gpu/gpu_child_thread.cc
+++ b/content/gpu/gpu_child_thread.cc
@@ -146,12 +146,12 @@ GpuChildThread::GpuChildThread(
gpu::GpuWatchdogThread* watchdog_thread,
bool dead_on_arrival,
const gpu::GPUInfo& gpu_info,
- const DeferredMessages& deferred_messages,
+ std::vector<gpu::GpuInitLogMessage> deferred_messages,
gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory)
: ChildThreadImpl(GetOptions(gpu_memory_buffer_factory)),
dead_on_arrival_(dead_on_arrival),
gpu_info_(gpu_info),
- deferred_messages_(deferred_messages),
+ deferred_messages_(std::move(deferred_messages)),
in_browser_process_(false),
gpu_memory_buffer_factory_(gpu_memory_buffer_factory) {
watchdog_thread_ = watchdog_thread;
@@ -190,12 +190,7 @@ GpuChildThread::GpuChildThread(
g_thread_safe_sender.Get() = thread_safe_sender();
}
-GpuChildThread::~GpuChildThread() {
- while (!deferred_messages_.empty()) {
- delete deferred_messages_.front();
- deferred_messages_.pop();
- }
-}
+GpuChildThread::~GpuChildThread() {}
void GpuChildThread::Shutdown() {
ChildThreadImpl::Shutdown();
@@ -331,10 +326,9 @@ void GpuChildThread::OnInitialize(const gpu::GpuPreferences& gpu_preferences) {
// take a significant amount of time.
gpu_info_.initialization_time = base::Time::Now() - process_start_time_;
Send(new GpuHostMsg_Initialized(!dead_on_arrival_, gpu_info_));
- while (!deferred_messages_.empty()) {
- Send(deferred_messages_.front());
- deferred_messages_.pop();
- }
+ for (const auto& msg : deferred_messages_)
+ Send(new GpuHostMsg_OnLogMessage(msg.severity, msg.header, msg.message));
+ deferred_messages_.clear();
if (dead_on_arrival_) {
LOG(ERROR) << "Exiting GPU process due to errors during initialization";
« no previous file with comments | « content/gpu/gpu_child_thread.h ('k') | content/gpu/gpu_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698