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

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

Issue 1195003002: Mandoline: Introduce ApplicationConnection::CloseConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed typo Created 5 years, 5 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 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_APPLICATION_PUBLIC_CPP_APPLICATION_IMPL_H_ 5 #ifndef MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_IMPL_H_
6 #define MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_IMPL_H_ 6 #define MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 // the ApplicationImpl is destroyed. 72 // the ApplicationImpl is destroyed.
73 Shell* shell() const { return shell_.get(); } 73 Shell* shell() const { return shell_.get(); }
74 74
75 const std::string& url() const { return url_; } 75 const std::string& url() const { return url_; }
76 76
77 AppLifetimeHelper* app_lifetime_helper() { return &app_lifetime_helper_; } 77 AppLifetimeHelper* app_lifetime_helper() { return &app_lifetime_helper_; }
78 78
79 // Requests a new connection to an application. Returns a pointer to the 79 // Requests a new connection to an application. Returns a pointer to the
80 // connection if the connection is permitted by this application's delegate, 80 // connection if the connection is permitted by this application's delegate,
81 // or nullptr otherwise. Caller does not take ownership. The pointer remains 81 // or nullptr otherwise. Caller does not take ownership. The pointer remains
82 // valid until an error occurs on the connection with the Shell, or until the 82 // valid until an error occurs on the connection with the Shell, until the
83 // ApplicationImpl is destroyed, whichever occurs first. 83 // ApplicationImpl is destroyed, or until the connection is closed through a
84 // call to ApplicationConnection::CloseConnection.
84 ApplicationConnection* ConnectToApplication(mojo::URLRequestPtr request); 85 ApplicationConnection* ConnectToApplication(mojo::URLRequestPtr request);
85 86
87 // Closes the |connection|.
88 void CloseConnection(ApplicationConnection* connection);
89
90 // Called by the ApplicationRunner to indicate that the ApplicationImpl will
91 // be destroyed soon.
92 void WillDestroySoon();
93
86 // Connect to application identified by |request->url| and connect to the 94 // Connect to application identified by |request->url| and connect to the
87 // service implementation of the interface identified by |Interface|. 95 // service implementation of the interface identified by |Interface|.
88 template <typename Interface> 96 template <typename Interface>
89 void ConnectToService(mojo::URLRequestPtr request, 97 void ConnectToService(mojo::URLRequestPtr request,
90 InterfacePtr<Interface>* ptr) { 98 InterfacePtr<Interface>* ptr) {
91 ConnectToApplication(request.Pass())->ConnectToService(ptr); 99 ConnectToApplication(request.Pass())->ConnectToService(ptr);
92 } 100 }
93 101
94 // Application implementation. 102 // Application implementation.
95 void Initialize(ShellPtr shell, const mojo::String& url) override; 103 void Initialize(ShellPtr shell, const mojo::String& url) override;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 AppLifetimeHelper app_lifetime_helper_; 143 AppLifetimeHelper app_lifetime_helper_;
136 bool quit_requested_; 144 bool quit_requested_;
137 base::WeakPtrFactory<ApplicationImpl> weak_factory_; 145 base::WeakPtrFactory<ApplicationImpl> weak_factory_;
138 146
139 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImpl); 147 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImpl);
140 }; 148 };
141 149
142 } // namespace mojo 150 } // namespace mojo
143 151
144 #endif // MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_IMPL_H_ 152 #endif // MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698