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

Unified Diff: mojo/services/public/cpp/view_manager/view_manager.h

Issue 317433004: Get view manager client lib unit test harness to run again. Does not get any individual tests worki… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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
« no previous file with comments | « mojo/services/public/cpp/view_manager/tests/view_manager_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/public/cpp/view_manager/view_manager.h
diff --git a/mojo/services/public/cpp/view_manager/view_manager.h b/mojo/services/public/cpp/view_manager/view_manager.h
index edfe2c1a0e1ff548968bdff77a526a45ff5843f4..34db8e7b7f2b44fadfe904ddf33374522c570ede 100644
--- a/mojo/services/public/cpp/view_manager/view_manager.h
+++ b/mojo/services/public/cpp/view_manager/view_manager.h
@@ -8,6 +8,7 @@
#include <map>
#include "base/basictypes.h"
+#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "mojo/public/cpp/bindings/callback.h"
#include "mojo/services/public/cpp/view_manager/view_tree_node.h"
@@ -27,16 +28,16 @@ class ViewTreeNode;
// TODO: displays
class ViewManager {
public:
- // Blocks on establishing the connection and subsequently receiving a node
- // tree from the service.
- // TODO(beng): blocking is currently achieved by running a nested runloop,
- // which will dispatch all messages on all pipes while blocking.
- // we should instead wait on the client pipe receiving a
- // connection established message.
- // TODO(beng): this method could optionally not block if supplied a callback.
- explicit ViewManager(Application* application);
~ViewManager();
+ // |ready_callback| is run when the ViewManager connection is established
+ // and ready to use.
+ static void Create(
+ Application* application,
+ const base::Callback<void(ViewManager*)> ready_callback);
+ // Blocks until ViewManager is ready to use.
+ static ViewManager* CreateBlocking(Application* application);
+
ViewTreeNode* tree() { return tree_; }
ViewTreeNode* GetNodeById(TransportNodeId id);
@@ -49,6 +50,11 @@ class ViewManager {
typedef std::map<TransportNodeId, ViewTreeNode*> IdToNodeMap;
typedef std::map<TransportViewId, View*> IdToViewMap;
+ ViewManager(Application* application,
+ const base::Callback<void(ViewManager*)> ready_callback);
+
+ base::Callback<void(ViewManager*)> ready_callback_;
+
ViewManagerSynchronizer* synchronizer_;
ViewTreeNode* tree_;
« no previous file with comments | « mojo/services/public/cpp/view_manager/tests/view_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698