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

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

Issue 513573002: Mojo: Fix two bugs in content handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Darin comments, updates for Android toolchain 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
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_MANAGER_APPLICATION_LOADER_H_ 5 #ifndef MOJO_APPLICATION_MANAGER_APPLICATION_LOADER_H_
6 #define MOJO_APPLICATION_MANAGER_APPLICATION_LOADER_H_ 6 #define MOJO_APPLICATION_MANAGER_APPLICATION_LOADER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "mojo/application_manager/application_manager_export.h" 9 #include "mojo/application_manager/application_manager_export.h"
10 #include "mojo/public/cpp/system/core.h" 10 #include "mojo/public/cpp/system/core.h"
(...skipping 16 matching lines...) Expand all
27 class MOJO_APPLICATION_MANAGER_EXPORT LoadCallbacks 27 class MOJO_APPLICATION_MANAGER_EXPORT LoadCallbacks
28 : public base::RefCounted<LoadCallbacks> { 28 : public base::RefCounted<LoadCallbacks> {
29 public: 29 public:
30 // Register the requested application with ApplicationManager. If the 30 // Register the requested application with ApplicationManager. If the
31 // returned handle is valid, it should be used to implement the 31 // returned handle is valid, it should be used to implement the
32 // mojo::Application interface. 32 // mojo::Application interface.
33 virtual ScopedMessagePipeHandle RegisterApplication() = 0; 33 virtual ScopedMessagePipeHandle RegisterApplication() = 0;
34 34
35 // Load the requested application with a content handler. 35 // Load the requested application with a content handler.
36 virtual void LoadWithContentHandler(const GURL& content_handler_url, 36 virtual void LoadWithContentHandler(const GURL& content_handler_url,
37 URLResponsePtr response) = 0; 37 URLResponsePtr url_response,
darin (slow to review) 2014/08/27 06:34:19 Did you considered using ContentHandlerResponsePtr
Aaron Boodman 2014/08/27 18:26:13 I did consider that... I didn't do it because it d
38 URLLoaderPtr url_loader) = 0;
38 39
39 protected: 40 protected:
40 friend base::RefCounted<LoadCallbacks>; 41 friend base::RefCounted<LoadCallbacks>;
41 virtual ~LoadCallbacks() {} 42 virtual ~LoadCallbacks() {}
42 }; 43 };
43 44
44 // Implements RegisterApplication() by returning a handle that was specified 45 // Implements RegisterApplication() by returning a handle that was specified
45 // at construction time. LoadWithContentHandler() is not supported. 46 // at construction time. LoadWithContentHandler() is not supported.
46 class MOJO_APPLICATION_MANAGER_EXPORT SimpleLoadCallbacks 47 class MOJO_APPLICATION_MANAGER_EXPORT SimpleLoadCallbacks
47 : public LoadCallbacks { 48 : public LoadCallbacks {
48 public: 49 public:
49 SimpleLoadCallbacks(ScopedMessagePipeHandle shell_handle); 50 SimpleLoadCallbacks(ScopedMessagePipeHandle shell_handle);
50 virtual ScopedMessagePipeHandle RegisterApplication() OVERRIDE; 51 virtual ScopedMessagePipeHandle RegisterApplication() OVERRIDE;
51 virtual void LoadWithContentHandler(const GURL& content_handler_url, 52 virtual void LoadWithContentHandler(const GURL& content_handler_url,
52 URLResponsePtr response) OVERRIDE; 53 URLResponsePtr response,
54 URLLoaderPtr loader) OVERRIDE;
53 55
54 private: 56 private:
55 ScopedMessagePipeHandle shell_handle_; 57 ScopedMessagePipeHandle shell_handle_;
56 virtual ~SimpleLoadCallbacks(); 58 virtual ~SimpleLoadCallbacks();
57 }; 59 };
58 60
59 virtual ~ApplicationLoader() {} 61 virtual ~ApplicationLoader() {}
60 62
61 // Load the application named |url|. Applications can be loaded two ways: 63 // Load the application named |url|. Applications can be loaded two ways:
62 // 64 //
(...skipping 16 matching lines...) Expand all
79 virtual void OnApplicationError(ApplicationManager* manager, 81 virtual void OnApplicationError(ApplicationManager* manager,
80 const GURL& url) = 0; 82 const GURL& url) = 0;
81 83
82 protected: 84 protected:
83 ApplicationLoader() {} 85 ApplicationLoader() {}
84 }; 86 };
85 87
86 } // namespace mojo 88 } // namespace mojo
87 89
88 #endif // MOJO_APPLICATION_MANAGER_APPLICATION_LOADER_H_ 90 #endif // MOJO_APPLICATION_MANAGER_APPLICATION_LOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698