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

Unified Diff: trunk/src/mojo/services/public/cpp/view_manager/lib/view.cc

Issue 286653003: Revert 270122 "Synchronizes View instances across clients." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/mojo/services/public/cpp/view_manager/lib/view.cc
===================================================================
--- trunk/src/mojo/services/public/cpp/view_manager/lib/view.cc (revision 270124)
+++ trunk/src/mojo/services/public/cpp/view_manager/lib/view.cc (working copy)
@@ -1,82 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "mojo/services/public/cpp/view_manager/view.h"
-
-#include "mojo/services/public/cpp/view_manager/lib/view_manager_private.h"
-#include "mojo/services/public/cpp/view_manager/lib/view_private.h"
-#include "mojo/services/public/cpp/view_manager/view_observer.h"
-
-namespace mojo {
-namespace services {
-namespace view_manager {
-
-namespace {
-class ScopedDestructionNotifier {
- public:
- explicit ScopedDestructionNotifier(View* view)
- : view_(view) {
- FOR_EACH_OBSERVER(
- ViewObserver,
- *ViewPrivate(view_).observers(),
- OnViewDestroy(view_, ViewObserver::DISPOSITION_CHANGING));
- }
- ~ScopedDestructionNotifier() {
- FOR_EACH_OBSERVER(
- ViewObserver,
- *ViewPrivate(view_).observers(),
- OnViewDestroy(view_, ViewObserver::DISPOSITION_CHANGED));
- }
-
- private:
- View* view_;
-
- DISALLOW_COPY_AND_ASSIGN(ScopedDestructionNotifier);
-};
-} // namespace
-
-// static
-View* View::Create(ViewManager* manager) {
- View* view = new View(manager);
- ViewManagerPrivate(manager).AddView(view->id(), view);
- return view;
-}
-
-void View::Destroy() {
- if (manager_)
- ViewManagerPrivate(manager_).synchronizer()->DestroyView(id_);
- LocalDestroy();
-}
-
-void View::AddObserver(ViewObserver* observer) {
- observers_.AddObserver(observer);
-}
-
-void View::RemoveObserver(ViewObserver* observer) {
- observers_.RemoveObserver(observer);
-}
-
-View::View(ViewManager* manager)
- : id_(ViewManagerPrivate(manager).synchronizer()->CreateView()),
- node_(NULL),
- manager_(manager) {}
-
-View::View()
- : id_(-1),
- node_(NULL),
- manager_(NULL) {}
-
-View::~View() {
- ScopedDestructionNotifier notifier(this);
- if (manager_)
- ViewManagerPrivate(manager_).RemoveView(id_);
-}
-
-void View::LocalDestroy() {
- delete this;
-}
-
-} // namespace view_manager
-} // namespace services
-} // namespace mojo
« no previous file with comments | « trunk/src/mojo/mojo_services.gypi ('k') | trunk/src/mojo/services/public/cpp/view_manager/lib/view_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698