OLD | NEW |
1 <link rel="import" href="/mojo/public/html/core.html" as="core" /> | 1 <link rel="import" href="/mojo/public/html/core.html" as="core" /> |
2 <link rel="import" href="/mojo/public/html/unicode.html" as="unicode" /> | 2 <link rel="import" href="/mojo/public/html/unicode.html" as="unicode" /> |
3 <link rel="import" href="/mojo/services/public/interfaces/network/network_servic
e.mojom.html" as="net" /> | 3 <link rel="import" href="/mojo/services/public/interfaces/network/network_servic
e.mojom.html" as="net" /> |
4 <link rel="import" href="/mojo/services/public/interfaces/network/url_loader.moj
om.html" as="loader" /> | 4 <link rel="import" href="/mojo/services/public/interfaces/network/url_loader.moj
om.html" as="loader" /> |
5 <link rel="import" href="shell.sky" as="shell" /> | 5 <link rel="import" href="shell.sky" as="shell" /> |
6 <script> | 6 <script> |
7 function XMLHttpRequest() { | 7 function XMLHttpRequest() { |
8 this.networkService_ = shell.connectToService( | 8 this.networkService_ = shell.connectToService( |
9 "mojo://network_service/", net.NetworkService); | 9 "mojo://network_service/", net.NetworkService); |
10 this.request_ = null; | 10 this.request_ = null; |
(...skipping 23 matching lines...) Expand all Loading... |
34 self.responseText = unicode.decodeUtf8String(new Uint8Array(result.buffer)
); | 34 self.responseText = unicode.decodeUtf8String(new Uint8Array(result.buffer)
); |
35 self.onload(); | 35 self.onload(); |
36 }).catch(function(error) { | 36 }).catch(function(error) { |
37 self.onerror(error); | 37 self.onerror(error); |
38 }); | 38 }); |
39 }).catch(function(error) { | 39 }).catch(function(error) { |
40 self.onerror(error); | 40 self.onerror(error); |
41 }); | 41 }); |
42 }; | 42 }; |
43 | 43 |
44 this.exports = XMLHttpRequest; | 44 module.exports = XMLHttpRequest; |
45 </script> | 45 </script> |
OLD | NEW |