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

Side by Side Diff: client/crash_report_database_win.cc

Issue 983103004: win: fixes for Windows x64 (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: mac Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | compat/win/sys/types.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 return; 383 return;
384 } 384 }
385 if (header.magic != kMetadataFileHeaderMagic || 385 if (header.magic != kMetadataFileHeaderMagic ||
386 header.version != kMetadataFileVersion) { 386 header.version != kMetadataFileVersion) {
387 LOG(ERROR) << "unexpected header"; 387 LOG(ERROR) << "unexpected header";
388 return; 388 return;
389 } 389 }
390 390
391 base::CheckedNumeric<uint32_t> records_size = 391 base::CheckedNumeric<uint32_t> records_size =
392 base::CheckedNumeric<uint32_t>(header.num_records) * 392 base::CheckedNumeric<uint32_t>(header.num_records) *
393 sizeof(MetadataFileReportRecord); 393 static_cast<uint32_t>(sizeof(MetadataFileReportRecord));
394 if (!records_size.IsValid()) { 394 if (!records_size.IsValid()) {
395 LOG(ERROR) << "record size out of range"; 395 LOG(ERROR) << "record size out of range";
396 return; 396 return;
397 } 397 }
398 398
399 std::vector<MetadataFileReportRecord> records(header.num_records); 399 std::vector<MetadataFileReportRecord> records(header.num_records);
400 if (!LoggingReadFile(handle_.get(), &records[0], records_size.ValueOrDie())) { 400 if (!LoggingReadFile(handle_.get(), &records[0], records_size.ValueOrDie())) {
401 LOG(ERROR) << "failed to read records"; 401 LOG(ERROR) << "failed to read records";
402 return; 402 return;
403 } 403 }
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 // static 728 // static
729 scoped_ptr<CrashReportDatabase> CrashReportDatabase::Initialize( 729 scoped_ptr<CrashReportDatabase> CrashReportDatabase::Initialize(
730 const base::FilePath& path) { 730 const base::FilePath& path) {
731 scoped_ptr<CrashReportDatabaseWin> database_win( 731 scoped_ptr<CrashReportDatabaseWin> database_win(
732 new CrashReportDatabaseWin(path.Append(kDatabaseDirectoryName))); 732 new CrashReportDatabaseWin(path.Append(kDatabaseDirectoryName)));
733 return database_win->Initialize() ? database_win.Pass() 733 return database_win->Initialize() ? database_win.Pass()
734 : scoped_ptr<CrashReportDatabaseWin>(); 734 : scoped_ptr<CrashReportDatabaseWin>();
735 } 735 }
736 736
737 } // namespace crashpad 737 } // namespace crashpad
OLDNEW
« no previous file with comments | « no previous file | compat/win/sys/types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698