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

Unified Diff: content/browser/renderer_host/offscreen_canvas_provider_impl.cc

Issue 2811413002: Add check for renderer client id. (Closed)
Patch Set: Rebase. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/offscreen_canvas_provider_impl.cc
diff --git a/content/browser/renderer_host/offscreen_canvas_provider_impl.cc b/content/browser/renderer_host/offscreen_canvas_provider_impl.cc
index 9d578ada2b519faf90d8e4ee2fddee75b94e9e80..65e05c1c502159399503067c5f6dc783e2e3a7f2 100644
--- a/content/browser/renderer_host/offscreen_canvas_provider_impl.cc
+++ b/content/browser/renderer_host/offscreen_canvas_provider_impl.cc
@@ -10,7 +10,9 @@
namespace content {
-OffscreenCanvasProviderImpl::OffscreenCanvasProviderImpl() = default;
+OffscreenCanvasProviderImpl::OffscreenCanvasProviderImpl(
+ uint32_t renderer_client_id)
+ : renderer_client_id_(renderer_client_id) {}
OffscreenCanvasProviderImpl::~OffscreenCanvasProviderImpl() = default;
@@ -24,6 +26,10 @@ void OffscreenCanvasProviderImpl::CreateOffscreenCanvasSurface(
const cc::FrameSinkId& frame_sink_id,
cc::mojom::FrameSinkManagerClientPtr client,
blink::mojom::OffscreenCanvasSurfaceRequest request) {
+ // TODO(kylechar): Kill the renderer instead of crashing chrome.
+ CHECK_EQ(parent_frame_sink_id.client_id(), renderer_client_id_);
+ CHECK_EQ(frame_sink_id.client_id(), renderer_client_id_);
piman 2017/04/12 22:53:37 Can we just return early / do nothing (and DLOG et
kylechar 2017/04/13 17:09:18 Done.
+
OffscreenCanvasSurfaceImpl::Create(parent_frame_sink_id, frame_sink_id,
std::move(client), std::move(request));
}
@@ -32,6 +38,9 @@ void OffscreenCanvasProviderImpl::CreateCompositorFrameSink(
const cc::FrameSinkId& frame_sink_id,
cc::mojom::MojoCompositorFrameSinkClientPtr client,
cc::mojom::MojoCompositorFrameSinkRequest request) {
+ // TODO(kylechar): Kill the renderer instead of crashing chrome.
+ CHECK_EQ(frame_sink_id.client_id(), renderer_client_id_);
piman 2017/04/12 22:53:37 ditto.
kylechar 2017/04/13 17:09:18 Done.
+
// TODO(kylechar): Add test for bad |frame_sink_id|.
auto* manager = OffscreenCanvasCompositorFrameSinkManager::GetInstance();
auto* surface_impl = manager->GetSurfaceInstance(frame_sink_id);

Powered by Google App Engine
This is Rietveld 408576698