Update broken references to image assets
[chromium-blink-merge.git] / printing / page_range.cc
blobea2e30a38cbc262657e42209d10c1f9ab529c143
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "printing/page_range.h"
7 #include <set>
9 namespace {
10 const std::size_t kMaxNumberOfPages = 100000;
13 namespace printing {
15 /* static */
16 std::vector<int> PageRange::GetPages(const PageRanges& ranges) {
17 // TODO(vitalybuka): crbug.com/95548 Remove this method as part fix.
18 std::set<int> pages;
19 for (unsigned i = 0; i < ranges.size(); ++i) {
20 const PageRange& range = ranges[i];
21 // Ranges are inclusive.
22 for (int i = range.from; i <= range.to; ++i) {
23 pages.insert(i);
24 if (pages.size() >= kMaxNumberOfPages)
25 return std::vector<int>(pages.begin(), pages.end());
28 return std::vector<int>(pages.begin(), pages.end());
31 } // namespace printing