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

Side by Side Diff: pdf/chunk_stream.cc

Issue 1533413002: Switch to standard integer types in pdf/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix 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
« no previous file with comments | « no previous file | pdf/document_loader.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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "pdf/chunk_stream.h" 5 #include "pdf/chunk_stream.h"
6 6
7 #include <stddef.h>
8 #include <string.h>
9
7 #define __STDC_LIMIT_MACROS 10 #define __STDC_LIMIT_MACROS
8 #ifdef _WIN32 11 #ifdef _WIN32
9 #include <limits.h> 12 #include <limits.h>
10 #else 13 #else
11 #include <stdint.h> 14 #include <stdint.h>
12 #endif 15 #endif
13 16
14 #include <algorithm> 17 #include <algorithm>
15 18
16 #include "base/basictypes.h"
17
18 namespace chrome_pdf { 19 namespace chrome_pdf {
19 20
20 ChunkStream::ChunkStream() : stream_size_(0) { 21 ChunkStream::ChunkStream() : stream_size_(0) {
21 } 22 }
22 23
23 ChunkStream::~ChunkStream() { 24 ChunkStream::~ChunkStream() {
24 } 25 }
25 26
26 void ChunkStream::Clear() { 27 void ChunkStream::Clear() {
27 chunks_.clear(); 28 chunks_.clear();
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 size_t ChunkStream::GetLastMissingByteInInterval(size_t offset) const { 166 size_t ChunkStream::GetLastMissingByteInInterval(size_t offset) const {
166 if (chunks_.empty()) 167 if (chunks_.empty())
167 return stream_size_ - 1; 168 return stream_size_ - 1;
168 std::map<size_t, size_t>::const_iterator it = chunks_.upper_bound(offset); 169 std::map<size_t, size_t>::const_iterator it = chunks_.upper_bound(offset);
169 if (it == chunks_.end()) 170 if (it == chunks_.end())
170 return stream_size_ - 1; 171 return stream_size_ - 1;
171 return it->first - 1; 172 return it->first - 1;
172 } 173 }
173 174
174 } // namespace chrome_pdf 175 } // namespace chrome_pdf
OLDNEW
« no previous file with comments | « no previous file | pdf/document_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698