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

Issue 1915153002: EDK: Add Dispatcher::SupportsEntrypointClass(). (Closed)

Created:
4 years, 8 months ago by viettrungluu
Modified:
4 years, 8 months ago
Reviewers:
azani
CC:
mojo-reviews_chromium.org, gregsimon, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org
Base URL:
https://github.com/domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

EDK: Add Dispatcher::SupportsEntrypointClass(). But don't actually use it yet. The problem we need to solve is: With rights, we'd like to do the rights check in a common place (in Core) for each entrypoint. However, in the case that the rights check fails (i.e., the handle doesn't have the required right(s)), we prefer to say "invalid argument" -- rather than "permission denied" -- if the dispatcher does not support that entrypoint. So what we do is the following, if an entrypoint |Foo()| is called: * Get the dispatcher |d|. (If this fails, then "invalid argument".) * Do the rights check. * If the rights check passes: * Call |d->Foo()|. * If |d| supports |Foo()|, it does its thing (and yields whatever result). * If not, then |d->Foo()| must return "invalid argument". * If the rights check fails, then: * Check |d->SupportsEntrypointClass(<class of Foo()>)|. * If |Foo()|'s class is supported, then "permission denied". * Else "invalid argument". Note that we could of course call |d->SupportsEntrypointClass()| even when the rights check passes. However, this is an additional call, and penalizes the common/important (non-error) case, so we prefer to just call |d->Foo()|. R=azani@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/b79f214f6cd802552d035ee36559686aa9b47515

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+187 lines, -15 lines) Patch
M mojo/edk/system/core_test_base.cc View 1 chunk +6 lines, -1 line 0 comments Download
M mojo/edk/system/data_pipe_consumer_dispatcher.h View 1 chunk +1 line, -0 lines 0 comments Download
M mojo/edk/system/data_pipe_consumer_dispatcher.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M mojo/edk/system/data_pipe_producer_dispatcher.h View 1 chunk +1 line, -0 lines 0 comments Download
M mojo/edk/system/data_pipe_producer_dispatcher.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M mojo/edk/system/dispatcher.h View 6 chunks +41 lines, -0 lines 0 comments Download
M mojo/edk/system/message_pipe_dispatcher.h View 1 chunk +1 line, -0 lines 0 comments Download
M mojo/edk/system/message_pipe_dispatcher.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M mojo/edk/system/message_pipe_dispatcher_unittest.cc View 10 chunks +53 lines, -12 lines 0 comments Download
M mojo/edk/system/mock_simple_dispatcher.h View 1 chunk +1 line, -0 lines 0 comments Download
M mojo/edk/system/mock_simple_dispatcher.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M mojo/edk/system/platform_handle_dispatcher.h View 1 chunk +1 line, -0 lines 0 comments Download
M mojo/edk/system/platform_handle_dispatcher.cc View 2 chunks +6 lines, -2 lines 0 comments Download
M mojo/edk/system/platform_handle_dispatcher_unittest.cc View 1 chunk +28 lines, -0 lines 0 comments Download
M mojo/edk/system/shared_buffer_dispatcher.h View 1 chunk +1 line, -0 lines 0 comments Download
M mojo/edk/system/shared_buffer_dispatcher.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M mojo/edk/system/shared_buffer_dispatcher_unittest.cc View 1 chunk +22 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
viettrungluu
4 years, 8 months ago (2016-04-25 18:19:10 UTC) #1
azani
lgtm
4 years, 8 months ago (2016-04-25 21:28:29 UTC) #2
viettrungluu
4 years, 8 months ago (2016-04-25 21:37:20 UTC) #4
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
b79f214f6cd802552d035ee36559686aa9b47515 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698