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

Side by Side Diff: chrome/common/safe_browsing/pe_image_reader_win.cc

Issue 1548153002: Switch to standard integer types in chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/safe_browsing/pe_image_reader_win.h" 5 #include "chrome/common/safe_browsing/pe_image_reader_win.h"
6 6
7 #include <wintrust.h> 7 #include <wintrust.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h"
10 11
11 namespace safe_browsing { 12 namespace safe_browsing {
12 13
13 // A class template of traits pertaining to IMAGE_OPTIONAL_HEADER{32,64}. 14 // A class template of traits pertaining to IMAGE_OPTIONAL_HEADER{32,64}.
14 template<class HEADER_TYPE> 15 template<class HEADER_TYPE>
15 struct OptionalHeaderTraits { 16 struct OptionalHeaderTraits {
16 }; 17 };
17 18
18 template<> 19 template<>
19 struct OptionalHeaderTraits<IMAGE_OPTIONAL_HEADER32> { 20 struct OptionalHeaderTraits<IMAGE_OPTIONAL_HEADER32> {
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 if (data_offset >= header->SizeOfRawData || 369 if (data_offset >= header->SizeOfRawData ||
369 header->SizeOfRawData - data_offset < entry->Size) { 370 header->SizeOfRawData - data_offset < entry->Size) {
370 return NULL; 371 return NULL;
371 } 372 }
372 373
373 *data_length = entry->Size; 374 *data_length = entry->Size;
374 return image_data_ + header->PointerToRawData + data_offset; 375 return image_data_ + header->PointerToRawData + data_offset;
375 } 376 }
376 377
377 } // namespace safe_browsing 378 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/common/safe_browsing/pe_image_reader_win.h ('k') | chrome/common/safe_browsing/pe_image_reader_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698