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 #include "services/dart/content_handler_app_service_connector.h" | 5 #include "services/dart/content_handler_app_service_connector.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "mojo/public/cpp/bindings/interface_request.h" | 8 #include "mojo/public/cpp/bindings/interface_request.h" |
9 #include "mojo/services/files/interfaces/files.mojom.h" | 9 #include "mojo/services/files/interfaces/files.mojom.h" |
10 #include "mojo/services/network/interfaces/network_service.mojom.h" | 10 #include "mojo/services/network/interfaces/network_service.mojom.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 case mojo::dart::DartControllerServiceConnector::kNetworkServiceId: { | 47 case mojo::dart::DartControllerServiceConnector::kNetworkServiceId: { |
48 std::string application_name = "mojo:network_service"; | 48 std::string application_name = "mojo:network_service"; |
49 // Construct proxy. | 49 // Construct proxy. |
50 mojo::NetworkServicePtr interface_ptr; | 50 mojo::NetworkServicePtr interface_ptr; |
51 runner_->PostTask(FROM_HERE, base::Bind( | 51 runner_->PostTask(FROM_HERE, base::Bind( |
52 &ContentHandlerAppServiceConnector::Connect<mojo::NetworkService>, | 52 &ContentHandlerAppServiceConnector::Connect<mojo::NetworkService>, |
53 weak_ptr_factory_.GetWeakPtr(), | 53 weak_ptr_factory_.GetWeakPtr(), |
54 application_name, | 54 application_name, |
55 base::Passed(GetProxy(&interface_ptr)))); | 55 base::Passed(GetProxy(&interface_ptr)))); |
56 // Return proxy end of pipe to caller. | 56 // Return proxy end of pipe to caller. |
57 return interface_ptr.PassInterface().PassHandle().release().value(); | 57 return interface_ptr.PassInterfaceHandle().PassHandle().release().value(); |
58 } | 58 } |
59 case mojo::dart::DartControllerServiceConnector::kFilesServiceId: { | 59 case mojo::dart::DartControllerServiceConnector::kFilesServiceId: { |
60 std::string application_name = "mojo:files"; | 60 std::string application_name = "mojo:files"; |
61 // Construct proxy. | 61 // Construct proxy. |
62 mojo::files::FilesPtr interface_ptr; | 62 mojo::files::FilesPtr interface_ptr; |
63 runner_->PostTask(FROM_HERE, base::Bind( | 63 runner_->PostTask(FROM_HERE, base::Bind( |
64 &ContentHandlerAppServiceConnector::Connect<mojo::files::Files>, | 64 &ContentHandlerAppServiceConnector::Connect<mojo::files::Files>, |
65 weak_ptr_factory_.GetWeakPtr(), | 65 weak_ptr_factory_.GetWeakPtr(), |
66 application_name, | 66 application_name, |
67 base::Passed(GetProxy(&interface_ptr)))); | 67 base::Passed(GetProxy(&interface_ptr)))); |
68 return interface_ptr.PassInterface().PassHandle().release().value(); | 68 return interface_ptr.PassInterfaceHandle().PassHandle().release().value(); |
69 } | 69 } |
70 break; | 70 break; |
71 default: | 71 default: |
72 return MOJO_HANDLE_INVALID; | 72 return MOJO_HANDLE_INVALID; |
73 break; | 73 break; |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 } // namespace dart | 77 } // namespace dart |
OLD | NEW |