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

Issue 9158005: RFC: Add an interface for having the browser open a pnacl support file (Closed)

Created:
8 years, 11 months ago by jvoung - send to chromium...
Modified:
8 years, 5 months ago
CC:
chromium-reviews, yzshen+watch_chromium.org, darin-cc_chromium.org, brettw-cc_chromium.org, piman+watch_chromium.org, native-client-reviews_googlegroups.com, ihf+watch_chromium.org
Visibility:
Public.

Description

RFC: Add an interface for having the browser open a pnacl support file (readonly) from the installed pnacl component directory. int (*GetReadonlyPnaclFd)(const char* filename); Trajectory: Currently for pnacl dogfooding we use a chrome extension to store pnacl files and do a URL request to read them. This is nice because: - we don't need any new interface to get to those files. - the chrome installer isn't bloated. However, we eventually want to use component updater instead of an extension, but that would require this new interface (or something like it). All this is to decouple our install/updates from the chrome install because the pnacl files are currently large. Why move to component updater: - Component updater allows us to send more user-machine information to Omaha to pick the right .nexe architecture for the pnacl tools rather than download one large extension with all architectures. This focuses the install/updates to 1/3 the files that were in the large extension (x86-32, x86-64, arm). - This is especially useful for Windows where there is a single version of chrome, so for things like the NaCl IRT we include both x86-32 and 64, just in case. With the right info sent to Omaha, PNaCl can pick exactly the required x86-32 vs 64 components rather than just including both blindly. - Similar to the above, we can test for the chrome revision and send out different packages to canary / beta / stable channels if needed. - Installs can be profile-independent -- no separate copies per profile. It is installed in the profile directory like PepperFlash, but it is profile/Pnacl not profile/User1/Pnacl and profile/User2/Pnacl. - Install via component updater will eventually require less user intervention (no going to the webstore). For now, this isn't quite true because the use of pnacl+component updater is still hidden behind a flag because of size issues. Alternatively, there are "component extensions", which have a similar transparent install? - URL requests in the NaCl plugin currently use stream-as-file, which makes copies of files into the temp directory. This avoids that copy. (30 - 200ms in a release build on Linux to do a URL load + copy, vs 0.4ms to just get the FD). - See component updater design doc for more: https://docs.google.com/a/google.com/document/d/1gqKdDaoH9s8pbQkb9I_EX8Cfdsjg1QFEIZxtbH0Mqs4/edit?hl=en_US Even without component updater, if we choose to bundle PNaCl with Chrome in ways other than an extension and use URL requests, we will need a similar interface. BUG= http://code.google.com/p/nativeclient/issues/detail?id=2365 TEST= to be written...

Patch Set 1 #

Patch Set 2 : // Do we want this to take a completion callback and be async, or #

Patch Set 3 : stuff. #

Patch Set 4 : tweak error cases, try off thread. #

Patch Set 5 : rebase, update for pnacl layout change #

Total comments: 1

Patch Set 6 : add a test, do some tweaks. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+476 lines, -11 lines) Patch
M chrome/browser/component_updater/pnacl/pnacl_component_installer.cc View 1 2 3 4 4 chunks +5 lines, -6 lines 0 comments Download
A chrome/browser/nacl_host/pnacl_file_host.h View 1 2 3 4 5 1 chunk +41 lines, -0 lines 0 comments Download
A chrome/browser/nacl_host/pnacl_file_host.cc View 1 2 3 4 5 1 chunk +186 lines, -0 lines 0 comments Download
A chrome/browser/nacl_host/pnacl_file_host_unittest.cc View 1 2 3 4 5 1 chunk +96 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/chrome_render_message_filter.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/chrome_render_message_filter.cc View 1 2 3 4 3 chunks +10 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_paths.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/chrome_paths.cc View 1 2 3 4 1 chunk +1 line, -3 lines 0 comments Download
M chrome/common/render_messages.h View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/renderer/chrome_ppapi_interfaces.cc View 1 2 3 4 2 chunks +28 lines, -0 lines 0 comments Download
M ppapi/api/private/finish_writing_these/ppb_nacl_private.idl View 1 1 chunk +7 lines, -0 lines 0 comments Download
M ppapi/c/private/ppb_nacl_private.h View 1 2 3 4 2 chunks +7 lines, -1 line 0 comments Download
M ppapi/native_client/src/trusted/plugin/module_ppapi.cc View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M ppapi/native_client/src/trusted/plugin/plugin.h View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M ppapi/native_client/src/trusted/plugin/plugin.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc View 1 2 3 4 5 4 chunks +77 lines, -0 lines 1 comment Download

