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

Side by Side Diff: mojo/shell/application_manager.h

Issue 1257133003: Fix uaf in ApplicationInstance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ 5 #ifndef SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
6 #define SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ 6 #define SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 // and have a chance to shutdown. 146 // and have a chance to shutdown.
147 void TerminateShellConnections(); 147 void TerminateShellConnections();
148 148
149 // Removes a ApplicationInstance when it encounters an error. 149 // Removes a ApplicationInstance when it encounters an error.
150 void OnApplicationInstanceError(ApplicationInstance* instance); 150 void OnApplicationInstanceError(ApplicationInstance* instance);
151 151
152 // Removes a ContentHandler when its connection is closed. 152 // Removes a ContentHandler when its connection is closed.
153 void OnContentHandlerConnectionClosed( 153 void OnContentHandlerConnectionClosed(
154 ContentHandlerConnection* content_handler); 154 ContentHandlerConnection* content_handler);
155 155
156 ApplicationInstance* GetApplicationInstance(const Identity& identity) const;
157
156 private: 158 private:
157 using ApplicationPackagedAlias = std::map<GURL, std::pair<GURL, std::string>>; 159 using ApplicationPackagedAlias = std::map<GURL, std::pair<GURL, std::string>>;
158 using IdentityToApplicationInstanceMap = 160 using IdentityToApplicationInstanceMap =
159 std::map<Identity, ApplicationInstance*>; 161 std::map<Identity, ApplicationInstance*>;
160 using MimeTypeToURLMap = std::map<std::string, GURL>; 162 using MimeTypeToURLMap = std::map<std::string, GURL>;
161 using SchemeToLoaderMap = std::map<std::string, ApplicationLoader*>; 163 using SchemeToLoaderMap = std::map<std::string, ApplicationLoader*>;
162 using URLToContentHandlerMap = 164 using URLToContentHandlerMap =
163 std::map<std::pair<GURL, std::string>, ContentHandlerConnection*>; 165 std::map<std::pair<GURL, std::string>, ContentHandlerConnection*>;
164 using URLToLoaderMap = std::map<GURL, ApplicationLoader*>; 166 using URLToLoaderMap = std::map<GURL, ApplicationLoader*>;
165 using URLToNativeOptionsMap = std::map<GURL, NativeRunnerFactory::Options>; 167 using URLToNativeOptionsMap = std::map<GURL, NativeRunnerFactory::Options>;
(...skipping 21 matching lines...) Expand all
187 InterfaceRequest<Application> RegisterInstance( 189 InterfaceRequest<Application> RegisterInstance(
188 ApplicationInstance* originator, 190 ApplicationInstance* originator,
189 const GURL& app_url, 191 const GURL& app_url,
190 const std::string& qualifier, 192 const std::string& qualifier,
191 const GURL& requestor_url, 193 const GURL& requestor_url,
192 InterfaceRequest<ServiceProvider> services, 194 InterfaceRequest<ServiceProvider> services,
193 ServiceProviderPtr exposed_services, 195 ServiceProviderPtr exposed_services,
194 CapabilityFilterPtr filter, 196 CapabilityFilterPtr filter,
195 const base::Closure& on_application_end); 197 const base::Closure& on_application_end);
196 198
197 ApplicationInstance* GetApplicationInstance(const GURL& url,
198 const std::string& qualifier);
199
200 // Called once |fetcher| has found app. |requested_url| is the url of the 199 // Called once |fetcher| has found app. |requested_url| is the url of the
201 // requested application before any mappings/resolution have been applied. 200 // requested application before any mappings/resolution have been applied.
202 void HandleFetchCallback(ApplicationInstance* originator, 201 void HandleFetchCallback(ApplicationInstance* originator,
203 const GURL& requested_url, 202 const GURL& requested_url,
204 const std::string& qualifier, 203 const std::string& qualifier,
205 const GURL& requestor_url, 204 const GURL& requestor_url,
206 InterfaceRequest<ServiceProvider> services, 205 InterfaceRequest<ServiceProvider> services,
207 ServiceProviderPtr exposed_services, 206 ServiceProviderPtr exposed_services,
208 CapabilityFilterPtr filter, 207 CapabilityFilterPtr filter,
209 const base::Closure& on_application_end, 208 const base::Closure& on_application_end,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 bool disable_cache_; 254 bool disable_cache_;
256 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; 255 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_;
257 256
258 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); 257 DISALLOW_COPY_AND_ASSIGN(ApplicationManager);
259 }; 258 };
260 259
261 } // namespace shell 260 } // namespace shell
262 } // namespace mojo 261 } // namespace mojo
263 262
264 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ 263 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698