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

Issue 1280513002: Add GenericSharedMemoryId and use w/ GpuMemoryBuffer (Closed)

Created:
5 years, 4 months ago by ericrk
Modified:
5 years, 4 months ago
CC:
cblume, chromium-reviews, darin-cc_chromium.org, gavinp+memory_chromium.org, jam, piman+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@trackpools
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add GenericSharedMemoryId and use w/ GpuMemoryBuffer Adds a GenericSharedMemoryId type which will be used to track various types of shared memory (SharedBitmap, IOSurface, base::SharedMemory). Wire up GpuMemoryBufferManager so that GpuMemoryBufferId is just a typedef of this type, setting up for further integration in the future. Note regarding message changes - We needed a way for all GenericSharedMemoryIds used by a process to be unique. Currently a renderer process sometimes internally allocates shared memory and sometimes asks the browser process to do so. In order to allow for consistent naming, we cause the Renderer process to provide an ID to the browser when asking the browser to allocate on its behalf. +tsepez for message changes. +piman for content/gpu changes +danakj/reveman for other changes. TBR=sky@chromium.org BUG=512534 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Committed: https://crrev.com/c9984ebe42daab4cd51fb928c32d7d1f4f14a9c7 Cr-Commit-Position: refs/heads/master@{#343677}

Patch Set 1 #

Patch Set 2 : Comments and tweaks. #

Total comments: 14

Patch Set 3 : review #

Total comments: 13

Patch Set 4 : Share GUID types between GpuMemoryBuffer and GenericSharedMemory #

Total comments: 8

Patch Set 5 : rebase #

Patch Set 6 : Avoid double map lookup #

Total comments: 8

Patch Set 7 : Review Feedback #

Total comments: 16

Patch Set 8 : alphabetize #

Patch Set 9 : GenericSharedMemoryId > gfx::GenericSharedMemoryTracingId #

Total comments: 3

Patch Set 10 : Feedback #

Total comments: 15

Patch Set 11 : Fix non-mac platforms #

Patch Set 12 : remove "tracing" from name #

Unified diffs Side-by-side diffs Delta from patch set Stats (+218 lines, -72 lines) Patch
M cc/test/test_gpu_memory_buffer_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M components/view_manager/gles2/command_buffer_driver.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M components/view_manager/gles2/mojo_gpu_memory_buffer.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M content/browser/browser_io_surface_manager_mac.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/compositor/buffer_queue_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/gpu/browser_gpu_memory_buffer_manager.h View 1 2 3 4 6 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/gpu/browser_gpu_memory_buffer_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 10 chunks +30 lines, -19 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_buffer_pool_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_message_filter.h View 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_message_filter.cc View 2 chunks +5 lines, -7 lines 0 comments Download
M content/child/child_gpu_memory_buffer_manager.cc View 9 10 11 2 chunks +3 lines, -1 line 0 comments Download
M content/common/child_process_host_impl.h View 1 chunk +2 lines, -1 line 0 comments Download
M content/common/child_process_host_impl.cc View 3 chunks +2 lines, -5 lines 0 comments Download
M content/common/child_process_messages.h View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -1 line 0 comments Download
A content/common/generic_shared_memory_id_generator.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +19 lines, -0 lines 0 comments Download
A content/common/generic_shared_memory_id_generator.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +21 lines, -0 lines 0 comments Download
M content/common/gpu/client/gpu_memory_buffer_impl_io_surface.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -2 lines 0 comments Download
M content/common/gpu/client/gpu_memory_buffer_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +3 lines, -3 lines 0 comments Download
M content/common/gpu/gpu_memory_buffer_factory_io_surface.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +5 lines, -5 lines 0 comments Download
M content/common/gpu/gpu_memory_buffer_factory_ozone_native_pixmap.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +3 lines, -3 lines 0 comments Download
M content/common/gpu/gpu_memory_buffer_factory_surface_texture.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +6 lines, -5 lines 0 comments Download
M content/common/gpu/gpu_memory_buffer_factory_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M content/common/gpu/gpu_messages.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M content/content_common.gypi View 1 2 3 4 5 6 7 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M content/gpu/gpu_child_thread.cc View 1 2 3 4 5 6 7 8 2 chunks +1 line, -2 lines 0 comments Download
M gpu/command_buffer/tests/gl_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M media/renderers/mock_gpu_video_accelerator_factories.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
A ui/gfx/generic_shared_memory_id.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +54 lines, -0 lines 0 comments Download
A ui/gfx/generic_shared_memory_id.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +20 lines, -0 lines 0 comments Download
M ui/gfx/gfx.gyp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M ui/gfx/gpu_memory_buffer.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -1 line 0 comments Download
M ui/gfx/gpu_memory_buffer.cc View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -6 lines 0 comments Download

