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

Side by Side Diff: components/exo/surface.cc

Issue 1717283003: tracing: Make ConvertableToTraceFormat move-only scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/exo/surface.h" 5 #include "components/exo/surface.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 } 436 }
437 437
438 void Surface::RemoveSurfaceObserver(SurfaceObserver* observer) { 438 void Surface::RemoveSurfaceObserver(SurfaceObserver* observer) {
439 observers_.RemoveObserver(observer); 439 observers_.RemoveObserver(observer);
440 } 440 }
441 441
442 bool Surface::HasSurfaceObserver(const SurfaceObserver* observer) const { 442 bool Surface::HasSurfaceObserver(const SurfaceObserver* observer) const {
443 return observers_.HasObserver(observer); 443 return observers_.HasObserver(observer);
444 } 444 }
445 445
446 scoped_refptr<base::trace_event::TracedValue> Surface::AsTracedValue() const { 446 scoped_ptr<base::trace_event::TracedValue> Surface::AsTracedValue() const {
447 scoped_refptr<base::trace_event::TracedValue> value = 447 scoped_ptr<base::trace_event::TracedValue> value(
448 new base::trace_event::TracedValue; 448 new base::trace_event::TracedValue());
449 value->SetString("name", layer()->name()); 449 value->SetString("name", layer()->name());
450 return value; 450 return value;
451 } 451 }
452 452
453 //////////////////////////////////////////////////////////////////////////////// 453 ////////////////////////////////////////////////////////////////////////////////
454 // aura::WindowObserver overrides: 454 // aura::WindowObserver overrides:
455 455
456 void Surface::OnWindowAddedToRootWindow(aura::Window* window) { 456 void Surface::OnWindowAddedToRootWindow(aura::Window* window) {
457 DCHECK(!compositor_); 457 DCHECK(!compositor_);
458 compositor_ = layer()->GetCompositor(); 458 compositor_ = layer()->GetCompositor();
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 // of the surface next time the compositor successfully ends compositing. 516 // of the surface next time the compositor successfully ends compositing.
517 update_contents_after_successful_compositing_ = true; 517 update_contents_after_successful_compositing_ = true;
518 } 518 }
519 519
520 void Surface::OnCompositingShuttingDown(ui::Compositor* compositor) { 520 void Surface::OnCompositingShuttingDown(ui::Compositor* compositor) {
521 compositor->RemoveObserver(this); 521 compositor->RemoveObserver(this);
522 compositor_ = nullptr; 522 compositor_ = nullptr;
523 } 523 }
524 524
525 } // namespace exo 525 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698