summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfsamuel <fsamuel@chromium.org>2016-03-21 12:25:06 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-21 19:27:47 +0000
commit27d230cc4675d3b25187e6a0c66b8a8c5f635451 (patch)
treef148584f3c11248110e2b7b9253cda75d6675a12
parent28f39b53d44b7ae58d6d7d125db15786628f21d9 (diff)
downloadchromium_src-27d230cc4675d3b25187e6a0c66b8a8c5f635451.zip
chromium_src-27d230cc4675d3b25187e6a0c66b8a8c5f635451.tar.gz
chromium_src-27d230cc4675d3b25187e6a0c66b8a8c5f635451.tar.bz2
Move establish_channel_params.{cc|h} to content/gpu
This is a browser <=> gpu struct and so it really best belongs there. BUG=596290 Review URL: https://codereview.chromium.org/1823723002 Cr-Commit-Position: refs/heads/master@{#382354}
-rw-r--r--content/browser/gpu/gpu_process_host.cc1
-rw-r--r--content/common/gpu/gpu_channel_manager.cc16
-rw-r--r--content/common/gpu/gpu_channel_manager.h8
-rw-r--r--content/common/gpu/gpu_channel_manager_unittest.cc31
-rw-r--r--content/common/gpu/gpu_channel_unittest.cc11
-rw-r--r--content/common/gpu/gpu_memory_uma_stats.h1
-rw-r--r--content/content_common.gypi2
-rw-r--r--content/content_gpu.gypi2
-rw-r--r--content/gpu/BUILD.gn2
-rw-r--r--content/gpu/establish_channel_params.cc (renamed from content/common/gpu/establish_channel_params.cc)2
-rw-r--r--content/gpu/establish_channel_params.h (renamed from content/common/gpu/establish_channel_params.h)6
-rw-r--r--content/gpu/gpu_child_thread.cc7
-rw-r--r--content/gpu/gpu_child_thread.h1
-rw-r--r--content/gpu/gpu_host_messages.h2
14 files changed, 46 insertions, 46 deletions
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 3fe646a..e4ba59f 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -33,6 +33,7 @@
#include "content/common/child_process_host_impl.h"
#include "content/common/in_process_child_thread_params.h"
#include "content/common/view_messages.h"
+#include "content/gpu/establish_channel_params.h"
#include "content/gpu/gpu_host_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc
index feb2def..35d244b 100644
--- a/content/common/gpu/gpu_channel_manager.cc
+++ b/content/common/gpu/gpu_channel_manager.cc
@@ -12,7 +12,6 @@
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
#include "build/build_config.h"
-#include "content/common/gpu/establish_channel_params.h"
#include "content/common/gpu/gpu_channel.h"
#include "content/common/gpu/gpu_channel_manager_delegate.h"
#include "content/common/gpu/gpu_memory_buffer_factory.h"
@@ -159,13 +158,16 @@ scoped_ptr<GpuChannel> GpuChannelManager::CreateGpuChannel(
}
IPC::ChannelHandle GpuChannelManager::EstablishChannel(
- const EstablishChannelParams& params) {
- scoped_ptr<GpuChannel> channel(CreateGpuChannel(
- params.client_id, params.client_tracing_id, params.preempts,
- params.allow_view_command_buffers, params.allow_real_time_streams));
+ int client_id,
+ uint64_t client_tracing_id,
+ bool preempts,
+ bool allow_view_command_buffers,
+ bool allow_real_time_streams) {
+ scoped_ptr<GpuChannel> channel(
+ CreateGpuChannel(client_id, client_tracing_id, preempts,
+ allow_view_command_buffers, allow_real_time_streams));
IPC::ChannelHandle channel_handle = channel->Init(shutdown_event_);
-
- gpu_channels_.set(params.client_id, std::move(channel));
+ gpu_channels_.set(client_id, std::move(channel));
return channel_handle;
}
diff --git a/content/common/gpu/gpu_channel_manager.h b/content/common/gpu/gpu_channel_manager.h
index c7642aa..b4a635e 100644
--- a/content/common/gpu/gpu_channel_manager.h
+++ b/content/common/gpu/gpu_channel_manager.h
@@ -62,7 +62,6 @@ class GpuChannel;
class GpuChannelManagerDelegate;
class GpuMemoryBufferFactory;
class GpuWatchdog;
-struct EstablishChannelParams;
#if defined(OS_MACOSX)
struct BufferPresentedParams;
#endif
@@ -88,7 +87,12 @@ class CONTENT_EXPORT GpuChannelManager {
GpuChannelManagerDelegate* delegate() const { return delegate_; }
- IPC::ChannelHandle EstablishChannel(const EstablishChannelParams& params);
+ IPC::ChannelHandle EstablishChannel(int client_id,
+ uint64_t client_tracing_id,
+ bool preempts,
+ bool allow_view_command_buffers,
+ bool allow_real_time_streams);
+
void PopulateShaderCache(const std::string& shader);
void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
int client_id,
diff --git a/content/common/gpu/gpu_channel_manager_unittest.cc b/content/common/gpu/gpu_channel_manager_unittest.cc
index 2938b8d..7c3cc0b 100644
--- a/content/common/gpu/gpu_channel_manager_unittest.cc
+++ b/content/common/gpu/gpu_channel_manager_unittest.cc
@@ -5,7 +5,6 @@
#include <stddef.h>
#include <stdint.h>
-#include "content/common/gpu/establish_channel_params.h"
#include "content/common/gpu/gpu_channel.h"
#include "content/common/gpu/gpu_channel_manager.h"
#include "content/common/gpu/gpu_channel_test_common.h"
@@ -30,14 +29,10 @@ TEST_F(GpuChannelManagerTest, EstablishChannel) {
ASSERT_TRUE(channel_manager());
- EstablishChannelParams params;
- params.client_id = kClientId;
- params.client_tracing_id = kClientTracingId;
- params.preempts = false;
- params.allow_view_command_buffers = false;
- params.allow_real_time_streams = false;
- IPC::ChannelHandle channel_handle =
- channel_manager()->EstablishChannel(params);
+ IPC::ChannelHandle channel_handle = channel_manager()->EstablishChannel(
+ kClientId, kClientTracingId, false /* preempts */,
+ false /* allow_view_command_buffers */,
+ false /* allow_real_time_streams */);
EXPECT_NE("", channel_handle.name);
GpuChannel* channel = channel_manager()->LookupChannel(kClientId);
@@ -64,19 +59,17 @@ TEST_F(GpuChannelManagerTest, SecureValueStateForwarding) {
ASSERT_TRUE(channel_manager());
// Initialize gpu channels
- EstablishChannelParams params;
- params.client_id = kClientId1;
- params.client_tracing_id = kClientTracingId1;
- params.preempts = false;
- params.allow_view_command_buffers = false;
- params.allow_real_time_streams = false;
- channel_manager()->EstablishChannel(params);
+ channel_manager()->EstablishChannel(kClientId1, kClientTracingId1,
+ false /* preempts */,
+ false /* allow_view_command_buffer */,
+ false /* allow_real_time_streams */);
GpuChannel* channel1 = channel_manager()->LookupChannel(kClientId1);
ASSERT_TRUE(channel1);
- params.client_id = kClientId2;
- params.client_tracing_id = kClientTracingId2;
- channel_manager()->EstablishChannel(params);
+ channel_manager()->EstablishChannel(kClientId2, kClientTracingId2,
+ false /* preempts */,
+ false /* allow_view_command_buffers */,
+ false /* allow_real_time_streams */);
GpuChannel* channel2 = channel_manager()->LookupChannel(kClientId2);
ASSERT_TRUE(channel2);
diff --git a/content/common/gpu/gpu_channel_unittest.cc b/content/common/gpu/gpu_channel_unittest.cc
index 1705af4..d1e1929 100644
--- a/content/common/gpu/gpu_channel_unittest.cc
+++ b/content/common/gpu/gpu_channel_unittest.cc
@@ -5,7 +5,6 @@
#include <stdint.h>
#include "base/test/test_simple_task_runner.h"
-#include "content/common/gpu/establish_channel_params.h"
#include "content/common/gpu/gpu_channel.h"
#include "content/common/gpu/gpu_channel_manager.h"
#include "content/common/gpu/gpu_channel_test_common.h"
@@ -24,13 +23,9 @@ class GpuChannelTest : public GpuChannelTestCommon {
bool allow_real_time_streams) {
DCHECK(channel_manager());
uint64_t kClientTracingId = 1;
- EstablishChannelParams params;
- params.client_id = client_id;
- params.client_tracing_id = kClientTracingId;
- params.preempts = false;
- params.allow_view_command_buffers = allow_view_command_buffers;
- params.allow_real_time_streams = allow_real_time_streams;
- channel_manager()->EstablishChannel(params);
+ channel_manager()->EstablishChannel(
+ client_id, kClientTracingId, false /* preempts */,
+ allow_view_command_buffers, allow_real_time_streams);
return channel_manager()->LookupChannel(client_id);
}
diff --git a/content/common/gpu/gpu_memory_uma_stats.h b/content/common/gpu/gpu_memory_uma_stats.h
index daf91bf..6f58d76 100644
--- a/content/common/gpu/gpu_memory_uma_stats.h
+++ b/content/common/gpu/gpu_memory_uma_stats.h
@@ -6,6 +6,7 @@
#define CONTENT_COMMON_GPU_GPU_MEMORY_UMA_STATS_H_
#include <stddef.h>
+#include <stdint.h>
namespace content {
diff --git a/content/content_common.gypi b/content/content_common.gypi
index 48e67a6..d882941 100644
--- a/content/content_common.gypi
+++ b/content/content_common.gypi
@@ -371,8 +371,6 @@
'common/gpu/ca_layer_tree_mac.mm',
'common/gpu/child_window_surface_win.cc',
'common/gpu/child_window_surface_win.h',
- 'common/gpu/establish_channel_params.cc',
- 'common/gpu/establish_channel_params.h',
'common/gpu/gpu_host_messages.h',
'common/gpu/gpu_channel.cc',
'common/gpu/gpu_channel.h',
diff --git a/content/content_gpu.gypi b/content/content_gpu.gypi
index bba05e2..9727704 100644
--- a/content/content_gpu.gypi
+++ b/content/content_gpu.gypi
@@ -14,6 +14,8 @@
'sources': [
'gpu/content_gpu_message_generator.cc',
'gpu/content_gpu_message_generator.h',
+ 'gpu/establish_channel_params.cc',
+ 'gpu/establish_channel_params.h',
'gpu/gpu_child_thread.cc',
'gpu/gpu_child_thread.h',
'gpu/gpu_host_messages.h',
diff --git a/content/gpu/BUILD.gn b/content/gpu/BUILD.gn
index 94503da..0d685c7 100644
--- a/content/gpu/BUILD.gn
+++ b/content/gpu/BUILD.gn
@@ -27,6 +27,8 @@ source_set("gpu_sources") {
sources = [
"content_gpu_message_generator.cc",
"content_gpu_message_generator.h",
+ "establish_channel_params.cc",
+ "establlish_channel_params.h",
"gpu_child_thread.cc",
"gpu_child_thread.h",
"gpu_host_messages.h",
diff --git a/content/common/gpu/establish_channel_params.cc b/content/gpu/establish_channel_params.cc
index 21c8027..770c3bf 100644
--- a/content/common/gpu/establish_channel_params.cc
+++ b/content/gpu/establish_channel_params.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/common/gpu/establish_channel_params.h"
+#include "content/gpu/establish_channel_params.h"
namespace content {
diff --git a/content/common/gpu/establish_channel_params.h b/content/gpu/establish_channel_params.h
index 3a06f86..a416bff 100644
--- a/content/common/gpu/establish_channel_params.h
+++ b/content/gpu/establish_channel_params.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_COMMON_GPU_ESTABLISH_CHANNEL_PARAMS_H_
-#define CONTENT_COMMON_GPU_ESTABLISH_CHANNEL_PARAMS_H_
+#ifndef CONTENT_GPU_ESTABLISH_CHANNEL_PARAMS_H_
+#define CONTENT_GPU_ESTABLISH_CHANNEL_PARAMS_H_
#include <stdint.h>
@@ -24,4 +24,4 @@ struct CONTENT_EXPORT EstablishChannelParams {
} // namespace content
-#endif // CONTENT_COMMON_GPU_ESTABLISH_CHANNEL_PARAMS_H_
+#endif // CONTENT_GPU_ESTABLISH_CHANNEL_PARAMS_H_
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
index 2c5d4be..269d6a3 100644
--- a/content/gpu/gpu_child_thread.cc
+++ b/content/gpu/gpu_child_thread.cc
@@ -14,12 +14,12 @@
#include "build/build_config.h"
#include "content/child/child_process.h"
#include "content/child/thread_safe_sender.h"
-#include "content/common/gpu/establish_channel_params.h"
#include "content/common/gpu/gpu_memory_buffer_factory.h"
#include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h"
#include "content/common/gpu/media/gpu_video_decode_accelerator.h"
#include "content/common/gpu/media/gpu_video_encode_accelerator.h"
#include "content/common/gpu/media/media_service.h"
+#include "content/gpu/establish_channel_params.h"
#include "content/gpu/gpu_host_messages.h"
#include "content/gpu/gpu_process_control_impl.h"
#include "content/gpu/gpu_watchdog_thread.h"
@@ -514,8 +514,9 @@ void GpuChildThread::OnEstablishChannel(const EstablishChannelParams& params) {
if (!gpu_channel_manager_)
return;
- IPC::ChannelHandle channel_handle =
- gpu_channel_manager_->EstablishChannel(params);
+ IPC::ChannelHandle channel_handle = gpu_channel_manager_->EstablishChannel(
+ params.client_id, params.client_tracing_id, params.preempts,
+ params.allow_view_command_buffers, params.allow_real_time_streams);
media_service_->AddChannel(params.client_id);
Send(new GpuHostMsg_ChannelEstablished(channel_handle));
}
diff --git a/content/gpu/gpu_child_thread.h b/content/gpu/gpu_child_thread.h
index 31daaeb..111dbf5 100644
--- a/content/gpu/gpu_child_thread.h
+++ b/content/gpu/gpu_child_thread.h
@@ -42,6 +42,7 @@ class GpuMemoryBufferFactory;
class GpuProcessControlImpl;
class GpuWatchdogThread;
class MediaService;
+struct EstablishChannelParams;
// The main thread of the GPU child process. There will only ever be one of
// these per process. It does process initialization and shutdown. It forwards
diff --git a/content/gpu/gpu_host_messages.h b/content/gpu/gpu_host_messages.h
index ed6bb22..e87e652 100644
--- a/content/gpu/gpu_host_messages.h
+++ b/content/gpu/gpu_host_messages.h
@@ -7,9 +7,9 @@
#include "build/build_config.h"
#include "content/common/content_export.h"
-#include "content/common/gpu/establish_channel_params.h"
#include "content/common/gpu/gpu_memory_uma_stats.h"
#include "content/common/gpu/gpu_param_traits.h"
+#include "content/gpu/establish_channel_params.h"
#include "gpu/command_buffer/common/sync_token.h"
#include "gpu/command_buffer/common/value_state.h"
#include "gpu/command_buffer/service/gpu_preferences.h"