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

Side by Side Diff: services/dart/content_handler_app_service_connector.h

Issue 2010283006: Almost done: ApplicationDelegate -> ApplicationImplBase conversion. (Closed) Base URL: https://github.com/domokit/mojo.git@work798-x-work797-x-work796_no_run_main_app
Patch Set: rebased Created 4 years, 6 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 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 SERVICES_DART_CONTENT_HANDLER_APP_SERVICE_CONNECTOR_H_ 5 #ifndef SERVICES_DART_CONTENT_HANDLER_APP_SERVICE_CONNECTOR_H_
6 #define SERVICES_DART_CONTENT_HANDLER_APP_SERVICE_CONNECTOR_H_ 6 #define SERVICES_DART_CONTENT_HANDLER_APP_SERVICE_CONNECTOR_H_
7 7
8 #include "base/bind.h"
9 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
12 #include "base/message_loop/message_loop.h"
13 #include "mojo/dart/embedder/dart_controller.h" 10 #include "mojo/dart/embedder/dart_controller.h"
14 #include "mojo/public/cpp/application/application_impl.h" 11
12 namespace mojo {
13 class Shell;
14 } // namespace mojo
15 15
16 namespace dart { 16 namespace dart {
17 17
18 // Instances of this class must be constructed on the Dart content handler 18 // Instances of this class must be constructed on the Dart content handler
19 // message loop thread. 19 // message loop thread.
20 class ContentHandlerAppServiceConnector 20 class ContentHandlerAppServiceConnector
21 : public mojo::dart::DartControllerServiceConnector { 21 : public mojo::dart::DartControllerServiceConnector {
22 public: 22 public:
23 // Call this only on the same thread as the content_handler_runner. This is 23 // Call this only on the same thread as the content_handler_runner. This is
24 // checked in the body of the constructor. 24 // checked in the body of the constructor.
25 explicit ContentHandlerAppServiceConnector( 25 // TODO(vtl): Maybe this should take an
26 mojo::ApplicationImpl* content_handler_app); 26 // |InterfaceHandle<ApplicationConnector>| instead of a |Shell*|.
27 explicit ContentHandlerAppServiceConnector(mojo::Shell* shell);
27 28
28 // Must be called on the same thread that constructed |this|. 29 // Must be called on the same thread that constructed |this|.
29 ~ContentHandlerAppServiceConnector() override; 30 ~ContentHandlerAppServiceConnector() override;
30 31
31 // Implementing the DartControllerServiceConnector interface. 32 // Implementing the DartControllerServiceConnector interface.
32 // This is the only method that can be called from any thread. 33 // This is the only method that can be called from any thread.
33 MojoHandle ConnectToService(ServiceId service_id) override; 34 MojoHandle ConnectToService(ServiceId service_id) override;
34 35
35 private: 36 private:
36 template<typename Interface> 37 template<typename Interface>
37 void Connect(std::string application_name, 38 void Connect(std::string application_name,
38 mojo::InterfaceRequest<Interface> interface_request); 39 mojo::InterfaceRequest<Interface> interface_request);
39 40
40 scoped_refptr<base::SingleThreadTaskRunner> runner_; 41 scoped_refptr<base::SingleThreadTaskRunner> runner_;
41 mojo::ApplicationImpl* content_handler_app_; 42 mojo::Shell* shell_;
42 base::WeakPtrFactory<ContentHandlerAppServiceConnector> weak_ptr_factory_; 43 base::WeakPtrFactory<ContentHandlerAppServiceConnector> weak_ptr_factory_;
43 44
44 DISALLOW_COPY_AND_ASSIGN(ContentHandlerAppServiceConnector); 45 DISALLOW_COPY_AND_ASSIGN(ContentHandlerAppServiceConnector);
45 }; 46 };
46 47
47 48
48 } // namespace dart 49 } // namespace dart
49 50
50 #endif // SERVICES_DART_CONTENT_HANDLER_APP_SERVICE_CONNECTOR_H_ 51 #endif // SERVICES_DART_CONTENT_HANDLER_APP_SERVICE_CONNECTOR_H_
OLDNEW
« no previous file with comments | « services/dart/content_handler_app.cc ('k') | services/dart/content_handler_app_service_connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698