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

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

Issue 2349713003: IPC::MessageFilter::OnFilterAdded: IPC::Sender -> IPC::Channel (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 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 "content/gpu/gpu_child_thread.h" 5 #include "content/gpu/gpu_child_thread.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // on the IO thread. This allows the UI thread in the browser process to remain 77 // on the IO thread. This allows the UI thread in the browser process to remain
78 // fast at all times. 78 // fast at all times.
79 class GpuMemoryBufferMessageFilter : public IPC::MessageFilter { 79 class GpuMemoryBufferMessageFilter : public IPC::MessageFilter {
80 public: 80 public:
81 explicit GpuMemoryBufferMessageFilter( 81 explicit GpuMemoryBufferMessageFilter(
82 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory) 82 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory)
83 : gpu_memory_buffer_factory_(gpu_memory_buffer_factory), 83 : gpu_memory_buffer_factory_(gpu_memory_buffer_factory),
84 sender_(nullptr) {} 84 sender_(nullptr) {}
85 85
86 // Overridden from IPC::MessageFilter: 86 // Overridden from IPC::MessageFilter:
87 void OnFilterAdded(IPC::Sender* sender) override { 87 void OnFilterAdded(IPC::Channel* channel) override {
88 DCHECK(!sender_); 88 DCHECK(!sender_);
89 sender_ = sender; 89 sender_ = channel;
90 } 90 }
91 void OnFilterRemoved() override { 91 void OnFilterRemoved() override {
92 DCHECK(sender_); 92 DCHECK(sender_);
93 sender_ = nullptr; 93 sender_ = nullptr;
94 } 94 }
95 bool OnMessageReceived(const IPC::Message& message) override { 95 bool OnMessageReceived(const IPC::Message& message) override {
96 DCHECK(sender_); 96 DCHECK(sender_);
97 bool handled = true; 97 bool handled = true;
98 IPC_BEGIN_MESSAGE_MAP(GpuMemoryBufferMessageFilter, message) 98 IPC_BEGIN_MESSAGE_MAP(GpuMemoryBufferMessageFilter, message)
99 IPC_MESSAGE_HANDLER(GpuMsg_CreateGpuMemoryBuffer, OnCreateGpuMemoryBuffer) 99 IPC_MESSAGE_HANDLER(GpuMsg_CreateGpuMemoryBuffer, OnCreateGpuMemoryBuffer)
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 544
545 void GpuChildThread::BindServiceFactoryRequest( 545 void GpuChildThread::BindServiceFactoryRequest(
546 shell::mojom::ServiceFactoryRequest request) { 546 shell::mojom::ServiceFactoryRequest request) {
547 DVLOG(1) << "GPU: Binding shell::mojom::ServiceFactoryRequest"; 547 DVLOG(1) << "GPU: Binding shell::mojom::ServiceFactoryRequest";
548 DCHECK(service_factory_); 548 DCHECK(service_factory_);
549 service_factory_bindings_.AddBinding(service_factory_.get(), 549 service_factory_bindings_.AddBinding(service_factory_.get(),
550 std::move(request)); 550 std::move(request));
551 } 551 }
552 552
553 } // namespace content 553 } // namespace content
OLDNEW
« no previous file with comments | « content/common/font_cache_dispatcher_win.cc ('k') | content/public/browser/browser_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698