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

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

Issue 221523003: cc: Remove all usage of GetArea() from production code in cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: getarea: Created 6 years, 9 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/software_frame_manager.cc
diff --git a/content/browser/renderer_host/software_frame_manager.cc b/content/browser/renderer_host/software_frame_manager.cc
index 3630e59c05f8974126a4f6bbe51b4be6c88ca718..5a4794c66e9aa5057ee3189369446129ae72c22e 100644
--- a/content/browser/renderer_host/software_frame_manager.cc
+++ b/content/browser/renderer_host/software_frame_manager.cc
@@ -8,6 +8,7 @@
#include "base/callback_helpers.h"
#include "base/debug/alias.h"
#include "base/numerics/safe_math.h"
+#include "cc/resources/shared_bitmap.h"
#include "content/browser/renderer_host/dip_util.h"
#include "content/public/browser/user_metrics.h"
@@ -97,9 +98,11 @@ bool SoftwareFrameManager::SwapToNewFrame(
// The NULL handle is used in testing.
if (base::SharedMemory::IsHandleValid(shared_memory->handle())) {
- DCHECK(frame_data->CheckedSizeInBytes().IsValid())
- << "Integer overflow when computing bytes to map.";
- size_t size_in_bytes = frame_data->SizeInBytes();
+ DCHECK(cc::SharedBitmap::VerifySizeInBytes(frame_data->size));
+ // UncheckedSizeInBytes is okay because the frame_data size was verified
+ // frame_data was received over IPC.
piman 2014/04/03 21:41:20 nit: missing 'when'?
danakj 2014/04/03 21:43:48 2014/04/03 21:41:20, piman wrote:
+ size_t size_in_bytes =
+ cc::SharedBitmap::UncheckedSizeInBytes(frame_data->size);
#ifdef OS_WIN
if (!shared_memory->Map(0)) {
DLOG(ERROR) << "Unable to map renderer memory.";

Powered by Google App Engine
This is Rietveld 408576698