Commit 10538620 authored by earthdok's avatar earthdok Committed by Commit bot

Annotate CaptureDumpPixels for MemorySanitizer.

The snapshot pixels come from shared memory, which is initialized in the GPU
process. MSan doesn't know what goes on in other processes, so we need to
explicitly mark the pixels as initialized to silence MSan warnings.

BUG=364724
TBR=piman@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/583703002

Cr-Commit-Position: refs/heads/master@{#295490}
parent b50a78b4
......@@ -10,6 +10,7 @@
#include "base/base64.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/debug/debugger.h"
#include "base/files/file_path.h"
#include "base/md5.h"
......@@ -666,6 +667,10 @@ void WebKitTestRunner::CaptureDumpPixels(const SkBitmap& snapshot) {
DCHECK_NE(0, snapshot.info().fHeight);
SkAutoLockPixels snapshot_lock(snapshot);
// The snapshot arrives from the GPU process via shared memory. Because MSan
// can't track initializedness across processes, we must assure it that the
// pixels are in fact initialized.
MSAN_UNPOISON(snapshot.getPixels(), snapshot.getSize());
base::MD5Digest digest;
base::MD5Sum(snapshot.getPixels(), snapshot.getSize(), &digest);
std::string actual_pixel_hash = base::MD5DigestToBase16(digest);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment