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

Unified Diff: content/shell/renderer/webkit_test_runner.cc

Issue 583703002: Annotate CaptureDumpPixels for MemorySanitizer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/webkit_test_runner.cc
diff --git a/content/shell/renderer/webkit_test_runner.cc b/content/shell/renderer/webkit_test_runner.cc
index 2a7a00ee972f646915cf3d9c3f8eb57498025197..b06b4c32ffdc48529230d66dfd0fffcf307a3564 100644
--- a/content/shell/renderer/webkit_test_runner.cc
+++ b/content/shell/renderer/webkit_test_runner.cc
@@ -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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698