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

Side by Side Diff: content/gpu/gpu_main.cc

Issue 1711533002: Decouple browser-specific GPU IPC messages from GPU service IPCs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Mark's nit Created 4 years, 10 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 7
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "base/metrics/statistics_recorder.h" 13 #include "base/metrics/statistics_recorder.h"
14 #include "base/rand_util.h" 14 #include "base/rand_util.h"
15 #include "base/strings/string_number_conversions.h" 15 #include "base/strings/string_number_conversions.h"
16 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
17 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" 17 #include "base/third_party/dynamic_annotations/dynamic_annotations.h"
18 #include "base/threading/platform_thread.h" 18 #include "base/threading/platform_thread.h"
19 #include "base/trace_event/trace_event.h" 19 #include "base/trace_event/trace_event.h"
20 #include "build/build_config.h" 20 #include "build/build_config.h"
21 #include "content/child/child_process.h" 21 #include "content/child/child_process.h"
22 #include "content/common/content_constants_internal.h" 22 #include "content/common/content_constants_internal.h"
23 #include "content/common/gpu/gpu_browser_messages.h"
23 #include "content/common/gpu/gpu_config.h" 24 #include "content/common/gpu/gpu_config.h"
24 #include "content/common/gpu/gpu_memory_buffer_factory.h" 25 #include "content/common/gpu/gpu_memory_buffer_factory.h"
25 #include "content/common/gpu/gpu_messages.h" 26 #include "content/common/gpu/gpu_messages.h"
26 #include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h" 27 #include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h"
27 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" 28 #include "content/common/gpu/media/gpu_video_decode_accelerator.h"
28 #include "content/common/gpu/media/gpu_video_encode_accelerator.h" 29 #include "content/common/gpu/media/gpu_video_encode_accelerator.h"
29 #include "content/common/sandbox_linux/sandbox_linux.h" 30 #include "content/common/sandbox_linux/sandbox_linux.h"
30 #include "content/gpu/gpu_child_thread.h" 31 #include "content/gpu/gpu_child_thread.h"
31 #include "content/gpu/gpu_process.h" 32 #include "content/gpu/gpu_process.h"
32 #include "content/gpu/gpu_watchdog_thread.h" 33 #include "content/gpu/gpu_watchdog_thread.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 115
115 base::LazyInstance<GpuChildThread::DeferredMessages> deferred_messages = 116 base::LazyInstance<GpuChildThread::DeferredMessages> deferred_messages =
116 LAZY_INSTANCE_INITIALIZER; 117 LAZY_INSTANCE_INITIALIZER;
117 118
118 bool GpuProcessLogMessageHandler(int severity, 119 bool GpuProcessLogMessageHandler(int severity,
119 const char* file, int line, 120 const char* file, int line,
120 size_t message_start, 121 size_t message_start,
121 const std::string& str) { 122 const std::string& str) {
122 std::string header = str.substr(0, message_start); 123 std::string header = str.substr(0, message_start);
123 std::string message = str.substr(message_start); 124 std::string message = str.substr(message_start);
124 deferred_messages.Get().push(new GpuHostMsg_OnLogMessage( 125 deferred_messages.Get().push(
125 severity, header, message)); 126 new GpuHostMsg_OnLogMessage(severity, header, message));
126 return false; 127 return false;
127 } 128 }
128 129
129 } // namespace anonymous 130 } // namespace anonymous
130 131
131 // Main function for starting the Gpu process. 132 // Main function for starting the Gpu process.
132 int GpuMain(const MainFunctionParams& parameters) { 133 int GpuMain(const MainFunctionParams& parameters) {
133 TRACE_EVENT0("gpu", "GpuMain"); 134 TRACE_EVENT0("gpu", "GpuMain");
134 base::trace_event::TraceLog::GetInstance()->SetProcessName("GPU Process"); 135 base::trace_event::TraceLog::GetInstance()->SetProcessName("GPU Process");
135 base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( 136 base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex(
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 return true; 594 return true;
594 } 595 }
595 596
596 return false; 597 return false;
597 } 598 }
598 #endif // defined(OS_WIN) 599 #endif // defined(OS_WIN)
599 600
600 } // namespace. 601 } // namespace.
601 602
602 } // namespace content 603 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698