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

Side by Side Diff: content/browser/gpu/browser_gpu_channel_host_factory.cc

Issue 245443005: Move IPC::MessageFilter and router to a separate file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix gn build Created 6 years, 8 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 | Annotate | Revision Log
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 "content/browser/gpu/browser_gpu_channel_host_factory.h" 5 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/threading/thread_restrictions.h" 9 #include "base/threading/thread_restrictions.h"
10 #include "content/browser/gpu/gpu_data_manager_impl.h" 10 #include "content/browser/gpu/gpu_data_manager_impl.h"
11 #include "content/browser/gpu/gpu_process_host.h" 11 #include "content/browser/gpu/gpu_process_host.h"
12 #include "content/browser/gpu/gpu_surface_tracker.h" 12 #include "content/browser/gpu/gpu_surface_tracker.h"
13 #include "content/common/child_process_host_impl.h" 13 #include "content/common/child_process_host_impl.h"
14 #include "content/common/gpu/client/gpu_memory_buffer_impl_shm.h" 14 #include "content/common/gpu/client/gpu_memory_buffer_impl_shm.h"
15 #include "content/common/gpu/gpu_messages.h" 15 #include "content/common/gpu/gpu_messages.h"
16 #include "content/public/browser/browser_thread.h" 16 #include "content/public/browser/browser_thread.h"
17 #include "content/public/browser/gpu_data_manager.h" 17 #include "content/public/browser/gpu_data_manager.h"
18 #include "content/public/common/content_client.h" 18 #include "content/public/common/content_client.h"
19 #include "ipc/ipc_forwarding_message_filter.h" 19 #include "ipc/ipc_forwarding_message_filter.h"
20 #include "ipc/message_filter.h"
20 21
21 namespace content { 22 namespace content {
22 23
23 BrowserGpuChannelHostFactory* BrowserGpuChannelHostFactory::instance_ = NULL; 24 BrowserGpuChannelHostFactory* BrowserGpuChannelHostFactory::instance_ = NULL;
24 25
25 BrowserGpuChannelHostFactory::CreateRequest::CreateRequest() 26 BrowserGpuChannelHostFactory::CreateRequest::CreateRequest()
26 : event(true, false), 27 : event(true, false),
27 gpu_host_id(0), 28 gpu_host_id(0),
28 route_id(MSG_ROUTING_NONE) { 29 route_id(MSG_ROUTING_NONE) {
29 } 30 }
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 new GpuMemoryBufferImplShm(gfx::Size(width, height), internalformat)); 393 new GpuMemoryBufferImplShm(gfx::Size(width, height), internalformat));
393 if (!buffer->InitializeFromSharedMemory(shm.Pass())) 394 if (!buffer->InitializeFromSharedMemory(shm.Pass()))
394 return scoped_ptr<gfx::GpuMemoryBuffer>(); 395 return scoped_ptr<gfx::GpuMemoryBuffer>();
395 396
396 return buffer.PassAs<gfx::GpuMemoryBuffer>(); 397 return buffer.PassAs<gfx::GpuMemoryBuffer>();
397 } 398 }
398 399
399 // static 400 // static
400 void BrowserGpuChannelHostFactory::AddFilterOnIO( 401 void BrowserGpuChannelHostFactory::AddFilterOnIO(
401 int host_id, 402 int host_id,
402 scoped_refptr<IPC::ChannelProxy::MessageFilter> filter) { 403 scoped_refptr<IPC::MessageFilter> filter) {
403 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 404 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
404 405
405 GpuProcessHost* host = GpuProcessHost::FromID(host_id); 406 GpuProcessHost* host = GpuProcessHost::FromID(host_id);
406 if (host) 407 if (host)
407 host->AddFilter(filter.get()); 408 host->AddFilter(filter.get());
408 } 409 }
409 410
410 void BrowserGpuChannelHostFactory::SetHandlerForControlMessages( 411 void BrowserGpuChannelHostFactory::SetHandlerForControlMessages(
411 const uint32* message_ids, 412 const uint32* message_ids,
412 size_t num_messages, 413 size_t num_messages,
(...skipping 11 matching lines...) Expand all
424 filter->AddRoute(MSG_ROUTING_CONTROL, handler); 425 filter->AddRoute(MSG_ROUTING_CONTROL, handler);
425 426
426 GetIOLoopProxy()->PostTask( 427 GetIOLoopProxy()->PostTask(
427 FROM_HERE, 428 FROM_HERE,
428 base::Bind(&BrowserGpuChannelHostFactory::AddFilterOnIO, 429 base::Bind(&BrowserGpuChannelHostFactory::AddFilterOnIO,
429 gpu_host_id_, 430 gpu_host_id_,
430 filter)); 431 filter));
431 } 432 }
432 433
433 } // namespace content 434 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.h ('k') | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698