Skip to content

Commit

Permalink
Allow Blink to generate cc::FrameSinkId from RenderThread
Browse files Browse the repository at this point in the history
This CL allows Blink to use generate cc::FrameSinkId, internally
implemented using RenderThread's functions.

Currently, Mus is working on making FrameSinkId being able to
generated on Renderer process, getting rid of the need of IPC
to browser just to get a FrameSinkId.

By making this generation function available in Blink, this CL
prepares for a refactoring effort on the current
OffscreenCanvas.commit() workflow--it would facilitate
simplification on CanvasSurfaceLayerBridge
that will remove the current sync IPC that relies on the
browser process to generate  FrameSinkId (which is part of
SurfaceId) for it.

BUG=664547

Review-Url: https://codereview.chromium.org/2514323006
Cr-Commit-Position: refs/heads/master@{#434535}
  • Loading branch information
xlai-o authored and Commit bot committed Nov 25, 2016
1 parent a0eb8ed commit 2956c33
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions content/renderer/renderer_blink_platform_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,11 @@ WebString RendererBlinkPlatformImpl::databaseCreateOriginIdentifier(
WebSecurityOriginToGURL(origin)));
}

cc::FrameSinkId RendererBlinkPlatformImpl::generateFrameSinkId() {
return cc::FrameSinkId(RenderThread::Get()->GetClientId(),
RenderThread::Get()->GenerateRoutingID());
}

bool RendererBlinkPlatformImpl::isThreadedCompositingEnabled() {
RenderThreadImpl* thread = RenderThreadImpl::current();
// thread can be NULL in tests.
Expand Down
1 change: 1 addition & 0 deletions content/renderer/renderer_blink_platform_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
long long size) override;
blink::WebString databaseCreateOriginIdentifier(
const blink::WebSecurityOrigin& origin) override;
cc::FrameSinkId generateFrameSinkId() override;

blink::WebString signedPublicKeyAndChallengeString(
unsigned key_size_index,
Expand Down
4 changes: 4 additions & 0 deletions third_party/WebKit/public/platform/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include "WebVector.h"
#include "base/metrics/user_metrics_action.h"
#include "cc/resources/shared_bitmap.h"
#include "cc/surfaces/frame_sink_id.h"

class GrContext;

Expand Down Expand Up @@ -321,6 +322,9 @@ class BLINK_PLATFORM_EXPORT Platform {
// the process's process ID.
virtual uint32_t getUniqueIdForProcess() { return 0; }

// Returns a unique FrameSinkID for the current renderer process
virtual cc::FrameSinkId generateFrameSinkId() { return cc::FrameSinkId(); }

// Message Ports -------------------------------------------------------

// Creates a Message Port Channel pair. This can be called on any thread.
Expand Down

0 comments on commit 2956c33

Please sign in to comment.