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

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

Issue 10852012: Fix lost context recreation race in BrowserGpuChannelHostFactory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« 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 "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/process.h" 10 #include "base/process.h"
(...skipping 21 matching lines...) Expand all
32 int32 surface_id, 32 int32 surface_id,
33 const GPUCreateCommandBufferConfig& init_params) OVERRIDE; 33 const GPUCreateCommandBufferConfig& init_params) OVERRIDE;
34 virtual GpuChannelHost* EstablishGpuChannelSync( 34 virtual GpuChannelHost* EstablishGpuChannelSync(
35 CauseForGpuLaunch cause_for_gpu_launch) OVERRIDE; 35 CauseForGpuLaunch cause_for_gpu_launch) OVERRIDE;
36 36
37 private: 37 private:
38 struct CreateRequest { 38 struct CreateRequest {
39 CreateRequest(); 39 CreateRequest();
40 ~CreateRequest(); 40 ~CreateRequest();
41 base::WaitableEvent event; 41 base::WaitableEvent event;
42 int gpu_host_id;
42 int32 route_id; 43 int32 route_id;
43 }; 44 };
44 45
45 struct EstablishRequest { 46 struct EstablishRequest {
46 EstablishRequest(); 47 explicit EstablishRequest(CauseForGpuLaunch);
47 ~EstablishRequest(); 48 ~EstablishRequest();
48 base::WaitableEvent event; 49 base::WaitableEvent event;
50 CauseForGpuLaunch cause_for_gpu_launch;
51 int gpu_host_id;
52 bool reused_gpu_process;
49 IPC::ChannelHandle channel_handle; 53 IPC::ChannelHandle channel_handle;
50 GPUInfo gpu_info; 54 GPUInfo gpu_info;
51 }; 55 };
52 56
53 BrowserGpuChannelHostFactory(); 57 BrowserGpuChannelHostFactory();
54 virtual ~BrowserGpuChannelHostFactory(); 58 virtual ~BrowserGpuChannelHostFactory();
55 59
56 void CreateViewCommandBufferOnIO( 60 void CreateViewCommandBufferOnIO(
57 CreateRequest* request, 61 CreateRequest* request,
58 int32 surface_id, 62 int32 surface_id,
59 const GPUCreateCommandBufferConfig& init_params); 63 const GPUCreateCommandBufferConfig& init_params);
60 static void CommandBufferCreatedOnIO(CreateRequest* request, int32 route_id); 64 static void CommandBufferCreatedOnIO(CreateRequest* request, int32 route_id);
61 void EstablishGpuChannelOnIO(EstablishRequest* request, 65 void EstablishGpuChannelOnIO(EstablishRequest* request);
62 CauseForGpuLaunch cause_for_gpu_launch); 66 void GpuChannelEstablishedOnIO(
63 static void GpuChannelEstablishedOnIO(
64 EstablishRequest* request, 67 EstablishRequest* request,
65 const IPC::ChannelHandle& channel_handle, 68 const IPC::ChannelHandle& channel_handle,
66 const GPUInfo& gpu_info); 69 const GPUInfo& gpu_info);
67 70
68 int gpu_client_id_; 71 int gpu_client_id_;
69 scoped_ptr<base::WaitableEvent> shutdown_event_; 72 scoped_ptr<base::WaitableEvent> shutdown_event_;
70 scoped_refptr<GpuChannelHost> gpu_channel_; 73 scoped_refptr<GpuChannelHost> gpu_channel_;
71 int gpu_host_id_; 74 int gpu_host_id_;
72 75
73 static BrowserGpuChannelHostFactory* instance_; 76 static BrowserGpuChannelHostFactory* instance_;
74 77
75 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory); 78 DISALLOW_COPY_AND_ASSIGN(BrowserGpuChannelHostFactory);
76 }; 79 };
77 80
78 } // namespace content 81 } // namespace content
79 82
80 #endif // CONTENT_BROWSER_GPU_BROWSER_GPU_CHANNEL_HOST_FACTORY_H_ 83 #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