If Surface id_namespace can be generated on client side alone, then the Sync GetSurfaceId() function on OffscreenCanvasSurfaceService must be changed to async as well.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/05aa05390801f402c336ce2156014d7ef055e9ef commit 05aa05390801f402c336ce2156014d7ef055e9ef Author: xlai <xlai@chromium.org> Date: Sat Dec 17 22:56:36 2016 Revamp OffscreenCanvas commit flow This patch aims to simplify the existing work flow of OffscreenCanvas commit() and help OffscreenCanvas transition to the new Display Compositor architecture. This facilitates the next step of adding resizing functionality of OffscreenCanvas. Major changes: 1. OffscreenCanvas now use SurfaceIdAllocator in the renderer/worker, instead of being in the browser. This is consistent with the new display compositor architecture. 2. SurfaceLayer for HTMLCanvasElement is only created when Surface is created in the browser; before that, a dummy SolidColorLayer is put as a placeholder. 3. CanvasSurfaceLayerBridge becomes the client of OffscreenCanvasSurfaceImpl, so that it can receive IPC messages from browser. 4. FrameSinkId is now generated in renderer/main by CanvasSurfaceLayerBridge, which remains unchanged throughout the lifecycle of canvas; LocalFrameId is generated in renderer/worker by OffscreenCanvasFrameDispatcher. At this time it is only generated once, but will be generated repeatedly when resizing functionality is added in the future patches. What is being simplified: 1. Sync IPC GetSurfaceId is removed, reducing overhead in HTMLCanvasElement. transferControlToOffscreen() API call. 2. When OffscreenCanvas is transferred from main thread to worker thread, there are now only 2 integers that need to be copied, which constitute the FrameSinkId. Before this, there were 5 integers that need to be copied. As a result, there are a lot less attributes that need to be kept by OffscreenCanvas and CanvasSurfaceLayerBridge. TBR=avi@chromium.org BUG= 664547 , 619138 , 662498 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Review-Url: https://codereview.chromium.org/2584643002 Cr-Commit-Position: refs/heads/master@{#439356} [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/content/browser/BUILD.gn [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/content/browser/renderer_host/offscreen_canvas_compositor_frame_sink_provider_impl.cc [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/content/browser/renderer_host/offscreen_canvas_compositor_frame_sink_provider_impl.h [add] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/content/browser/renderer_host/offscreen_canvas_surface_factory_impl.cc [add] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/content/browser/renderer_host/offscreen_canvas_surface_factory_impl.h [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/content/browser/renderer_host/offscreen_canvas_surface_impl.cc [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/content/browser/renderer_host/offscreen_canvas_surface_impl.h [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/content/browser/renderer_host/offscreen_canvas_surface_manager.cc [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/content/browser/renderer_host/offscreen_canvas_surface_manager.h [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/content/browser/renderer_host/offscreen_canvas_surface_manager_unittest.cc [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/content/browser/renderer_host/render_process_host_impl.cc [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/content/public/app/mojo/content_browser_manifest.json [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueDeserializer.cpp [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializer.cpp [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/third_party/WebKit/Source/core/html/HTMLCanvasElement.h [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/third_party/WebKit/Source/modules/canvas/HTMLCanvasElementModule.cpp [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/third_party/WebKit/Source/platform/BUILD.gn [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.h [delete] https://crrev.com/facf9c3631846243635ca6c98805bb443ad982ca/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridgeTest.cpp [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.h [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/third_party/WebKit/public/blink_typemaps.gni [modify] https://crrev.com/05aa05390801f402c336ce2156014d7ef055e9ef/third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom
Sync IPC "GetSurfaceId" on offscreen_canvas_surface_service is now removed.
Comment 1 by xlai@chromium.org
, Jul 12 2016