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 MOJO_DART_EMBEDDER_DART_STATE_H_ | 5 #ifndef MOJO_DART_EMBEDDER_DART_STATE_H_ |
6 #define MOJO_DART_EMBEDDER_DART_STATE_H_ | 6 #define MOJO_DART_EMBEDDER_DART_STATE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } | 59 } |
60 | 60 |
61 // Takes ownership of |raw_handle|. | 61 // Takes ownership of |raw_handle|. |
62 void BindNetworkService(MojoHandle raw_handle) { | 62 void BindNetworkService(MojoHandle raw_handle) { |
63 if (raw_handle == MOJO_HANDLE_INVALID) { | 63 if (raw_handle == MOJO_HANDLE_INVALID) { |
64 return; | 64 return; |
65 } | 65 } |
66 DCHECK(!network_service_.is_bound()); | 66 DCHECK(!network_service_.is_bound()); |
67 MessagePipeHandle handle(raw_handle); | 67 MessagePipeHandle handle(raw_handle); |
68 ScopedMessagePipeHandle message_pipe(handle); | 68 ScopedMessagePipeHandle message_pipe(handle); |
69 InterfacePtrInfo<mojo::NetworkService> interface_info(message_pipe.Pass(), | 69 InterfaceHandle<mojo::NetworkService> interface_info(message_pipe.Pass(), |
70 0); | 70 0); |
71 network_service_.Bind(interface_info.Pass()); | 71 network_service_.Bind(interface_info.Pass()); |
72 DCHECK(network_service_.is_bound()); | 72 DCHECK(network_service_.is_bound()); |
73 } | 73 } |
74 | 74 |
75 mojo::NetworkService* network_service() { | 75 mojo::NetworkService* network_service() { |
76 // Should only be called after |BindNetworkService|. | 76 // Should only be called after |BindNetworkService|. |
77 DCHECK(network_service_.is_bound()); | 77 DCHECK(network_service_.is_bound()); |
78 return network_service_.get(); | 78 return network_service_.get(); |
79 } | 79 } |
80 | 80 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 mojo::NetworkServicePtr network_service_; | 113 mojo::NetworkServicePtr network_service_; |
114 bool use_network_loader_; | 114 bool use_network_loader_; |
115 bool use_dart_run_loop_; | 115 bool use_dart_run_loop_; |
116 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 116 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
117 }; | 117 }; |
118 | 118 |
119 } // namespace dart | 119 } // namespace dart |
120 } // namespace mojo | 120 } // namespace mojo |
121 | 121 |
122 #endif // MOJO_DART_EMBEDDER_DART_STATE_H_ | 122 #endif // MOJO_DART_EMBEDDER_DART_STATE_H_ |
OLD | NEW |