Messages

Total messages: 70 (28 generated)
Tom Sepez
Messages LGTM, one comment. https://codereview.chromium.org/1280513002/diff/20001/base/memory/generic_shared_memory_id.h File base/memory/generic_shared_memory_id.h (right): https://codereview.chromium.org/1280513002/diff/20001/base/memory/generic_shared_memory_id.h#newcode18 base/memory/generic_shared_memory_id.h:18: using GenericSharedMemoryId = int; do ...
5 years, 4 months ago (2015-08-06 00:11:09 UTC) #4
reveman
https://codereview.chromium.org/1280513002/diff/20001/base/memory/generic_shared_memory_id.cc File base/memory/generic_shared_memory_id.cc (right): https://codereview.chromium.org/1280513002/diff/20001/base/memory/generic_shared_memory_id.cc#newcode11 base/memory/generic_shared_memory_id.cc:11: nit: unnecessary blankline https://codereview.chromium.org/1280513002/diff/20001/base/memory/generic_shared_memory_id.cc#newcode23 base/memory/generic_shared_memory_id.cc:23: nit: unnecessary blankline https://codereview.chromium.org/1280513002/diff/20001/base/memory/generic_shared_memory_id.h ...
5 years, 4 months ago (2015-08-06 04:25:06 UTC) #5
ericrk
Thanks for the feedback! https://codereview.chromium.org/1280513002/diff/20001/base/memory/generic_shared_memory_id.cc File base/memory/generic_shared_memory_id.cc (right): https://codereview.chromium.org/1280513002/diff/20001/base/memory/generic_shared_memory_id.cc#newcode11 base/memory/generic_shared_memory_id.cc:11: On 2015/08/06 04:25:06, reveman wrote: ...
5 years, 4 months ago (2015-08-06 18:28:08 UTC) #8
reveman
https://codereview.chromium.org/1280513002/diff/20001/base/memory/generic_shared_memory_id.h File base/memory/generic_shared_memory_id.h (right): https://codereview.chromium.org/1280513002/diff/20001/base/memory/generic_shared_memory_id.h#newcode18 base/memory/generic_shared_memory_id.h:18: using GenericSharedMemoryId = int; On 2015/08/06 at 18:28:08, ericrk ...
5 years, 4 months ago (2015-08-06 19:19:36 UTC) #9
ericrk
https://codereview.chromium.org/1280513002/diff/80001/content/browser/gpu/browser_gpu_memory_buffer_manager.cc File content/browser/gpu/browser_gpu_memory_buffer_manager.cc (right): https://codereview.chromium.org/1280513002/diff/80001/content/browser/gpu/browser_gpu_memory_buffer_manager.cc#newcode239 content/browser/gpu/browser_gpu_memory_buffer_manager.cc:239: if (buffers.find(id) != buffers.end()) { On 2015/08/06 19:19:36, reveman ...
5 years, 4 months ago (2015-08-06 22:05:19 UTC) #11
piman
https://codereview.chromium.org/1280513002/diff/120001/content/browser/gpu/browser_gpu_memory_buffer_manager.cc File content/browser/gpu/browser_gpu_memory_buffer_manager.cc (right): https://codereview.chromium.org/1280513002/diff/120001/content/browser/gpu/browser_gpu_memory_buffer_manager.cc#newcode247 content/browser/gpu/browser_gpu_memory_buffer_manager.cc:247: buffers[id] = BufferInfo(size, gfx::SHARED_MEMORY_BUFFER, format, usage, 0); To avoid ...
5 years, 4 months ago (2015-08-06 23:29:12 UTC) #12
ericrk
https://codereview.chromium.org/1280513002/diff/120001/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h File content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h (left): https://codereview.chromium.org/1280513002/diff/120001/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h#oldcode45 content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h:45: On 2015/08/06 23:29:12, piman (Very slow to review) wrote: ...
5 years, 4 months ago (2015-08-10 16:58:29 UTC) #13
reveman
https://codereview.chromium.org/1280513002/diff/120001/ui/gfx/gpu_memory_buffer.h File ui/gfx/gpu_memory_buffer.h (left): https://codereview.chromium.org/1280513002/diff/120001/ui/gfx/gpu_memory_buffer.h#oldcode39 ui/gfx/gpu_memory_buffer.h:39: GpuMemoryBufferId buffer_id); Maybe keep this for single process mode ...
5 years, 4 months ago (2015-08-10 18:57:32 UTC) #14
ericrk
https://codereview.chromium.org/1280513002/diff/120001/content/browser/gpu/browser_gpu_memory_buffer_manager.cc File content/browser/gpu/browser_gpu_memory_buffer_manager.cc (right): https://codereview.chromium.org/1280513002/diff/120001/content/browser/gpu/browser_gpu_memory_buffer_manager.cc#newcode247 content/browser/gpu/browser_gpu_memory_buffer_manager.cc:247: buffers[id] = BufferInfo(size, gfx::SHARED_MEMORY_BUFFER, format, usage, 0); On 2015/08/06 ...
5 years, 4 months ago (2015-08-10 21:12:15 UTC) #16
reveman
https://codereview.chromium.org/1280513002/diff/120001/ui/gfx/gpu_memory_buffer.h File ui/gfx/gpu_memory_buffer.h (left): https://codereview.chromium.org/1280513002/diff/120001/ui/gfx/gpu_memory_buffer.h#oldcode39 ui/gfx/gpu_memory_buffer.h:39: GpuMemoryBufferId buffer_id); On 2015/08/10 at 21:12:14, ericrk wrote: > ...
5 years, 4 months ago (2015-08-10 22:16:14 UTC) #17
ericrk
Thanks for the feedback. https://codereview.chromium.org/1280513002/diff/120001/ui/gfx/gpu_memory_buffer.h File ui/gfx/gpu_memory_buffer.h (left): https://codereview.chromium.org/1280513002/diff/120001/ui/gfx/gpu_memory_buffer.h#oldcode39 ui/gfx/gpu_memory_buffer.h:39: GpuMemoryBufferId buffer_id); On 2015/08/10 22:16:13, ...
5 years, 4 months ago (2015-08-11 01:40:07 UTC) #24
reveman
lgtm
5 years, 4 months ago (2015-08-11 07:28:03 UTC) #25
ericrk
+sievers for content/ code. If there's someone more appropriate to review, please let me know ...
5 years, 4 months ago (2015-08-11 18:00:27 UTC) #28
reveman
+avi for content/
5 years, 4 months ago (2015-08-11 18:15:03 UTC) #30
Avi (use Gerrit)
lgtm https://codereview.chromium.org/1280513002/diff/310001/content/content_common.gypi File content/content_common.gypi (right): https://codereview.chromium.org/1280513002/diff/310001/content/content_common.gypi#newcode279 content/content_common.gypi:279: 'common/generic_shared_memory_id_generator.h', alphabetic
5 years, 4 months ago (2015-08-11 21:10:25 UTC) #31
no sievers
On 2015/08/11 18:00:27, ericrk wrote: > +sievers for content/ code. If there's someone more appropriate ...
5 years, 4 months ago (2015-08-11 21:34:57 UTC) #32
ericrk
thanks! https://codereview.chromium.org/1280513002/diff/310001/content/content_common.gypi File content/content_common.gypi (right): https://codereview.chromium.org/1280513002/diff/310001/content/content_common.gypi#newcode279 content/content_common.gypi:279: 'common/generic_shared_memory_id_generator.h', On 2015/08/11 21:10:24, Avi wrote: > alphabetic ...
5 years, 4 months ago (2015-08-11 21:36:36 UTC) #33
ericrk
Incorporates feedback from danakj: - base::GenericSharedMemoryId > gfx::GenericSharedMemoryTracingId - gfx::GenericSharedMemoryTracingId is a class to prevent ...
5 years, 4 months ago (2015-08-12 23:46:35 UTC) #36
danakj
Going to review the ui/gfx stuff but from earlier patch here's a few comments mostly ...
5 years, 4 months ago (2015-08-12 23:49:02 UTC) #37
danakj
ui/gfx LGTM https://codereview.chromium.org/1280513002/diff/390001/ui/gfx/generic_shared_memory_tracing_id.h File ui/gfx/generic_shared_memory_tracing_id.h (right): https://codereview.chromium.org/1280513002/diff/390001/ui/gfx/generic_shared_memory_tracing_id.h#newcode28 ui/gfx/generic_shared_memory_tracing_id.h:28: bool operator==(const GenericSharedMemoryTracingId& other) const { Can ...
5 years, 4 months ago (2015-08-13 00:05:11 UTC) #38
ericrk
Thanks for the feedback! +dalecurtis for media/renderers/mock_gpu_video_accelerator_factories.cc - should be a pretty non-interesting change to ...
5 years, 4 months ago (2015-08-13 00:13:56 UTC) #40
danakj
Thanks https://codereview.chromium.org/1280513002/diff/390001/ui/gfx/generic_shared_memory_tracing_id.h File ui/gfx/generic_shared_memory_tracing_id.h (right): https://codereview.chromium.org/1280513002/diff/390001/ui/gfx/generic_shared_memory_tracing_id.h#newcode28 ui/gfx/generic_shared_memory_tracing_id.h:28: bool operator==(const GenericSharedMemoryTracingId& other) const { On 2015/08/13 ...
5 years, 4 months ago (2015-08-13 00:25:06 UTC) #41
DaleCurtis
media/ lgtm
5 years, 4 months ago (2015-08-13 00:28:05 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1280513002/410001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1280513002/410001
5 years, 4 months ago (2015-08-13 00:35:40 UTC) #45
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/75069)
5 years, 4 months ago (2015-08-13 00:46:39 UTC) #47
reveman
https://codereview.chromium.org/1280513002/diff/410001/content/browser/gpu/browser_gpu_memory_buffer_manager.cc File content/browser/gpu/browser_gpu_memory_buffer_manager.cc (right): https://codereview.chromium.org/1280513002/diff/410001/content/browser/gpu/browser_gpu_memory_buffer_manager.cc#newcode513 content/browser/gpu/browser_gpu_memory_buffer_manager.cc:513: DLOG(ERROR) << "Child process attempted to allocate a GpuMemoryBuffer ...
5 years, 4 months ago (2015-08-13 08:24:44 UTC) #49
danakj
https://codereview.chromium.org/1280513002/diff/410001/ui/gfx/generic_shared_memory_tracing_id.h File ui/gfx/generic_shared_memory_tracing_id.h (right): https://codereview.chromium.org/1280513002/diff/410001/ui/gfx/generic_shared_memory_tracing_id.h#newcode11 ui/gfx/generic_shared_memory_tracing_id.h:11: namespace gfx { On 2015/08/13 08:24:44, reveman wrote: > ...
5 years, 4 months ago (2015-08-13 17:29:50 UTC) #50
reveman
https://codereview.chromium.org/1280513002/diff/410001/ui/gfx/generic_shared_memory_tracing_id.h File ui/gfx/generic_shared_memory_tracing_id.h (right): https://codereview.chromium.org/1280513002/diff/410001/ui/gfx/generic_shared_memory_tracing_id.h#newcode16 ui/gfx/generic_shared_memory_tracing_id.h:16: class GFX_EXPORT GenericSharedMemoryTracingId { On 2015/08/13 at 17:29:50, danakj ...
5 years, 4 months ago (2015-08-13 20:12:23 UTC) #51
danakj
https://codereview.chromium.org/1280513002/diff/410001/ui/gfx/gpu_memory_buffer.h File ui/gfx/gpu_memory_buffer.h (right): https://codereview.chromium.org/1280513002/diff/410001/ui/gfx/gpu_memory_buffer.h#newcode28 ui/gfx/gpu_memory_buffer.h:28: using GpuMemoryBufferId = gfx::GenericSharedMemoryTracingId; On 2015/08/13 20:12:23, reveman wrote: ...
5 years, 4 months ago (2015-08-13 20:30:37 UTC) #52
reveman
https://codereview.chromium.org/1280513002/diff/410001/ui/gfx/gpu_memory_buffer.h File ui/gfx/gpu_memory_buffer.h (right): https://codereview.chromium.org/1280513002/diff/410001/ui/gfx/gpu_memory_buffer.h#newcode28 ui/gfx/gpu_memory_buffer.h:28: using GpuMemoryBufferId = gfx::GenericSharedMemoryTracingId; On 2015/08/13 at 20:30:37, danakj ...
5 years, 4 months ago (2015-08-13 20:52:23 UTC) #53
danakj
https://codereview.chromium.org/1280513002/diff/410001/ui/gfx/generic_shared_memory_tracing_id.h File ui/gfx/generic_shared_memory_tracing_id.h (right): https://codereview.chromium.org/1280513002/diff/410001/ui/gfx/generic_shared_memory_tracing_id.h#newcode16 ui/gfx/generic_shared_memory_tracing_id.h:16: class GFX_EXPORT GenericSharedMemoryTracingId { On 2015/08/13 20:12:23, reveman wrote: ...
5 years, 4 months ago (2015-08-13 21:20:26 UTC) #54
ericrk
+cblume - FYI, this is the latest CL for memory infra tracking for GPU resources ...
5 years, 4 months ago (2015-08-13 23:21:55 UTC) #55
ericrk
On 2015/08/13 21:20:26, danakj wrote: > https://codereview.chromium.org/1280513002/diff/410001/ui/gfx/generic_shared_memory_tracing_id.h > File ui/gfx/generic_shared_memory_tracing_id.h (right): > > https://codereview.chromium.org/1280513002/diff/410001/ui/gfx/generic_shared_memory_tracing_id.h#newcode16 > ...
5 years, 4 months ago (2015-08-14 00:24:18 UTC) #56
reveman
lgtm after removing tracing from the name but you can keep the struct (maybe add ...
5 years, 4 months ago (2015-08-14 12:36:32 UTC) #57
danakj
On Fri, Aug 14, 2015 at 5:36 AM, <reveman@chromium.org> wrote: > lgtm after removing tracing ...
5 years, 4 months ago (2015-08-14 17:28:37 UTC) #58
ericrk
+erg for the changes components/view_manager. Changes are pretty much no-op, so should be straightforward. If ...
5 years, 4 months ago (2015-08-14 19:51:28 UTC) #60
ericrk
+sky for the changes components/view_manager. Changes are pretty much no-op, so should be straightforward. Thanks!
5 years, 4 months ago (2015-08-17 11:24:50 UTC) #63
ericrk
On 2015/08/17 11:24:50, ericrk wrote: > +sky for the changes components/view_manager. Changes are pretty much ...
5 years, 4 months ago (2015-08-17 13:13:27 UTC) #64
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1280513002/470001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1280513002/470001
5 years, 4 months ago (2015-08-17 13:13:44 UTC) #67
commit-bot: I haz the power
Committed patchset #12 (id:470001)
5 years, 4 months ago (2015-08-17 14:22:44 UTC) #68
commit-bot: I haz the power
Patchset 12 (id:??) landed as https://crrev.com/c9984ebe42daab4cd51fb928c32d7d1f4f14a9c7 Cr-Commit-Position: refs/heads/master@{#343677}
5 years, 4 months ago (2015-08-17 14:23:21 UTC) #69
sky
5 years, 4 months ago (2015-08-17 18:01:37 UTC) #70
Message was sent while issue was closed.
viewmanager LGTM

Powered by Google App Engine
This is Rietveld 408576698