There are only two types at the moment and we can therefore use a boolean.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203937357
This allows implementations to notify when the transfer is about to be started.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203102117
This allows all leaf data sources (i.e. ones which do not forward the requests
to other data sources) to accept multiple listeners.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203097587
This avoids the interrupted flag being lost if the exception
is handled as an IOException.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195366244
Cronet now returns an unmodifiable list, so we need to copy it
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194790506
These don't seem to be needed anymore. All tests run without them in gradle
and Blaze.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191867518
When using cronet data source, calling read after the end of input has
been read will trigger this.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184667794
This achieves two things:
1. All our tests use the same type of assertions.
2. The tests currently run as instrumentation test can be moved to
Robolectric without changing the assertions.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182910542
We need to make sure the original header is retained when we redirect.
I filed a request on Cronet to allow headers to be provided to the UrlRequest#followRedirect method:
https://bugs.chromium.org/p/chromium/issues/detail?id=779611
Until that API is changed, i.e., pulled into GMSCore, and most clients are using the version of GMSCore with the API change, we can stick with this approach.
FYI
Cronet generally uses the original headers on redirect:
http://[]
but modifies the headers for these special cases:
hhttp://[]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174074572
This time, we avoid using the problematic CookieManager and HttpCookie framework APIs by just forwarding the cookie request only when the client has enabled the feature and the server responds with a "Set-Cookie" response header.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173532023
*** Reason for rollback ***
CookieManager APIs are fundamentally broken (b/67951242)
*** Original change description ***
Cookie-based validation in CronetDataSource
Using cookie validation from streamer, streamer can enforce that only clients who have the cookie are able to stream the video.
***
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173396251
Recently added Java 8 features in the cronet extension and the linked native libs
require to enable Java 8 desugaring in gradle. Moreover, junit.assertThrows is not
available in our version and its usage has been replaced by the manual check.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172077967
Using cookie validation from streamer, streamer can enforce that only clients who have the cookie are able to stream the video.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171999924
The FakeClock allows to simulate timing behaviour including sleep time
for test cases.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162345258
We want to experiment with a direct executor to avoid thread hops between the
network thread and the response handling thread. This change is needed to do
so.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161812382
1. Remove tools:replace in manifest files. This attribute is only needed to establish priority when two manifests are merged and have the same attribute with different values.
As this is not happening here, the attributes can be removed.
2. Some BUILD files also define a deprecated manifest merge strategy different from the android default merge strategy. For consistency these are set to "android'.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158075128
In addition, the class now accepts available Cronet instances and returns the
source of the current CronetEngine.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=156185701
When using the CronetEngine.Builder class, it automatically selects the
Cronet version preferring higher version codes and falling back to a Java
Http implementation if no native or GMSCore version is available.
This version selection has now been moved into the CronetEngineFactory
class to always prefer GMSCore over natively bundled versions. We also
ignore the Cronet internal Java implementation. Instead, users of
CronetDataSourceFactory can provide their own fallback factory. If none is
provided, we use DefaultHttpDataSourceFactory.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154821040
The blaze BUILD file for the Cronet extension now has three options:
Using native bundled Cronet libs, using GMSCore, or using whichever is newer.
The GMSCore version is preselected (as it is the smallest), but other variants
may be used by uncommenting the respective lines.
The API is the same for all cases and the CronetEngine.Builder automatically
selects the newest option or falls back to default http.
To avoid that apps using this extension need to add a dependency to Cronet
themselves, I added a CronetEngineFactory to the Exoplayer extension.
Gradle builds can't be supported (as far as I can see), as the GMSCore Cronet
version is first party only.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154812029
When calling CronetDataSourceFactory.createDataSourceInteral, a null pointer
is passed as clock to the CronetDataSource constructor which in turn throws a
NullPointerException. Can be prevented by using other constructor without
clock parameter.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=153470874
- Errors reported by native stack use org.chromium.net.NetworkException class.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143475649
This is the second CL in the 3 CL process to switch Cronet versions.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=140074017
*** Reason for rollback ***
Flag doesn't enforce what it says it enforces, due to redirects
*** Original change description ***
Add REQUIRE_HTTPS flag
Note that it's not possible for the library to enforce that
the flag is adhered to, since it's possible for applications
to inject custom implementations of DataSource (there's no
requirement they even extend HttpDataSource for network
requesting implementations). It's possible for applications
to replace pretty much anything in the library, so there's
no other place we could put the flag where we could make
this guarantee. Hence this is a best-effort that will work
when...
***
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136583459
Note that it's not possible for the library to enforce that
the flag is adhered to, since it's possible for applications
to inject custom implementations of DataSource (there's no
requirement they even extend HttpDataSource for network
requesting implementations). It's possible for applications
to replace pretty much anything in the library, so there's
no other place we could put the flag where we could make
this guarantee. Hence this is a best-effort that will work
when using HttpDataSource implementations that we provide.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136500947
1. HttpMediaDrmCallback.executeProvisionRequest needs to specify
an empty byte[], else we do a GET instead of a POST.
2. Content-Type should not be set when making the provision
request, since there's no body.
3. DataSource implementations must correctly handle a non-null
body with zero length. CronetDataSource was not handling this
case. DefaultHttpDataSource was, but made a code modification
to make it a little clearer. OkHttpDataSource seems to handle
the case correctly, and it doens't look like the code can be
made clearer.
Issue #1925
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136042641
- Move nearly all logic onto the calling thread (i.e. the thread
calling open/read/close), to make threading correctness more
obvious.
- Document which variables are read/written from which thread, and
why the call sequences are safe.
- Fix thread safety issue that I think could probably cause data
corruption in the case of a read timeout followed by another
request into the DataSource.
Also:
- Relaxed content length checking to be consistent with the other
http DataSource implementations, and avoided parsing the headers
where they're not used.
- Fixed missing generics in CronetDataSourceFactory.
- Added TODO to work with servers that don't support partial range
requests.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135702217
This is a minor cleanup. The main thing it fixes is that
the "Inconsistent headers" and "Unexpected Content-Range"
log messages were printing List<String> objects, rather
than the actual headers they are supposed to print.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135378074
The access in fillCurrentRequestPostBody wasn't protected with
synchronization. Furthermore, just synchronizing it wouldn't be
sufficient, since what we really need to check is whether the
Content-Type header has been added to the UrlRequest.Builder.
The contents of requestProperties may have changed between the
headers being added to UrlRequest.Builder and the call to
fillCurrentRequestPostBody.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135376904
- Allow null Content-Type in response headers.
- Inline validateResponse, just because it makes it clearer
what thread it's being executed on when inlined.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135375063
- Fix bug in getCurrentRequestStatus where we weren't
blocking on the condition variable.
- Make methods static where possible.
- Clean up getUri implementation.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135373586
This change is a no-op reodering, as a precursor to
further cleanup. The public methods are grouped by
the class/interface they implement. The private methods
are ordered with things that will become static in
a subsequent change at the bottom.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135372629
- Enfroce read returns 0 if readLength==0 everywhere.
- Fixes and simplifications for CronetDataSource.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135138232