17 Commits

Author SHA1 Message Date
John McCutchan
78dd8ad1ac Add host_resolver.mojom and update network_service.mojom
BUG=
R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/1187313002.
2015-06-18 10:37:56 -07:00
Eric Seidel
c1cad6ccda Don't crash when main.dart is a 404.
Ideally we would show a failwhale or some such, but
I don't know how we would bundle that file with our
APK yet.

Fixes https://github.com/domokit/mojo/issues/228

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1182633002.
2015-06-11 14:07:49 -07:00
Benjamin Lerman
f276f4f149 Update network service.
R=blundell@chromium.org

Review URL: https://codereview.chromium.org/1153933003
2015-06-05 14:57:32 +02:00
Eric Seidel
73c76d5031 Make OKNet not throw bananas when asked to parse 'banana'.
Catch the MalformedURLException instead of dying.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1153033010
2015-06-03 16:53:36 -07:00
James Robinson
f0cf77ffaf Move mojom definitions of URL{Request,Response} into SDK
This moves the definition of the mojom URLRequest and URLResponse
objects into the SDK at //mojo/public/interfaces/network/. These are
used directly by the shell and have a special place in the system. This
patch does the minimal amount of import/include updating to get tests
passing but doesn't fully update everything - in particular it
doesn't update all the C++ code that #includes url_loader.mojom.h for
the URLRequest or URLResponse definitions to #include the more specific
mojom.h files, or the equivalent in other languages. I'll do that in a
follow-up to minimize churn.

R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/1129063008
2015-05-27 17:07:51 -07:00
James Robinson
52083cd919 Update to newer network service implementation and mojoms from monet
This updates to using the network service implementation and mojoms from
050294719f

R=blundell@chromium.org, qsr@chromium.org, viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/1157783002
2015-05-27 13:24:56 -07:00
Eric Seidel
f25edfd741 Revert "skyshell: disable cache for now"
This reverts commit 9b03c575a4e12f80739d1de7d2c6d66a7cdb214a.
https://codereview.chromium.org/999253005

I've not seen the stale caching behavior.  I think we need
to debug that and fix it.  Living with out the cache
causes very long load times in SkyShell.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1086233002
2015-04-15 15:12:00 -07:00
Hixie
0ad1f744ce skyshell: disable cache for now
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/999253005
2015-03-26 14:27:17 -07:00
Adam Barth
4e7a413422 Use a thread pool for the CopyToPipe jobs in oknet
Rather than use a separate thread for every CopyToPipe job, we no use a
thread pool. It's not clear from the trace whether this is much faster,
but it makes the trace look much prettier.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1010433009
2015-03-25 10:44:12 -07:00
Adam Barth
1f589b52f0 Add an HTTP cache to SkyShell
This CL makes two changes to SkyShell's HTTP stack:

1) It introduces a disk cache so that responses can be loaded off disk instead
   of off the network.

2) It makes different instances of NetworkServiceImpl share the same
   OkHttpContext. Specifically, this means that network requests initiated from
   Dart share the same cache and connection pool as requests initiated from C++.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1006143003
2015-03-24 12:45:11 -07:00
Adam Barth
90a94680a2 Move oknet's read operations to a background thread
The read operation on OkHttp's ResponseBody object is blocking. The thread on
which we perform the read is highly contended during initial load. This CL
moves the read operation to a background thread, improving startup time for
StocksApp by 1s on a Nexus 5. Ideally we would perform an asynchronous read on
the stream, but that is not currently possible in OkHttp according to
http://stackoverflow.com/questions/29222231/reading-okhttp-responsebody-data-asynchronously

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1037443002
2015-03-24 12:44:06 -07:00
Adam Barth
27359c558f Add tracing to oknet
R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1018393006
2015-03-23 13:22:13 -07:00
Eric Seidel
03234dcfaf Log to android logger when loads fail in oknet.
This makes it much easier to debug (otherwise silent) 404s of images, etc.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1019103002
2015-03-18 14:15:09 -07:00
Adam Barth
e8b988e226 Expose Android sensors to via Mojo services
This CL adds a sensor_service to sky/services and wires it into SkyShell
The plan is to eventually use this data to implement shake-to-refresh.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/962043002
2015-02-27 14:37:50 -08:00
Eric Seidel
dc0b57a2e5 Don't crash when we 404.
This makes debugging that case much easier.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/958203002
2015-02-26 15:03:40 -08:00
Eric Seidel
3d09314b22 Make WebView::close not crash and start to fix navigation in SkyShell
However WebView::close() no longer crashes.  close() is never called
in MojoShell since mojo can't shutdown yet.

I tried closing the existing WebView and replacing it
but somehow that caused it to only draw red.  After a while
of looking at this with abarth we decided to just load into
the same WebView for now.

Eventually we should do something smarter where we start the
provisional load and only replace the webview once the new one is
ready, but that's a later CL.

R=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/952273003
2015-02-25 15:25:17 -08:00
Adam Barth
cf2f7afb9f Add an implementation of url_loader.mojom using OkHttp
This CL is the beginnings of an implementation of url_loader.mojom using the
OkHttp library. OkHttp is a relatively simple HTTP client library for Android
that implements HTTP/1.1 and HTTP/2.0. We might want to use OkHttp to bootstrap
into a more full-featured network_service implementation based on //net.

R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/930673002
2015-02-18 16:53:04 -08:00