DescriptionUse HTTP response headers for PNaCl caching instead of bitcode hash.
Use Last-Modified and/or ETag values from the server plus
the bitcode URL as a cache key. This allows us to remove
a hash from the bitcode header and/or the PNaCl manifests.
Also, start applying "Cache-Control: no-store" to the
translated nexe, if it is part of the pexe's GET response.
This also shifts around some of the file_downloader code
to allow us to get a callback after the initial GET request,
but before the streaming is completely done.
Some caveats due to the layering of the trusted NaCl plugin
vs the rest of chrome:
* We end up with a basic HTTP response parser that splits
fields based on what is returned by ppb_url_response_info.
This can have been replaced by net/http/http_response_info.h
For now, we end up with some extra testing burden.
See: nacl_http_response_headers_unittest.cc
Once we can depend on net/, we can replace this code.
* We end up with some key sanitization. Until we
switch from the HTML5 Filesystem to our own cache backend
there are 2 or 3 characters that are disallowed
in filenames.
See: http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#naming-restrictions
We did not run into that problem in the past because the
NMF file's hash only had hexadecimal characters,
which is okay.
* Since the URL is now part of the cache, and not some
hash of the contents, once the PNaCl cache is not
per-origin, we have to be a bit careful that a user can
only store something to its own origin. Perhaps that
checking can be done with SiteInstance's IsSameWebsite()?
This replaces: https://codereview.chromium.org/14683004.
With no sha hash to read, there is sha hash to verify.
BUG=http://code.google.com/p/nativeclient/issues/detail?id=2992
TEST=ppapi_unittests --gtest_filter=NaClHttpResponseHeadersTest*
TEST=browser_tests --gtest_filter=*Pnacl*
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=206797
Patch Set 1 #Patch Set 2 : cleanup #Patch Set 3 : more cleanup #Patch Set 4 : not <(DEPTH) #Patch Set 5 : simplify tst #
Total comments: 14
Patch Set 6 : cleanup #
Total comments: 2
Patch Set 7 : revert api #
Total comments: 32
Patch Set 8 : code review #Patch Set 9 : use RunAndClear #Messages
Total messages: 14 (0 generated)
|