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

Issue 16569002: Use HTTP response headers for PNaCl caching instead of bitcode hash. (Closed)

Created:
7 years, 6 months ago by jvoung (off chromium)
Modified:
7 years, 6 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Use 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+579 lines, -136 lines) Patch
M ppapi/cpp/completion_callback.h View 1 2 3 4 5 6 7 8 1 chunk +13 lines, -0 lines 0 comments Download
M ppapi/native_client/src/trusted/plugin/file_downloader.h View 1 2 3 4 5 6 7 chunks +25 lines, -7 lines 0 comments Download
M ppapi/native_client/src/trusted/plugin/file_downloader.cc View 1 2 3 4 5 6 7 8 9 chunks +108 lines, -68 lines 0 comments Download
M ppapi/native_client/src/trusted/plugin/json_manifest.cc View 1 2 3 4 5 6 5 chunks +0 lines, -15 lines 0 comments Download
A ppapi/native_client/src/trusted/plugin/nacl_http_response_headers.h View 1 2 3 4 5 6 7 1 chunk +57 lines, -0 lines 0 comments Download
A ppapi/native_client/src/trusted/plugin/nacl_http_response_headers.cc View 1 2 3 4 5 6 7 1 chunk +107 lines, -0 lines 0 comments Download
A ppapi/native_client/src/trusted/plugin/nacl_http_response_headers_unittest.cc View 1 2 3 4 1 chunk +138 lines, -0 lines 0 comments Download
M ppapi/native_client/src/trusted/plugin/plugin.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h View 1 chunk +5 lines, -0 lines 0 comments Download
M ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc View 1 2 3 4 5 6 6 chunks +69 lines, -30 lines 0 comments Download
M ppapi/native_client/src/trusted/plugin/pnacl_options.h View 1 2 3 4 5 6 7 2 chunks +15 lines, -12 lines 0 comments Download
M ppapi/native_client/src/trusted/plugin/pnacl_options.cc View 1 2 3 4 5 6 3 chunks +28 lines, -4 lines 0 comments Download
M ppapi/ppapi_tests.gypi View 1 2 3 4 5 6 7 1 chunk +13 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
jvoung (off chromium)
7 years, 6 months ago (2013-06-06 21:59:27 UTC) #1
Derek Schuff
https://codereview.chromium.org/16569002/diff/38001/ppapi/native_client/src/trusted/plugin/file_downloader.h File ppapi/native_client/src/trusted/plugin/file_downloader.h (right): https://codereview.chromium.org/16569002/diff/38001/ppapi/native_client/src/trusted/plugin/file_downloader.h#newcode77 ppapi/native_client/src/trusted/plugin/file_downloader.h:77: // and |callback| will be called if the response ...
7 years, 6 months ago (2013-06-07 21:38:04 UTC) #2
jvoung (off chromium)
https://codereview.chromium.org/16569002/diff/38001/ppapi/native_client/src/trusted/plugin/file_downloader.h File ppapi/native_client/src/trusted/plugin/file_downloader.h (right): https://codereview.chromium.org/16569002/diff/38001/ppapi/native_client/src/trusted/plugin/file_downloader.h#newcode77 ppapi/native_client/src/trusted/plugin/file_downloader.h:77: // and |callback| will be called if the response ...
7 years, 6 months ago (2013-06-07 23:46:24 UTC) #3
Derek Schuff
otherwise LGTM
7 years, 6 months ago (2013-06-10 16:48:16 UTC) #4
Derek Schuff
https://codereview.chromium.org/16569002/diff/55001/ppapi/native_client/src/trusted/plugin/file_downloader.cc File ppapi/native_client/src/trusted/plugin/file_downloader.cc (right): https://codereview.chromium.org/16569002/diff/55001/ppapi/native_client/src/trusted/plugin/file_downloader.cc#newcode59 ppapi/native_client/src/trusted/plugin/file_downloader.cc:59: data_stream_callback_source_ = stream_callback_source; could just set open_and_stream_ = true ...
7 years, 6 months ago (2013-06-10 16:48:23 UTC) #5
jvoung (off chromium)
Should we do this for now (for the middle-ground of the new cache plumbing)? https://codereview.chromium.org/16569002/diff/55001/ppapi/native_client/src/trusted/plugin/file_downloader.cc ...
7 years, 6 months ago (2013-06-13 20:23:32 UTC) #6
Derek Schuff
yeah, we should go ahead and do this. Even if we end up moving some ...
7 years, 6 months ago (2013-06-13 20:36:01 UTC) #7
jvoung (off chromium)
dmichael, could you do an owners review for ppapi/ then?
7 years, 6 months ago (2013-06-13 20:53:31 UTC) #8
dmichael (off chromium)
https://codereview.chromium.org/16569002/diff/68001/ppapi/native_client/src/trusted/plugin/file_downloader.cc File ppapi/native_client/src/trusted/plugin/file_downloader.cc (right): https://codereview.chromium.org/16569002/diff/68001/ppapi/native_client/src/trusted/plugin/file_downloader.cc#newcode58 ppapi/native_client/src/trusted/plugin/file_downloader.cc:58: open_and_stream_ = false; It looks like you never initialized ...
7 years, 6 months ago (2013-06-14 16:21:43 UTC) #9
jvoung (off chromium)
https://codereview.chromium.org/16569002/diff/68001/ppapi/native_client/src/trusted/plugin/file_downloader.cc File ppapi/native_client/src/trusted/plugin/file_downloader.cc (right): https://codereview.chromium.org/16569002/diff/68001/ppapi/native_client/src/trusted/plugin/file_downloader.cc#newcode58 ppapi/native_client/src/trusted/plugin/file_downloader.cc:58: open_and_stream_ = false; On 2013/06/14 16:21:43, dmichael wrote: > ...
7 years, 6 months ago (2013-06-14 20:38:03 UTC) #10
dmichael (off chromium)
lgtm https://codereview.chromium.org/16569002/diff/68001/ppapi/native_client/src/trusted/plugin/file_downloader.cc File ppapi/native_client/src/trusted/plugin/file_downloader.cc (right): https://codereview.chromium.org/16569002/diff/68001/ppapi/native_client/src/trusted/plugin/file_downloader.cc#newcode301 ppapi/native_client/src/trusted/plugin/file_downloader.cc:301: file_open_notify_callback_.Run(pp_error); On 2013/06/14 20:38:03, jvoung (cr) wrote: > ...
7 years, 6 months ago (2013-06-14 21:09:03 UTC) #11
jvoung (off chromium)
https://codereview.chromium.org/16569002/diff/68001/ppapi/native_client/src/trusted/plugin/file_downloader.cc File ppapi/native_client/src/trusted/plugin/file_downloader.cc (right): https://codereview.chromium.org/16569002/diff/68001/ppapi/native_client/src/trusted/plugin/file_downloader.cc#newcode301 ppapi/native_client/src/trusted/plugin/file_downloader.cc:301: file_open_notify_callback_.Run(pp_error); Okay, there was a RunAndClearCompletionCallback function in the ...
7 years, 6 months ago (2013-06-17 18:20:27 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jvoung@chromium.org/16569002/100001
7 years, 6 months ago (2013-06-17 18:26:57 UTC) #13
commit-bot: I haz the power
7 years, 6 months ago (2013-06-17 21:07:10 UTC) #14
Message was sent while issue was closed.
Change committed as 206797

Powered by Google App Engine
This is Rietveld 408576698