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

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

Issue 600693002: content: Cleanup GpuMemoryBufferImpl destruction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove scoped_refptr<> from sender param of DeletedGpuMemoryBuffer Created 6 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
« no previous file with comments | « no previous file | content/browser/gpu/browser_gpu_channel_host_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ 5 #ifndef CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_
6 #define CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ 6 #define CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 20 matching lines...) Expand all
31 size_t size) OVERRIDE; 31 size_t size) OVERRIDE;
32 virtual CreateCommandBufferResult CreateViewCommandBuffer( 32 virtual CreateCommandBufferResult CreateViewCommandBuffer(
33 int32 surface_id, 33 int32 surface_id,
34 const GPUCreateCommandBufferConfig& init_params, 34 const GPUCreateCommandBufferConfig& init_params,
35 int32 route_id) OVERRIDE; 35 int32 route_id) OVERRIDE;
36 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( 36 virtual scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer(
37 size_t width, 37 size_t width,
38 size_t height, 38 size_t height,
39 unsigned internalformat, 39 unsigned internalformat,
40 unsigned usage) OVERRIDE; 40 unsigned usage) OVERRIDE;
41 virtual void DeleteGpuMemoryBuffer(
42 scoped_ptr<gfx::GpuMemoryBuffer> buffer) OVERRIDE;
43 41
44 // Specify a task runner and callback to be used for a set of messages. The 42 // Specify a task runner and callback to be used for a set of messages. The
45 // callback will be set up on the current GpuProcessHost, identified by 43 // callback will be set up on the current GpuProcessHost, identified by
46 // GpuProcessHostId(). 44 // GpuProcessHostId().
47 virtual void SetHandlerForControlMessages( 45 virtual void SetHandlerForControlMessages(
48 const uint32* message_ids, 46 const uint32* message_ids,
49 size_t num_messages, 47 size_t num_messages,
50 const base::Callback<void(const IPC::Message&)>& handler, 48 const base::Callback<void(const IPC::Message&)>& handler,
51 base::TaskRunner* target_task_runner); 49 base::TaskRunner* target_task_runner);
52 int GpuProcessHostId() { return gpu_host_id_; } 50 int GpuProcessHostId() { return gpu_host_id_; }
(...skipping 19 matching lines...) Expand all
72 void CreateViewCommandBufferOnIO( 70 void CreateViewCommandBufferOnIO(
73 CreateRequest* request, 71 CreateRequest* request,
74 int32 surface_id, 72 int32 surface_id,
75 const GPUCreateCommandBufferConfig& init_params); 73 const GPUCreateCommandBufferConfig& init_params);
76 static void CommandBufferCreatedOnIO(CreateRequest* request, 74 static void CommandBufferCreatedOnIO(CreateRequest* request,
77 CreateCommandBufferResult result); 75 CreateCommandBufferResult result);
78 static void AddFilterOnIO(int gpu_host_id, 76 static void AddFilterOnIO(int gpu_host_id,
79 scoped_refptr<IPC::MessageFilter> filter); 77 scoped_refptr<IPC::MessageFilter> filter);
80 static void AllocateGpuMemoryBufferOnIO( 78 static void AllocateGpuMemoryBufferOnIO(
81 AllocateGpuMemoryBufferRequest* request); 79 AllocateGpuMemoryBufferRequest* request);
82 static void DeleteGpuMemoryBufferOnIO(
83 scoped_ptr<gfx::GpuMemoryBuffer> buffer);
84 static void OnGpuMemoryBufferCreated(AllocateGpuMemoryBufferRequest* request, 80 static void OnGpuMemoryBufferCreated(AllocateGpuMemoryBufferRequest* request,
85 scoped_ptr<GpuMemoryBufferImpl> buffer); 81 scoped_ptr<GpuMemoryBufferImpl> buffer);
86 82
87 const int gpu_client_id_; 83 const int gpu_client_id_;
88 scoped_ptr<base::WaitableEvent> shutdown_event_; 84 scoped_ptr<base::WaitableEvent> shutdown_event_;
89 scoped_refptr<GpuChannelHost> gpu_channel_; 85 scoped_refptr<GpuChannelHost> gpu_channel_;
90 scoped_ptr<GpuMemoryBufferFactoryHostImpl> gpu_memory_buffer_factory_host_; 86 scoped_ptr<GpuMemoryBufferFactoryHostImpl> gpu_memory_buffer_factory_host_;
91 int gpu_host_id_; 87 int gpu_host_id_;
92 scoped_refptr<EstablishRequest> pending_request_; 88 scoped_refptr<EstablishRequest> pending_request_;
93 std::vector<base::Closure> established_callbacks_; 89 std::vector<base::Closure> established_callbacks_;
94 90
95 static BrowserGpuChannelHostFactory* instance_; 91 static BrowserGpuChannelHostFactory* instance_;
96 92
97 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); 93 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory);
98 }; 94 };
99 95
100 } // namespace content 96 } // namespace content
101 97
102 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ 98 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/gpu/browser_gpu_channel_host_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698