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

Side by Side Diff: sky/sdk/lib/mojo/net/fetch.dart

Issue 1232313002: Use package:sky imports consistently (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix BUILD.gn Created 5 years, 5 months 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
« no previous file with comments | « sky/sdk/lib/mojo/keyboard.dart ('k') | sky/sdk/lib/mojo/net/image_cache.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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:async'; 5 import 'dart:async';
6 import 'dart:typed_data'; 6 import 'dart:typed_data';
7 7
8 import 'package:mojo/core.dart' as core; 8 import 'package:mojo/core.dart' as core;
9 import 'package:mojom/mojo/network_service.mojom.dart'; 9 import 'package:mojom/mojo/network_service.mojom.dart';
10 import 'package:mojom/mojo/url_loader.mojom.dart'; 10 import 'package:mojom/mojo/url_loader.mojom.dart';
11 import 'package:mojom/mojo/url_request.mojom.dart'; 11 import 'package:mojom/mojo/url_request.mojom.dart';
12 import 'package:mojom/mojo/url_response.mojom.dart'; 12 import 'package:mojom/mojo/url_response.mojom.dart';
13 13 import 'package:sky/mojo/shell.dart' as shell;
14 import '../shell.dart' as shell;
15 14
16 class Response { 15 class Response {
17 ByteData body; 16 ByteData body;
18 17
19 Response(this.body); 18 Response(this.body);
20 19
21 String bodyAsString() { 20 String bodyAsString() {
22 if (body == null) 21 if (body == null)
23 return null; 22 return null;
24 return new String.fromCharCodes(new Uint8List.view(body.buffer)); 23 return new String.fromCharCodes(new Uint8List.view(body.buffer));
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 if (response.body == null) return new Response(null); 55 if (response.body == null) return new Response(null);
57 56
58 ByteData data = await core.DataPipeDrainer.drainHandle(response.body); 57 ByteData data = await core.DataPipeDrainer.drainHandle(response.body);
59 return new Response(data); 58 return new Response(data);
60 } 59 }
61 60
62 Future<String> fetchString(String relativeUrl) async { 61 Future<String> fetchString(String relativeUrl) async {
63 Response response = await fetchBody(relativeUrl); 62 Response response = await fetchBody(relativeUrl);
64 return response.bodyAsString(); 63 return response.bodyAsString();
65 } 64 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/mojo/keyboard.dart ('k') | sky/sdk/lib/mojo/net/image_cache.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698