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

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

Issue 491443005: Get rid of KeepAlive. Quit shell when all urls run directly by Context are closed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Bring back ConnectToServiceViaNetwork Created 6 years, 3 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_APPLICATION_APPLICATION_IMPL_H_ 5 #ifndef MOJO_PUBLIC_APPLICATION_APPLICATION_IMPL_H_
6 #define MOJO_PUBLIC_APPLICATION_APPLICATION_IMPL_H_ 6 #define MOJO_PUBLIC_APPLICATION_APPLICATION_IMPL_H_
7 #include <vector> 7 #include <vector>
8 8
9 #include "mojo/public/cpp/application/application_connection.h" 9 #include "mojo/public/cpp/application/application_connection.h"
10 #include "mojo/public/cpp/application/lib/service_connector.h" 10 #include "mojo/public/cpp/application/lib/service_connector.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 explicit ShellPtrWatcher(ApplicationImpl* impl); 75 explicit ShellPtrWatcher(ApplicationImpl* impl);
76 virtual ~ShellPtrWatcher(); 76 virtual ~ShellPtrWatcher();
77 virtual void OnConnectionError() MOJO_OVERRIDE; 77 virtual void OnConnectionError() MOJO_OVERRIDE;
78 private: 78 private:
79 ApplicationImpl* impl_; 79 ApplicationImpl* impl_;
80 MOJO_DISALLOW_COPY_AND_ASSIGN(ShellPtrWatcher); 80 MOJO_DISALLOW_COPY_AND_ASSIGN(ShellPtrWatcher);
81 }; 81 };
82 82
83 void BindShell(ScopedMessagePipeHandle shell_handle); 83 void BindShell(ScopedMessagePipeHandle shell_handle);
84 void ClearConnections(); 84 void ClearConnections();
85 void OnShellError() { ClearConnections(); Terminate(); }; 85 void OnShellError() {
86 ClearConnections();
87 Terminate();
88 };
86 89
87 // Quits the main run loop for this application. 90 // Quits the main run loop for this application.
88 static void Terminate(); 91 static void Terminate();
89 92
90 // Application implementation. 93 // Application implementation.
91 virtual void AcceptConnection(const String& requestor_url, 94 virtual void AcceptConnection(const String& requestor_url,
92 ServiceProviderPtr provider) MOJO_OVERRIDE; 95 ServiceProviderPtr provider) MOJO_OVERRIDE;
93 96
94 typedef std::vector<internal::ServiceRegistry*> ServiceRegistryList; 97 typedef std::vector<internal::ServiceRegistry*> ServiceRegistryList;
95 ServiceRegistryList incoming_service_registries_; 98 ServiceRegistryList incoming_service_registries_;
96 ServiceRegistryList outgoing_service_registries_; 99 ServiceRegistryList outgoing_service_registries_;
97 ApplicationDelegate* delegate_; 100 ApplicationDelegate* delegate_;
98 ShellPtr shell_; 101 ShellPtr shell_;
99 ShellPtrWatcher shell_watch_; 102 ShellPtrWatcher shell_watch_;
100 103
101 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImpl); 104 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImpl);
102 }; 105 };
103 106
104 } // namespace mojo 107 } // namespace mojo
105 108
106 #endif // MOJO_PUBLIC_APPLICATION_APPLICATION_IMPL_H_ 109 #endif // MOJO_PUBLIC_APPLICATION_APPLICATION_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698