| 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 import 'dart:_mojo/application.dart'; | 5 import 'dart:_mojo/application.dart'; |
| 6 import 'dart:_mojo/bindings.dart'; | 6 import 'dart:_mojo/bindings.dart'; |
| 7 import 'dart:_mojo/core.dart'; | 7 import 'dart:_mojo/core.dart'; |
| 8 import 'dart:_mojo/mojo/network_error.mojom.dart'; | 8 import 'dart:_mojo/mojo/network_error.mojom.dart'; |
| 9 import 'dart:_mojo_services/mojo/host_resolver.mojom.dart'; | 9 import 'dart:_mojo_services/mojo/host_resolver.mojom.dart'; |
| 10 import 'dart:_mojo_services/mojo/net_address.mojom.dart'; | 10 import 'dart:_mojo_services/mojo/net_address.mojom.dart'; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // | 32 // |
| 33 int _networkServiceHandle; | 33 int _networkServiceHandle; |
| 34 int _filesServiceHandle; | 34 int _filesServiceHandle; |
| 35 NetworkServiceProxy _networkService; | 35 NetworkServiceProxy _networkService; |
| 36 HostResolverProxy _hostResolver; | 36 HostResolverProxy _hostResolver; |
| 37 FilesProxy _files; | 37 FilesProxy _files; |
| 38 DirectoryProxy _rootDirectory; | 38 DirectoryProxy _rootDirectory; |
| 39 DirectoryProxy _systemTempDirectory; | 39 DirectoryProxy _systemTempDirectory; |
| 40 | 40 |
| 41 void _initialize(int networkServiceHandle, int filesServiceHandle) { | 41 void _initialize(int networkServiceHandle, int filesServiceHandle) { |
| 42 if (networkServiceHandle != MojoHandle.INVALID) { | 42 if (networkServiceHandle != MojoHandle.invalidHandle) { |
| 43 _networkServiceHandle = networkServiceHandle; | 43 _networkServiceHandle = networkServiceHandle; |
| 44 } | 44 } |
| 45 if (filesServiceHandle != MojoHandle.INVALID) { | 45 if (filesServiceHandle != MojoHandle.invalidHandle) { |
| 46 _filesServiceHandle = filesServiceHandle; | 46 _filesServiceHandle = filesServiceHandle; |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 | 49 |
| 50 void _shutdown() { | 50 void _shutdown() { |
| 51 if (_networkServiceHandle != null) { | 51 if (_networkServiceHandle != null) { |
| 52 // Network service proxies were never initialized. Create a handle | 52 // Network service proxies were never initialized. Create a handle |
| 53 // and close it. | 53 // and close it. |
| 54 var handle = new MojoHandle(_networkServiceHandle); | 54 var handle = new MojoHandle(_networkServiceHandle); |
| 55 _networkServiceHandle = null; | 55 _networkServiceHandle = null; |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 } | 289 } |
| 290 | 290 |
| 291 static _throwOnError(NetworkError error) { | 291 static _throwOnError(NetworkError error) { |
| 292 if (_okay(error)) { | 292 if (_okay(error)) { |
| 293 return; | 293 return; |
| 294 } | 294 } |
| 295 throw new OSError(error.description, error.code); | 295 throw new OSError(error.description, error.code); |
| 296 } | 296 } |
| 297 } | 297 } |
| 298 | 298 |
| OLD | NEW |