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

Side by Side Diff: sky/examples/file-browser.sky

Issue 696373003: Don't GC message pipes that have an in-flight request (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 <!-- 1 <!--
2 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Copyright 2014 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 --> 5 -->
6 <import src="../framework/sky-element/sky-element.sky" as="SkyElement" /> 6 <import src="../framework/sky-element/sky-element.sky" as="SkyElement" />
7 <import src="../framework/xmlhttprequest.sky" as="XMLHttpRequest" /> 7 <import src="../framework/xmlhttprequest.sky" as="XMLHttpRequest" />
8 8
9 <template> 9 <template>
10 <style> 10 <style>
(...skipping 10 matching lines...) Expand all
21 </template> 21 </template>
22 </template> 22 </template>
23 <script> 23 <script>
24 SkyElement({ 24 SkyElement({
25 name: 'file-browser', 25 name: 'file-browser',
26 url: '', 26 url: '',
27 files: [], 27 files: [],
28 directories: [], 28 directories: [],
29 attached: function() { 29 attached: function() {
30 this.url = this.ownerDocument.URL; 30 this.url = this.ownerDocument.URL;
31 var xhr = this.xhr_ = new XMLHttpRequest(); 31 var xhr = new XMLHttpRequest();
32 xhr.open('GET', this.url + '?format=json'); 32 xhr.open('GET', this.url + '?format=json');
33 xhr.onload = (function() { 33 xhr.onload = (function() {
34 var listing = JSON.parse(xhr.responseText); 34 var listing = JSON.parse(xhr.responseText);
35 this.files = listing.files; 35 this.files = listing.files;
36 this.directories = listing.directories; 36 this.directories = listing.directories;
37 }).bind(this); 37 }).bind(this);
38 xhr.send(); 38 xhr.send();
39 } 39 }
40 }); 40 });
41 </script> 41 </script>
OLDNEW
« no previous file with comments | « mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl ('k') | sky/framework/xmlhttprequest.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698