Messages

Total messages: 15 (0 generated)
jvoung - send to chromium...
updated the description un bit
8 years, 11 months ago (2012-01-11 18:40:34 UTC) #1
sehr (please use chromium)
On 2012/01/11 18:40:34, jvoung wrote: > updated the description un bit Description LGTM. I think ...
8 years, 11 months ago (2012-01-12 22:35:56 UTC) #2
jvoung - send to chromium...
8 years, 11 months ago (2012-01-18 02:00:31 UTC) #3
jvoung - send to chromium...
+cc darin, brett You can ignore the patch (I was just testing things), but... does ...
8 years, 10 months ago (2012-02-06 21:22:02 UTC) #4
brettw
On Mon, Feb 6, 2012 at 1:22 PM, <jvoung@google.com> wrote: > +cc darin, brett > ...
8 years, 10 months ago (2012-02-06 21:59:06 UTC) #5
brettw
On Mon, Feb 6, 2012 at 1:22 PM, <jvoung@google.com> wrote: > +cc darin, brett > ...
8 years, 10 months ago (2012-02-06 21:59:08 UTC) #6
sehr (please use chromium)
On 2012/02/06 21:59:08, brettw wrote: > On Mon, Feb 6, 2012 at 1:22 PM, <mailto:jvoung@google.com> ...
8 years, 10 months ago (2012-02-07 18:38:42 UTC) #7
brettw
On Tue, Feb 7, 2012 at 10:38 AM, <sehr@google.com> wrote: > On 2012/02/06 21:59:08, brettw ...
8 years, 10 months ago (2012-02-07 19:32:10 UTC) #8
brettw
On Tue, Feb 7, 2012 at 10:38 AM, <sehr@google.com> wrote: > On 2012/02/06 21:59:08, brettw ...
8 years, 10 months ago (2012-02-07 19:32:12 UTC) #9
Mark Seaborn
http://codereview.chromium.org/9158005/diff/31001/chrome/browser/nacl_host/pnacl_file_host.cc File chrome/browser/nacl_host/pnacl_file_host.cc (right): http://codereview.chromium.org/9158005/diff/31001/chrome/browser/nacl_host/pnacl_file_host.cc#newcode128 chrome/browser/nacl_host/pnacl_file_host.cc:128: file_to_open = base::CreatePlatformFile(filepath, I would expect that won't work ...
8 years, 10 months ago (2012-02-26 21:02:44 UTC) #10
brettw
There is already some code to open the IRT a little after startup on Linux ...
8 years, 10 months ago (2012-02-26 21:49:59 UTC) #11
Use chromium.org instead
On Sun, Feb 26, 2012 at 1:50 PM, <brettw@chromium.org> wrote: > There is already some ...
8 years, 10 months ago (2012-02-27 17:32:08 UTC) #12
Use chromium.org instead
On Sun, Feb 26, 2012 at 1:50 PM, <brettw@chromium.org> wrote: > There is already some ...
8 years, 10 months ago (2012-02-27 17:32:10 UTC) #13
jvoung - send to chromium...
Thanks for the earlier comments Mark, and sorry about the delay -- sidetracked by other ...
8 years, 6 months ago (2012-06-19 18:29:41 UTC) #14
Mark Seaborn
8 years, 6 months ago (2012-06-20 20:12:55 UTC) #15
http://codereview.chromium.org/9158005/diff/34001/ppapi/native_client/src/tru...
File ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc (right):

http://codereview.chromium.org/9158005/diff/34001/ppapi/native_client/src/tru...
ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc:635: int fd =
get_readonly_pnacl_fd(filename.c_str());
I don't think get_readonly_pnacl_fd needs to be a global variable.  You can just
call GetBrowserInterface(PPB_NACL_PRIVATE_INTERFACE) here.

Powered by Google App Engine
This is Rietveld 408576698