OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_APPLICATION_DELEGATE_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_APPLICATION_DELEGATE_H_ |
6 #define COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_APPLICATION_DELEGATE_H_ | 6 #define COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_APPLICATION_DELEGATE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class HTMLDocument; | 22 class HTMLDocument; |
23 | 23 |
24 // ApplicationDelegate created by the content handler for a specific url. | 24 // ApplicationDelegate created by the content handler for a specific url. |
25 class HTMLDocumentApplicationDelegate : public mojo::ApplicationDelegate, | 25 class HTMLDocumentApplicationDelegate : public mojo::ApplicationDelegate, |
26 public HTMLFactory { | 26 public HTMLFactory { |
27 public: | 27 public: |
28 HTMLDocumentApplicationDelegate( | 28 HTMLDocumentApplicationDelegate( |
29 mojo::InterfaceRequest<mojo::Application> request, | 29 mojo::InterfaceRequest<mojo::Application> request, |
30 mojo::URLResponsePtr response, | 30 mojo::URLResponsePtr response, |
31 GlobalState* global_state, | 31 GlobalState* global_state, |
32 scoped_ptr<mojo::AppRefCount> parent_app_refcount); | 32 scoped_ptr<mojo::AppRefCount> parent_app_refcount, |
| 33 const mojo::Callback<void()>& destruct_callback); |
33 | 34 |
34 void set_html_factory(HTMLFactory* factory) { html_factory_ = factory; } | 35 void set_html_factory(HTMLFactory* factory) { html_factory_ = factory; } |
35 HTMLFactory* html_factory() { return html_factory_; } | 36 HTMLFactory* html_factory() { return html_factory_; } |
36 | 37 |
37 private: | 38 private: |
38 class ServiceConnectorQueue; | 39 class ServiceConnectorQueue; |
39 | 40 |
40 ~HTMLDocumentApplicationDelegate() override; | 41 ~HTMLDocumentApplicationDelegate() override; |
41 | 42 |
42 // Callback from the quit closure. We key off this rather than | 43 // Callback from the quit closure. We key off this rather than |
(...skipping 26 matching lines...) Expand all Loading... |
69 mojo::URLLoaderFactoryPtr url_loader_factory_; | 70 mojo::URLLoaderFactoryPtr url_loader_factory_; |
70 mojo::URLResponsePtr initial_response_; | 71 mojo::URLResponsePtr initial_response_; |
71 GlobalState* global_state_; | 72 GlobalState* global_state_; |
72 | 73 |
73 // As we create HTMLDocuments they are added here. They are removed when the | 74 // As we create HTMLDocuments they are added here. They are removed when the |
74 // HTMLDocument is deleted. | 75 // HTMLDocument is deleted. |
75 std::set<HTMLDocument*> documents2_; | 76 std::set<HTMLDocument*> documents2_; |
76 | 77 |
77 HTMLFactory* html_factory_; | 78 HTMLFactory* html_factory_; |
78 | 79 |
| 80 mojo::Callback<void()> destruct_callback_; |
| 81 |
79 base::WeakPtrFactory<HTMLDocumentApplicationDelegate> weak_factory_; | 82 base::WeakPtrFactory<HTMLDocumentApplicationDelegate> weak_factory_; |
80 | 83 |
81 DISALLOW_COPY_AND_ASSIGN(HTMLDocumentApplicationDelegate); | 84 DISALLOW_COPY_AND_ASSIGN(HTMLDocumentApplicationDelegate); |
82 }; | 85 }; |
83 | 86 |
84 } // namespace html_viewer | 87 } // namespace html_viewer |
85 | 88 |
86 #endif // COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_APPLICATION_DELEGATE_H_ | 89 #endif // COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_APPLICATION_DELEGATE_H_ |
OLD | NEW |