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

Issue 1092005: Issue 1092005 (Closed)

Created:
10 years, 9 months ago by adonovan
Modified:
9 years, 7 months ago
CC:
native-client-reviews_googlegroups.com
Visibility:
Public.

Description

Hi Bennett, this change is a work in progress. Don't nitpick my code yet, but I've inserted several FIXME comments where I don't understand the existing code. Your feedback would be much appreciated. cheers alan - When fetching the NaCl module, include the architecture name in the URL. Attempt to fetch (optionally) the architecture-specific URL, the PNaCl URL and the architecture-independent URL (though this latter name should be considered deprecated). - Use MIME type "application/x-nacl-srpc" throughout, eliminating x-nacl-npapi and x-nacl-npapi-over-srpc. - Rename embed.src atrribute to embed.nexe to avoid eager fetching by browser, since the attribute no longer directly names a resource, but is mangled slightly. - Fix all tests' HTML to use the new attribute name. While we're there, add <noembed> elements to illustrate best practises. Questions: - how much architecture detail should we include in the resource name? "arm" is inadequate since there are several architectures; "armv7" (e.g.) would be better. But this raises the question: what about neon? SSE? etc.

Patch Set 1 #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+541 lines, -169 lines) Patch
M src/trusted/plugin/srpc/browser_interface.h View 1 chunk +1 line, -1 line 0 comments Download
M src/trusted/plugin/srpc/browser_interface.cc View 3 chunks +2 lines, -2 lines 0 comments Download
M src/trusted/plugin/srpc/closure.h View 4 chunks +10 lines, -1 line 0 comments Download
M src/trusted/plugin/srpc/closure.cc View 4 chunks +22 lines, -4 lines 0 comments Download
M src/trusted/plugin/srpc/plugin.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/trusted/plugin/srpc/plugin.cc View 4 chunks +59 lines, -9 lines 4 comments Download
M src/trusted/plugin/srpc/srpc.cc View 4 chunks +11 lines, -2 lines 5 comments Download
M tests/autoloader/autoloader_default.html View 1 chunk +6 lines, -1 line 0 comments Download
M tests/cdom_perf/cdom_perf.html View 1 chunk +7 lines, -2 lines 0 comments Download
M tests/contest_issues/issue42.html View 1 chunk +8 lines, -3 lines 0 comments Download
M tests/contest_issues/issue44.html View 1 chunk +6 lines, -2 lines 0 comments Download
M tests/contest_issues/issue45.html View 1 chunk +6 lines, -1 line 0 comments Download
M tests/contest_issues/issue49.html View 1 chunk +7 lines, -1 line 0 comments Download
M tests/contest_issues/issue52.html View 1 chunk +6 lines, -1 line 0 comments Download
M tests/contest_issues/issue53.html View 1 chunk +7 lines, -2 lines 0 comments Download
M tests/contest_issues/issue54.html View 1 chunk +7 lines, -2 lines 0 comments Download
M tests/contest_issues/issue55.html View 1 chunk +6 lines, -1 line 0 comments Download
M tests/contest_issues/issue57.html View 1 chunk +7 lines, -2 lines 0 comments Download
M tests/contest_issues/issue58.html View 1 chunk +7 lines, -2 lines 0 comments Download
M tests/contest_issues/issue62.html View 1 chunk +12 lines, -2 lines 0 comments Download
M tests/contest_issues/issue63.html View 1 chunk +6 lines, -1 line 0 comments Download
M tests/drawing/drawing.html View 1 chunk +7 lines, -1 line 0 comments Download
M tests/earth/earth.html View 2 chunks +7 lines, -2 lines 0 comments Download
M tests/life/life.html View 1 chunk +7 lines, -1 line 0 comments Download
M tests/lua/lua.html View 1 chunk +7 lines, -1 line 0 comments Download
M tests/mandel/mandel_tiled.html View 1 chunk +6 lines, -1 line 0 comments Download
M tests/mandel_nav/mandel_nav.html View 1 chunk +7 lines, -2 lines 0 comments Download
M tests/many/many18.html View 1 chunk +23 lines, -18 lines 0 comments Download
M tests/many/many3.html View 1 chunk +8 lines, -3 lines 0 comments Download
M tests/many/many36.html View 1 chunk +41 lines, -36 lines 0 comments Download
M tests/many/many9.html View 1 chunk +14 lines, -9 lines 0 comments Download
M tests/many/mix.html View 1 chunk +7 lines, -1 line 0 comments Download
M tests/npapi_bridge/npapi_perf.html View 1 chunk +7 lines, -2 lines 0 comments Download
M tests/npapi_bridge/npapi_test.html View 3 chunks +21 lines, -6 lines 0 comments Download
M tests/npapi_bridge/npapi_video.html View 1 chunk +7 lines, -2 lines 0 comments Download
M tests/npapi_geturl/npapi_geturl.html View 1 chunk +5 lines, -1 line 0 comments Download
M tests/npapi_hw/npapi_hw.html View 1 chunk +7 lines, -2 lines 0 comments Download
M tests/npapi_pi/npapi_pi.html View 1 chunk +7 lines, -2 lines 0 comments Download
M tests/npapi_runtime/npapi_runtime.html View 1 chunk +7 lines, -2 lines 0 comments Download
M tests/pepper_plugin/pepper_plugin.html View 1 chunk +7 lines, -2 lines 0 comments Download
M tests/photo/photo.html View 1 chunk +6 lines, -1 line 0 comments Download
M tests/quake/quake.html View 1 chunk +7 lines, -1 line 0 comments Download
M tests/quake/quake3.html View 1 chunk +22 lines, -3 lines 0 comments Download
M tests/quake/quake9.html View 1 chunk +15 lines, -9 lines 0 comments Download
M tests/ruby/ruby.html View 2 chunks +6 lines, -2 lines 0 comments Download
M tests/srpc/srpc_basic.html View 1 chunk +6 lines, -1 line 0 comments Download
M tests/srpc/srpc_display_shm.html View 1 chunk +1 line, -0 lines 0 comments Download
M tests/srpc/srpc_nrd_xfer.html View 1 chunk +12 lines, -2 lines 0 comments Download
M tests/srpc/srpc_plugin.html View 1 chunk +6 lines, -1 line 0 comments Download
M tests/srpc/srpc_shm.html View 1 chunk +6 lines, -1 line 0 comments Download
M tests/srpc/srpc_sockaddr.html View 1 chunk +6 lines, -1 line 0 comments Download
M tests/srpc/srpc_url_as_nacl_desc.html View 1 chunk +6 lines, -1 line 0 comments Download
M tests/srpc/srpcperf.html View 1 chunk +6 lines, -1 line 0 comments Download
M tests/srpc_hw/srpc_hw.html View 1 chunk +8 lines, -2 lines 0 comments Download
M tests/vim/vim.html View 1 chunk +7 lines, -2 lines 0 comments Download
M tests/voronoi/voronoi.html View 1 chunk +7 lines, -1 line 0 comments Download
M tests/xaos/xaos.html View 1 chunk +7 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
bsy
feedback on the fixmes, plus other kibbitzing. http://codereview.chromium.org/1092005/diff/1/2 File src/trusted/plugin/srpc/plugin.cc (right): http://codereview.chromium.org/1092005/diff/1/2#newcode246 src/trusted/plugin/srpc/plugin.cc:246: static const ...
10 years, 9 months ago (2010-03-23 21:20:37 UTC) #1
sehr (please use chromium)
Confirming Bennet's assessment. http://codereview.chromium.org/1092005/diff/1/7 File src/trusted/plugin/srpc/srpc.cc (right): http://codereview.chromium.org/1092005/diff/1/7#newcode442 src/trusted/plugin/srpc/srpc.cc:442: // non-NULL, and the other branch ...
10 years, 9 months ago (2010-03-23 21:37:16 UTC) #2
adonovan
http://codereview.chromium.org/1092005/diff/1/2 File src/trusted/plugin/srpc/plugin.cc (right): http://codereview.chromium.org/1092005/diff/1/2#newcode313 src/trusted/plugin/srpc/plugin.cc:313: // getting called? On 2010/03/23 21:20:37, bsy wrote: > ...
10 years, 9 months ago (2010-03-25 00:44:05 UTC) #3
sehr (please use chromium)
10 years, 8 months ago (2010-04-07 03:57:38 UTC) #4
More overdue comments.

