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

Side by Side Diff: cc/surfaces/display.cc

Issue 1996783002: Make cc::SurfaceId unguessable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | cc/surfaces/surface_id.h » ('j') | cc/surfaces/surface_id.h » ('J')
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 "cc/surfaces/display.h" 5 #include "cc/surfaces/display.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 bool Display::Initialize(std::unique_ptr<OutputSurface> output_surface, 104 bool Display::Initialize(std::unique_ptr<OutputSurface> output_surface,
105 base::SingleThreadTaskRunner* task_runner) { 105 base::SingleThreadTaskRunner* task_runner) {
106 output_surface_ = std::move(output_surface); 106 output_surface_ = std::move(output_surface);
107 if (!output_surface_->BindToClient(this)) 107 if (!output_surface_->BindToClient(this))
108 return false; 108 return false;
109 CreateScheduler(task_runner); 109 CreateScheduler(task_runner);
110 return true; 110 return true;
111 } 111 }
112 112
113 void Display::SetSurfaceId(SurfaceId id, float device_scale_factor) { 113 void Display::SetSurfaceId(SurfaceId id, float device_scale_factor) {
114 DCHECK_EQ(id.id_namespace(), compositor_surface_namespace_); 114 DCHECK_EQ(id.id_namespace, compositor_surface_namespace_);
115 if (current_surface_id_ == id && device_scale_factor_ == device_scale_factor) 115 if (current_surface_id_ == id && device_scale_factor_ == device_scale_factor)
116 return; 116 return;
117 117
118 TRACE_EVENT0("cc", "Display::SetSurfaceId"); 118 TRACE_EVENT0("cc", "Display::SetSurfaceId");
119 current_surface_id_ = id; 119 current_surface_id_ = id;
120 device_scale_factor_ = device_scale_factor; 120 device_scale_factor_ = device_scale_factor;
121 121
122 UpdateRootSurfaceResourcesLocked(); 122 UpdateRootSurfaceResourcesLocked();
123 if (scheduler_) 123 if (scheduler_)
124 scheduler_->SetNewRootSurface(id); 124 scheduler_->SetNewRootSurface(id);
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 419
420 if (surface_id == current_surface_id_) 420 if (surface_id == current_surface_id_)
421 UpdateRootSurfaceResourcesLocked(); 421 UpdateRootSurfaceResourcesLocked();
422 } 422 }
423 423
424 SurfaceId Display::CurrentSurfaceId() { 424 SurfaceId Display::CurrentSurfaceId() {
425 return current_surface_id_; 425 return current_surface_id_;
426 } 426 }
427 427
428 } // namespace cc 428 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/surfaces/surface_id.h » ('j') | cc/surfaces/surface_id.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698