New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 788243 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

ScopedSharedBufferHandle should provide a data length accessor

Project Member Reported by noel@chromium.org, Nov 23 2017

Issue description

UnwrapSharedMemoryHandle has a data length accessor, but the mojo equivalent ScopedSharedBufferHandle does not [1].

Consider adding one to the mojo shared buffer handle.

https://chromium-review.googlesource.com/c/chromium/src/+/768332/21/content/common/render_message_filter.mojom#43



 
Just hit this. Looks like I have to use UnwrapSharedMemoryHandle() for now?

Comment 2 by roc...@chromium.org, Mar 22 2018

Or plumb the size along with the handle from where it's created. That's
probably better if you can do that.
I think that's what the code is currently doing, and dcheng@ was saying it would be nice if we didn't have to.

Comment 4 by roc...@chromium.org, Mar 22 2018

If you want to avoid it for now, yeah Unwrap is the only answer.

The Mojo shared buffer API is about to get some polish once the new base
API lands. We'll expose buffer size through a sane API as part of that.
I uploaded https://chromium-review.googlesource.com/976689 - it's also unpolished. If it's getting in the way of bigger changes, I'd be happy to abandon my CL and just Unwrap for now.

Comment 6 by roc...@chromium.org, Mar 22 2018

Ah hmm. That looks pretty good. I was planning to make a slightly more
generic API to query information about a buffer. It would only support size
for now, but would be extensible for other bits of information in the
future.
Project Member

Comment 7 by bugdroid1@chromium.org, Mar 24 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7b818885624401be6df25eff4cb6f3e16e43296d

commit 7b818885624401be6df25eff4cb6f3e16e43296d
Author: Lei Zhang <thestig@chromium.org>
Date: Sat Mar 24 01:38:40 2018

Add a data length method to mojo::ScopedSharedBufferHandle.

BUG= 788243 

Change-Id: Icd243edd24295125599f09adbebcadec62487e89
Reviewed-on: https://chromium-review.googlesource.com/976689
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545656}
[modify] https://crrev.com/7b818885624401be6df25eff4cb6f3e16e43296d/mojo/edk/embedder/entrypoints.cc
[modify] https://crrev.com/7b818885624401be6df25eff4cb6f3e16e43296d/mojo/edk/system/core.cc
[modify] https://crrev.com/7b818885624401be6df25eff4cb6f3e16e43296d/mojo/edk/system/core.h
[modify] https://crrev.com/7b818885624401be6df25eff4cb6f3e16e43296d/mojo/edk/system/dispatcher.cc
[modify] https://crrev.com/7b818885624401be6df25eff4cb6f3e16e43296d/mojo/edk/system/dispatcher.h
[modify] https://crrev.com/7b818885624401be6df25eff4cb6f3e16e43296d/mojo/edk/system/multiprocess_message_pipe_unittest.cc
[modify] https://crrev.com/7b818885624401be6df25eff4cb6f3e16e43296d/mojo/edk/system/shared_buffer_dispatcher.cc
[modify] https://crrev.com/7b818885624401be6df25eff4cb6f3e16e43296d/mojo/edk/system/shared_buffer_dispatcher.h
[modify] https://crrev.com/7b818885624401be6df25eff4cb6f3e16e43296d/mojo/public/c/system/buffer.h
[modify] https://crrev.com/7b818885624401be6df25eff4cb6f3e16e43296d/mojo/public/c/system/tests/core_api_unittest.cc
[modify] https://crrev.com/7b818885624401be6df25eff4cb6f3e16e43296d/mojo/public/c/system/thunks.cc
[modify] https://crrev.com/7b818885624401be6df25eff4cb6f3e16e43296d/mojo/public/c/system/thunks.h
[modify] https://crrev.com/7b818885624401be6df25eff4cb6f3e16e43296d/mojo/public/cpp/system/buffer.cc
[modify] https://crrev.com/7b818885624401be6df25eff4cb6f3e16e43296d/mojo/public/cpp/system/buffer.h
[modify] https://crrev.com/7b818885624401be6df25eff4cb6f3e16e43296d/mojo/public/cpp/system/tests/core_unittest.cc

Owner: thestig@chromium.org
Status: Fixed (was: Untriaged)
Project Member

Comment 9 by bugdroid1@chromium.org, Apr 4 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3415bfc07a9cd35f10aec8d95b2d68c20e8750b2

commit 3415bfc07a9cd35f10aec8d95b2d68c20e8750b2
Author: Lei Zhang <thestig@chromium.org>
Date: Wed Apr 04 17:13:05 2018

Remove buffer size return value in FontLoaderMac.

It is now possible to get the same information from the returned buffer.

BUG= 788243 

Change-Id: I5e76eedb5b5539167f93b1d275007f33f82a1c2b
Reviewed-on: https://chromium-review.googlesource.com/977055
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Wei Li <weili@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548105}
[modify] https://crrev.com/3415bfc07a9cd35f10aec8d95b2d68c20e8750b2/content/child/child_process_sandbox_support_impl_mac.cc
[modify] https://crrev.com/3415bfc07a9cd35f10aec8d95b2d68c20e8750b2/content/child/child_thread_impl.cc
[modify] https://crrev.com/3415bfc07a9cd35f10aec8d95b2d68c20e8750b2/content/child/child_thread_impl.h
[modify] https://crrev.com/3415bfc07a9cd35f10aec8d95b2d68c20e8750b2/content/common/font_loader_mac.mojom
[modify] https://crrev.com/3415bfc07a9cd35f10aec8d95b2d68c20e8750b2/content/common/mac/font_loader.h
[modify] https://crrev.com/3415bfc07a9cd35f10aec8d95b2d68c20e8750b2/content/common/mac/font_loader.mm
[modify] https://crrev.com/3415bfc07a9cd35f10aec8d95b2d68c20e8750b2/content/common/sandbox_mac_fontloading_unittest.mm
[modify] https://crrev.com/3415bfc07a9cd35f10aec8d95b2d68c20e8750b2/content/public/child/child_thread.h
[modify] https://crrev.com/3415bfc07a9cd35f10aec8d95b2d68c20e8750b2/content/public/test/mock_render_thread.cc
[modify] https://crrev.com/3415bfc07a9cd35f10aec8d95b2d68c20e8750b2/content/public/test/mock_render_thread.h

Sign in to add a comment