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

Side by Side Diff: chrome/browser/renderer_host/accelerated_surface_container_manager_mac.h

Issue 3391011: Map: Guard concurrent accesses to a std::map by a lock in drawing code. (Closed)
Patch Set: Created 10 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 | chrome/browser/renderer_host/accelerated_surface_container_manager_mac.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ 5 #ifndef CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_
6 #define CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ 6 #define CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_
7 #pragma once 7 #pragma once
8 8
9 #include <OpenGL/OpenGL.h> 9 #include <OpenGL/OpenGL.h>
10 #include <map> 10 #include <map>
11 11
12 #include "app/surface/transport_dib.h" 12 #include "app/surface/transport_dib.h"
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/lock.h"
14 #include "gfx/native_widget_types.h" 15 #include "gfx/native_widget_types.h"
15 16
16 namespace webkit_glue { 17 namespace webkit_glue {
17 struct WebPluginGeometry; 18 struct WebPluginGeometry;
18 } 19 }
19 20
20 class AcceleratedSurfaceContainerMac; 21 class AcceleratedSurfaceContainerMac;
21 22
22 // Helper class that manages the backing store and on-screen rendering 23 // Helper class that manages the backing store and on-screen rendering
23 // of instances of the GPU plugin on the Mac. 24 // of instances of the GPU plugin on the Mac.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // there will only be one container active when the accelerated 100 // there will only be one container active when the accelerated
100 // compositor is active. 101 // compositor is active.
101 AcceleratedSurfaceContainerMac* root_container_; 102 AcceleratedSurfaceContainerMac* root_container_;
102 gfx::PluginWindowHandle root_container_handle_; 103 gfx::PluginWindowHandle root_container_handle_;
103 104
104 // True if gpu rendering is active. The root container is created on demand 105 // True if gpu rendering is active. The root container is created on demand
105 // and destroyed only when a renderer process exits. When the compositor was 106 // and destroyed only when a renderer process exits. When the compositor was
106 // created, this is set to |false| while the compositor is not needed. 107 // created, this is set to |false| while the compositor is not needed.
107 bool gpu_rendering_active_; 108 bool gpu_rendering_active_;
108 109
110 // Both |plugin_window_to_container_map_| and the
111 // AcceleratedSurfaceContainerMac in it are not threadsafe, but accessed from
112 // multiple threads. All these accesses are guarded by this lock.
113 mutable Lock lock_;
114
109 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac); 115 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac);
110 }; 116 };
111 117
112 #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ 118 #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_
113 119
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/renderer_host/accelerated_surface_container_manager_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698