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

Side by Side Diff: ui/ozone/platform/drm/gpu/screen_manager.cc

Issue 1072383003: ozone: drm: Fix HardwareDisplayController use-after-free (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test Created 5 years, 8 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 | ui/ozone/platform/drm/gpu/screen_manager_unittest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/ozone/platform/drm/gpu/screen_manager.h" 5 #include "ui/ozone/platform/drm/gpu/screen_manager.h"
6 6
7 #include <xf86drmMode.h> 7 #include <xf86drmMode.h>
8 8
9 #include "third_party/skia/include/core/SkCanvas.h" 9 #include "third_party/skia/include/core/SkCanvas.h"
10 #include "ui/gfx/geometry/point.h" 10 #include "ui/gfx/geometry/point.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 scoped_ptr<CrtcController>(new CrtcController(drm, crtc, connector)))); 92 scoped_ptr<CrtcController>(new CrtcController(drm, crtc, connector))));
93 } 93 }
94 94
95 void ScreenManager::RemoveDisplayController(const scoped_refptr<DrmDevice>& drm, 95 void ScreenManager::RemoveDisplayController(const scoped_refptr<DrmDevice>& drm,
96 uint32_t crtc) { 96 uint32_t crtc) {
97 HardwareDisplayControllers::iterator it = FindDisplayController(drm, crtc); 97 HardwareDisplayControllers::iterator it = FindDisplayController(drm, crtc);
98 if (it != controllers_.end()) { 98 if (it != controllers_.end()) {
99 bool is_mirrored = (*it)->IsMirrored(); 99 bool is_mirrored = (*it)->IsMirrored();
100 (*it)->RemoveCrtc(drm, crtc); 100 (*it)->RemoveCrtc(drm, crtc);
101 if (!is_mirrored) { 101 if (!is_mirrored) {
102 controllers_.erase(it);
102 UpdateControllerToWindowMapping(); 103 UpdateControllerToWindowMapping();
103 controllers_.erase(it);
104 } 104 }
105 } 105 }
106 } 106 }
107 107
108 bool ScreenManager::ConfigureDisplayController( 108 bool ScreenManager::ConfigureDisplayController(
109 const scoped_refptr<DrmDevice>& drm, 109 const scoped_refptr<DrmDevice>& drm,
110 uint32_t crtc, 110 uint32_t crtc,
111 uint32_t connector, 111 uint32_t connector,
112 const gfx::Point& origin, 112 const gfx::Point& origin,
113 const drmModeModeInfo& mode) { 113 const drmModeModeInfo& mode) {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 DrmWindow* ScreenManager::FindWindowAt(const gfx::Rect& bounds) const { 327 DrmWindow* ScreenManager::FindWindowAt(const gfx::Rect& bounds) const {
328 for (auto pair : window_map_) { 328 for (auto pair : window_map_) {
329 if (pair.second->bounds() == bounds) 329 if (pair.second->bounds() == bounds)
330 return pair.second; 330 return pair.second;
331 } 331 }
332 332
333 return nullptr; 333 return nullptr;
334 } 334 }
335 335
336 } // namespace ui 336 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/ozone/platform/drm/gpu/screen_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698