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

Side by Side 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: Fixing a merge error. Created 4 years, 10 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 | « no previous file | 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 (c) 2006, Google Inc. 1 // Copyright (c) 2006, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 false); 135 false);
136 CFReadStreamRef read_stream = CFReadStreamCreateWithFile(NULL, sys_vers); 136 CFReadStreamRef read_stream = CFReadStreamCreateWithFile(NULL, sys_vers);
137 CFRelease(sys_vers); 137 CFRelease(sys_vers);
138 if (!read_stream) { 138 if (!read_stream) {
139 return; 139 return;
140 } 140 }
141 if (!CFReadStreamOpen(read_stream)) { 141 if (!CFReadStreamOpen(read_stream)) {
142 CFRelease(read_stream); 142 CFRelease(read_stream);
143 return; 143 return;
144 } 144 }
145 CFDataRef data = NULL; 145 // Actual data file tests: Mac at 480 bytes and iOS at 413 bytes.
146 CFIndex num_bytes_read = 0; 146 const CFIndex kMaxBufferLength = 1024;
Mark Mentovai 2016/02/01 01:03:36 You can move these two inside the loop.
ivanpe 2016/02/01 02:05:20 Done.
147 const UInt8 *data_bytes = 147 UInt8 data_bytes[kMaxBufferLength];
148 CFReadStreamGetBuffer(read_stream, 0, &num_bytes_read); 148 CFMutableDataRef data = NULL;
149 if (data_bytes) { 149 while (true) {
150 data = CFDataCreate(NULL, data_bytes, num_bytes_read); 150 CFIndex num_bytes_read =
151 CFReadStreamRead(read_stream, data_bytes, kMaxBufferLength);
152 if (num_bytes_read < 0) {
153 if (data) {
154 CFRelease(data);
155 data = NULL;
156 }
157 break;
158 } else if (num_bytes_read == 0) {
159 break;
160 } else if (!data) {
161 data = CFDataCreateMutable(NULL, 0);
162 }
163 CFDataAppendBytes(data, data_bytes, num_bytes_read);
151 } 164 }
152 CFReadStreamClose(read_stream); 165 CFReadStreamClose(read_stream);
153 CFRelease(read_stream); 166 CFRelease(read_stream);
154 if (!data) { 167 if (!data) {
155 return; 168 return;
156 } 169 }
157 CFDictionaryRef list = static_cast<CFDictionaryRef> 170 CFDictionaryRef list = static_cast<CFDictionaryRef>
158 (CFPropertyListCreateFromXMLData(NULL, data, kCFPropertyListImmutable, 171 (CFPropertyListCreateFromXMLData(NULL, data, kCFPropertyListImmutable,
159 NULL)); 172 NULL));
160 CFRelease(data); 173 CFRelease(data);
(...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 } else { 1595 } else {
1583 info_ptr->validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID; 1596 info_ptr->validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID;
1584 info_ptr->dump_thread_id = handler_thread_; 1597 info_ptr->dump_thread_id = handler_thread_;
1585 info_ptr->requesting_thread_id = 0; 1598 info_ptr->requesting_thread_id = 0;
1586 } 1599 }
1587 1600
1588 return true; 1601 return true;
1589 } 1602 }
1590 1603
1591 } // namespace google_breakpad 1604 } // namespace google_breakpad
OLDNEW
« 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