|
|
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
|
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
|
Total messages: 4 (1 generated)
|