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

Side by Side Diff: mojo/public/cpp/shell/application.h

Issue 294833002: Mojo: more idiomatic C++ bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more 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 unified diff | Download patch | Annotate | Revision Log
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 #ifndef MOJO_PUBLIC_SHELL_APPLICATION_H_ 5 #ifndef MOJO_PUBLIC_SHELL_APPLICATION_H_
6 #define MOJO_PUBLIC_SHELL_APPLICATION_H_ 6 #define MOJO_PUBLIC_SHELL_APPLICATION_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "mojo/public/cpp/shell/connect.h" 10 #include "mojo/public/cpp/shell/connect.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 template <typename Interface> 66 template <typename Interface>
67 void ConnectTo(const std::string& url, InterfacePtr<Interface>* ptr) { 67 void ConnectTo(const std::string& url, InterfacePtr<Interface>* ptr) {
68 mojo::ConnectTo(shell(), url, ptr); 68 mojo::ConnectTo(shell(), url, ptr);
69 } 69 }
70 70
71 protected: 71 protected:
72 // ShellClient methods. 72 // ShellClient methods.
73 // Override this to dispatch to correct service when there's more than one. 73 // Override this to dispatch to correct service when there's more than one.
74 // TODO(davemoore): Augment this with name registration. 74 // TODO(davemoore): Augment this with name registration.
75 virtual void AcceptConnection(const mojo::String& url, 75 virtual void AcceptConnection(mojo::String url,
76 ScopedMessagePipeHandle client_handle) 76 ScopedMessagePipeHandle client_handle)
77 MOJO_OVERRIDE; 77 MOJO_OVERRIDE;
78 78
79 private: 79 private:
80 // internal::ServiceConnectorBase::Owner methods. 80 // internal::ServiceConnectorBase::Owner methods.
81 // Takes ownership of |service_connector|. 81 // Takes ownership of |service_connector|.
82 virtual void AddServiceConnector( 82 virtual void AddServiceConnector(
83 internal::ServiceConnectorBase* service_connector) MOJO_OVERRIDE; 83 internal::ServiceConnectorBase* service_connector) MOJO_OVERRIDE;
84 virtual void RemoveServiceConnector( 84 virtual void RemoveServiceConnector(
85 internal::ServiceConnectorBase* service_connector) MOJO_OVERRIDE; 85 internal::ServiceConnectorBase* service_connector) MOJO_OVERRIDE;
86 86
87 typedef std::vector<internal::ServiceConnectorBase*> ServiceConnectorList; 87 typedef std::vector<internal::ServiceConnectorBase*> ServiceConnectorList;
88 ServiceConnectorList service_connectors_; 88 ServiceConnectorList service_connectors_;
89 }; 89 };
90 90
91 } // namespace mojo 91 } // namespace mojo
92 92
93 #endif // MOJO_PUBLIC_SHELL_APPLICATION_H_ 93 #endif // MOJO_PUBLIC_SHELL_APPLICATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698