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

Unified Diff: src/client/mac/handler/minidump_generator.cc

Issue 1637433003: Remove use of deprecated CFURLCreateDataAndPropertiesFromResource function. (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: Created 4 years, 11 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: src/client/mac/handler/minidump_generator.cc
diff --git a/src/client/mac/handler/minidump_generator.cc b/src/client/mac/handler/minidump_generator.cc
index 7d6e81dbb86439110b3106fffe9f31b7f2c70350..7a2b999c8382a55cf1aa63979d8004e59dc1195c 100644
--- a/src/client/mac/handler/minidump_generator.cc
+++ b/src/client/mac/handler/minidump_generator.cc
@@ -142,11 +142,14 @@ void MinidumpGenerator::GatherSystemInformation() {
CFRelease(read_stream);
return;
}
+ // Actual data file tests: Mac at 480 bytes and iOS at 413 bytes,
+ // so setting max length comfortably higher.
+ const CFIndex kMaxBufferLength = 2048;
+ UInt8 data_bytes[kMaxBufferLength];
+ CFIndex num_bytes_read =
+ CFReadStreamRead(read_stream, data_bytes, kMaxBufferLength);
CFDataRef data = NULL;
- CFIndex num_bytes_read = 0;
- const UInt8 *data_bytes =
- CFReadStreamGetBuffer(read_stream, 0, &num_bytes_read);
- if (data_bytes) {
+ if (num_bytes_read > 0) {
Mark Mentovai 2016/01/26 14:08:50 If num_bytes_read == kMaxBufferLength, there may h
ivanpe 2016/01/27 18:35:42 Mark, Scott addressed your comment. Can you pleas
data = CFDataCreate(NULL, data_bytes, num_bytes_read);
}
CFReadStreamClose(read_stream);
« 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