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

Issue 8436008: Add check on invalid file descriptor at both broker and renderer sides. (Closed)

Created:
9 years, 1 month ago by xhwang
Modified:
9 years, 1 month ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr., jam, dpranke-watch+content_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Add check on invalid file descriptor at both broker and renderer sides. The broker could send back an invalide channel handle if it fails to setup up renderer channel, e.g. when the broker fails to duplicate a file descriptor. Add a check in PpapiThread::SetupRendererChannel on this condition. Upon receiving an invalid channel handle from the broker, the BrokerDispatcherWrapper at the render side should check the channel handle before passing it down. Using an invalid channel handle to create a channel may cause LOG(FATAL) in IPC::Channel::ChannelImpl::CreatePipe(). Add a content unitest to check this. BUG=103957 TEST=new unit test Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=109747

Patch Set 1 #

Total comments: 10

Patch Set 2 : Made the test fixture much simpler. #

Total comments: 8

Patch Set 3 : Change comment about the mock_process_. #

Total comments: 2

Patch Set 4 : Adding check in HostDispatcherWrapper. Adding a positive test also. #

Total comments: 16

Patch Set 5 : Split failure and success cases to two different tests. #

Total comments: 6

Patch Set 6 : Fix indents/typo/format issues. #

Patch Set 7 : Synced and resolved conflict. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -5 lines) Patch
M content/content_tests.gypi View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/ppapi_plugin/ppapi_thread.cc View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/pepper_plugin_delegate_impl.cc View 1 2 3 4 5 6 3 chunks +22 lines, -5 lines 0 comments Download
A content/renderer/pepper_plugin_delegate_impl_unittest.cc View 1 2 3 4 5 1 chunk +58 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
xhwang
One thing not sure is to use -1 for invalid file descriptor. But in base/file_descriptor_posix, ...
9 years, 1 month ago (2011-11-03 22:07:40 UTC) #1
Paweł Hajdan Jr.
Drive-by with minor test nits, mostly to keep it simpler. http://codereview.chromium.org/8436008/diff/1/content/renderer/pepper_plugin_delegate_impl_unittest.cc File content/renderer/pepper_plugin_delegate_impl_unittest.cc (right): http://codereview.chromium.org/8436008/diff/1/content/renderer/pepper_plugin_delegate_impl_unittest.cc#newcode1 ...
9 years, 1 month ago (2011-11-04 08:05:14 UTC) #2
xhwang
Thanks for the great review. Now I make the test much simpler and will update ...
9 years, 1 month ago (2011-11-04 15:44:48 UTC) #3
Paweł Hajdan Jr.
Code I commented in the drive-by LGTM with a minor comment. Note that you still ...
9 years, 1 month ago (2011-11-04 16:58:39 UTC) #4
xhwang
That makes sense. Thanks! http://codereview.chromium.org/8436008/diff/5001/content/renderer/pepper_plugin_delegate_impl_unittest.cc File content/renderer/pepper_plugin_delegate_impl_unittest.cc (right): http://codereview.chromium.org/8436008/diff/5001/content/renderer/pepper_plugin_delegate_impl_unittest.cc#newcode12 content/renderer/pepper_plugin_delegate_impl_unittest.cc:12: // ppapi::proxy::ProxyChannel needs to be ...
9 years, 1 month ago (2011-11-04 22:34:04 UTC) #5
ddorwin
http://codereview.chromium.org/8436008/diff/5001/content/renderer/pepper_plugin_delegate_impl.cc File content/renderer/pepper_plugin_delegate_impl.cc (right): http://codereview.chromium.org/8436008/diff/5001/content/renderer/pepper_plugin_delegate_impl.cc#newcode483 content/renderer/pepper_plugin_delegate_impl.cc:483: if (channel_handle.name.empty()) We also need to make these checks ...
9 years, 1 month ago (2011-11-04 23:10:03 UTC) #6
ddorwin
http://codereview.chromium.org/8436008/diff/6005/content/renderer/pepper_plugin_delegate_impl.cc File content/renderer/pepper_plugin_delegate_impl.cc (right): http://codereview.chromium.org/8436008/diff/6005/content/renderer/pepper_plugin_delegate_impl.cc#newcode620 content/renderer/pepper_plugin_delegate_impl.cc:620: // Process all pending channel requests from the renderers. ...
9 years, 1 month ago (2011-11-07 20:02:28 UTC) #7
xhwang
Mostly modified as commented. Not sure if we need to add another unit test for ...
9 years, 1 month ago (2011-11-07 22:00:14 UTC) #8
ddorwin
Yes, it would be good to have a negative test and a positive one (if ...
9 years, 1 month ago (2011-11-07 23:54:07 UTC) #9
xhwang
http://codereview.chromium.org/8436008/diff/12001/content/renderer/pepper_plugin_delegate_impl.cc File content/renderer/pepper_plugin_delegate_impl.cc (right): http://codereview.chromium.org/8436008/diff/12001/content/renderer/pepper_plugin_delegate_impl.cc#newcode380 content/renderer/pepper_plugin_delegate_impl.cc:380: true, // is client On 2011/11/07 23:54:07, ddorwin wrote: ...
9 years, 1 month ago (2011-11-08 00:45:38 UTC) #10
ddorwin
lgtm Kicking off try bots.
9 years, 1 month ago (2011-11-08 01:03:11 UTC) #11
xhwang
Hello piman and brettw, Could you please do a OWNERS review on this change? Thanks! ...
9 years, 1 month ago (2011-11-11 22:26:16 UTC) #12
piman
LGTM. Please fix nits before submitting. http://codereview.chromium.org/8436008/diff/9006/content/renderer/pepper_plugin_delegate_impl.cc File content/renderer/pepper_plugin_delegate_impl.cc (right): http://codereview.chromium.org/8436008/diff/9006/content/renderer/pepper_plugin_delegate_impl.cc#newcode492 content/renderer/pepper_plugin_delegate_impl.cc:492: if (channel_handle.name.empty()) nit:indent ...
9 years, 1 month ago (2011-11-11 22:42:10 UTC) #13
xhwang
Done as commented. Thanks a lot for the quick and careful review! http://codereview.chromium.org/8436008/diff/9006/content/renderer/pepper_plugin_delegate_impl.cc File content/renderer/pepper_plugin_delegate_impl.cc ...
9 years, 1 month ago (2011-11-11 22:53:28 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/xhwang@chromium.org/8436008/14002
9 years, 1 month ago (2011-11-11 23:04:36 UTC) #15
commit-bot: I haz the power
Can't apply patch for file content/ppapi_plugin/ppapi_thread.cc. While running patch -p1 --forward --force; patching file content/ppapi_plugin/ppapi_thread.cc ...
9 years, 1 month ago (2011-11-11 23:04:42 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/xhwang@chromium.org/8436008/15002
9 years, 1 month ago (2011-11-11 23:29:03 UTC) #17
commit-bot: I haz the power
9 years, 1 month ago (2011-11-12 00:47:28 UTC) #18
Change committed as 109747

Powered by Google App Engine
This is Rietveld 408576698