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

Side by Side Diff: content/common/gpu/gpu_channel_manager.h

Issue 565833002: Refactoring the weak_ptr_factory order in src/content/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « content/common/gpu/gpu_channel.cc ('k') | content/common/gpu/gpu_channel_manager.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_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ 5 #ifndef CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_
6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ 6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; 74 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
75 75
76 // Sender overrides. 76 // Sender overrides.
77 virtual bool Send(IPC::Message* msg) OVERRIDE; 77 virtual bool Send(IPC::Message* msg) OVERRIDE;
78 78
79 bool HandleMessagesScheduled(); 79 bool HandleMessagesScheduled();
80 uint64 MessagesProcessed(); 80 uint64 MessagesProcessed();
81 81
82 void LoseAllContexts(); 82 void LoseAllContexts();
83 83
84 base::WeakPtrFactory<GpuChannelManager> weak_factory_;
85
86 int GenerateRouteID(); 84 int GenerateRouteID();
87 void AddRoute(int32 routing_id, IPC::Listener* listener); 85 void AddRoute(int32 routing_id, IPC::Listener* listener);
88 void RemoveRoute(int32 routing_id); 86 void RemoveRoute(int32 routing_id);
89 87
90 gpu::gles2::ProgramCache* program_cache(); 88 gpu::gles2::ProgramCache* program_cache();
91 gpu::gles2::ShaderTranslatorCache* shader_translator_cache(); 89 gpu::gles2::ShaderTranslatorCache* shader_translator_cache();
92 90
93 GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; } 91 GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; }
94 92
95 GpuEventsDispatcher* gpu_devtools_events_dispatcher() { 93 GpuEventsDispatcher* gpu_devtools_events_dispatcher() {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 GpuEventsDispatcher gpu_devtools_events_dispatcher_; 144 GpuEventsDispatcher gpu_devtools_events_dispatcher_;
147 GpuWatchdog* watchdog_; 145 GpuWatchdog* watchdog_;
148 scoped_refptr<SyncPointManager> sync_point_manager_; 146 scoped_refptr<SyncPointManager> sync_point_manager_;
149 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; 147 scoped_ptr<gpu::gles2::ProgramCache> program_cache_;
150 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; 148 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_;
151 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; 149 scoped_refptr<gfx::GLSurface> default_offscreen_surface_;
152 scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory_; 150 scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory_;
153 IPC::SyncChannel* channel_; 151 IPC::SyncChannel* channel_;
154 scoped_refptr<IPC::MessageFilter> filter_; 152 scoped_refptr<IPC::MessageFilter> filter_;
155 153
154 // Member variables should appear before the WeakPtrFactory, to ensure
155 // that any WeakPtrs to Controller are invalidated before its members
156 // variable's destructors are executed, rendering them invalid.
157 base::WeakPtrFactory<GpuChannelManager> weak_factory_;
158
156 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); 159 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager);
157 }; 160 };
158 161
159 } // namespace content 162 } // namespace content
160 163
161 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ 164 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_channel.cc ('k') | content/common/gpu/gpu_channel_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698