Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
ff1f0833
Commit
ff1f0833
authored
Jul 27, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #297 from abarth/network_nits
Cleanups to network service
parents
7cf81c81
b9e74071
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
fetch.dart
packages/flutter/lib/mojo/net/fetch.dart
+9
-7
No files found.
packages/flutter/lib/mojo/net/fetch.dart
View file @
ff1f0833
...
...
@@ -12,6 +12,14 @@ import 'package:mojom/mojo/url_request.mojom.dart';
import
'package:mojom/mojo/url_response.mojom.dart'
;
import
'package:sky/mojo/shell.dart'
as
shell
;
NetworkServiceProxy
_initNetworkService
(
)
{
NetworkServiceProxy
networkService
=
new
NetworkServiceProxy
.
unbound
();
shell
.
requestService
(
"mojo:authenticated_network_service"
,
networkService
);
return
networkService
;
}
final
NetworkServiceProxy
_networkService
=
_initNetworkService
();
class
Response
{
ByteData
body
;
...
...
@@ -26,16 +34,10 @@ class Response {
Future
<
UrlResponse
>
fetch
(
UrlRequest
request
)
async
{
try
{
NetworkServiceProxy
net
=
new
NetworkServiceProxy
.
unbound
();
shell
.
requestService
(
"mojo:authenticated_network_service"
,
net
);
UrlLoaderProxy
loader
=
new
UrlLoaderProxy
.
unbound
();
net
.
ptr
.
createUrlLoader
(
loader
);
_networkService
.
ptr
.
createUrlLoader
(
loader
);
UrlResponse
response
=
(
await
loader
.
ptr
.
start
(
request
)).
response
;
loader
.
close
();
net
.
close
();
return
response
;
}
catch
(
e
)
{
return
new
UrlResponse
()..
statusCode
=
500
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment