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

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2811413002: Add check for renderer client id. (Closed)
Patch Set: Fix comment. 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 unified diff | Download patch
« no previous file with comments | « content/browser/renderer_host/offscreen_canvas_provider_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Represents the browser side of the browser <--> renderer communication 5 // Represents the browser side of the browser <--> renderer communication
6 // channel. There will be one RenderProcessHost per renderer process. 6 // channel. There will be one RenderProcessHost per renderer process.
7 7
8 #include "content/browser/renderer_host/render_process_host_impl.h" 8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1356 DCHECK_CURRENTLY_ON(BrowserThread::IO); 1356 DCHECK_CURRENTLY_ON(BrowserThread::IO);
1357 if (!gpu_client_) 1357 if (!gpu_client_)
1358 gpu_client_.reset(new GpuClient(GetID())); 1358 gpu_client_.reset(new GpuClient(GetID()));
1359 gpu_client_->Add(std::move(request)); 1359 gpu_client_->Add(std::move(request));
1360 } 1360 }
1361 1361
1362 void RenderProcessHostImpl::CreateOffscreenCanvasProvider( 1362 void RenderProcessHostImpl::CreateOffscreenCanvasProvider(
1363 blink::mojom::OffscreenCanvasProviderRequest request) { 1363 blink::mojom::OffscreenCanvasProviderRequest request) {
1364 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1364 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1365 if (!offscreen_canvas_provider_) { 1365 if (!offscreen_canvas_provider_) {
1366 // The client id gets converted to a uint32_t in FrameSinkId.
1367 uint32_t renderer_client_id = base::checked_cast<uint32_t>(id_);
1366 offscreen_canvas_provider_ = 1368 offscreen_canvas_provider_ =
1367 base::MakeUnique<OffscreenCanvasProviderImpl>(); 1369 base::MakeUnique<OffscreenCanvasProviderImpl>(renderer_client_id);
1368 } 1370 }
1369 offscreen_canvas_provider_->Add(std::move(request)); 1371 offscreen_canvas_provider_->Add(std::move(request));
1370 } 1372 }
1371 1373
1372 void RenderProcessHostImpl::BindFrameSinkProvider( 1374 void RenderProcessHostImpl::BindFrameSinkProvider(
1373 mojom::FrameSinkProviderRequest request) { 1375 mojom::FrameSinkProviderRequest request) {
1374 frame_sink_provider_.Bind(std::move(request)); 1376 frame_sink_provider_.Bind(std::move(request));
1375 } 1377 }
1376 1378
1377 void RenderProcessHostImpl::CreateStoragePartitionService( 1379 void RenderProcessHostImpl::CreateStoragePartitionService(
(...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after
3083 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3085 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3084 3086
3085 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3087 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3086 // Capture the error message in a crash key value. 3088 // Capture the error message in a crash key value.
3087 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3089 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3088 bad_message::ReceivedBadMessage(render_process_id, 3090 bad_message::ReceivedBadMessage(render_process_id,
3089 bad_message::RPH_MOJO_PROCESS_ERROR); 3091 bad_message::RPH_MOJO_PROCESS_ERROR);
3090 } 3092 }
3091 3093
3092 } // namespace content 3094 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/offscreen_canvas_provider_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698