http://codereview.chromium.org/1092005/diff/1/7
File src/trusted/plugin/srpc/srpc.cc (right):

http://codereview.chromium.org/1092005/diff/1/7#newcode420
src/trusted/plugin/srpc/srpc.cc:420: // branch condition is not under our
control.
I fear this code has changed somewhat due Bennet's recent change.  I don't think
it's substantially different, though.

NPP_URLNotify is invoked in (to the best of my knowledge) exactly three
situations:
1) When a nacl module load is requested due to src= being changed.
2) When a resource is requested by either __UrlAsNaClDesc or NPN_GetURL{Notify}.
3) When a nacl module load happens implicitly because src= was set in the embed
tag or data= in the object tag.

(1) and (2) have non-null closures explicitly.
(3) is potentially at issue.  I like your change because it fuses (3) into (1).

http://codereview.chromium.org/1092005/diff/1/7#newcode442
src/trusted/plugin/srpc/srpc.cc:442: // non-NULL, and the other branch of the
if-statement is taken.
On 2010/03/25 00:44:05, adonovan wrote:
> On 2010/03/23 21:37:16, sehr wrote:
> > On 2010/03/23 21:20:37, bsy wrote:
> > > plz verify w/ sehr, but i think this distinction is whether the load was
> > > initiated due to the <EMBED> tag or via NPN_URLNotify, where the plugin is
> > > asking the browser to load something.  in the latter case, there is no on
> > > failure handler, since the controlling code is C/C++, not javascript.
> > 
> > Bennet got this right.  We use the same code to download other assets (in
the
> > SRPC-only world) that we use to download module.
> 
> 
> Regarding the onfail handler, I can't actually find any respectable
> specifications of this HTML feature, so I guess it can't be that important. 
In
> any case, this is rather subtle and should probably be documented.
> 
> 
> But regarding the data flow in this function, I still think it is unsound. 
> Consider this: you cannot predict "reason"; it is determined by events outside
> the control of the plugin, so its value is arbitrary, and not correlated with
> the predicate "closure != NULL".  So, you don't learn the value of this
> predicate based on the conditional control flow.  Yet the two arms of the
> conditional make incompatible assumptions, the first that it is always true,
the
> second that it may be false.
> 
> If the first is right, then the onfail handler is unreachable.  If the second
is
> right, then we're possibly dereferencing a null pointer.
> 
> 

I think this block is because of (3) above.  But you're right that either up
there or down here has a problem.

Powered by Google App Engine
This is Rietveld 408576698