| Index: printing/page_range.cc
|
| diff --git a/printing/page_range.cc b/printing/page_range.cc
|
| index 7a8cb84c84c70e58fdd8a23bef7fd31bad96adeb..ea2e30a38cbc262657e42209d10c1f9ab529c143 100644
|
| --- a/printing/page_range.cc
|
| +++ b/printing/page_range.cc
|
| @@ -5,18 +5,24 @@
|
| #include "printing/page_range.h"
|
|
|
| #include <set>
|
| -#include <vector>
|
| +
|
| +namespace {
|
| +const std::size_t kMaxNumberOfPages = 100000;
|
| +}
|
|
|
| namespace printing {
|
|
|
| /* static */
|
| std::vector<int> PageRange::GetPages(const PageRanges& ranges) {
|
| + // TODO(vitalybuka): crbug.com/95548 Remove this method as part fix.
|
| std::set<int> pages;
|
| for (unsigned i = 0; i < ranges.size(); ++i) {
|
| const PageRange& range = ranges[i];
|
| // Ranges are inclusive.
|
| for (int i = range.from; i <= range.to; ++i) {
|
| pages.insert(i);
|
| + if (pages.size() >= kMaxNumberOfPages)
|
| + return std::vector<int>(pages.begin(), pages.end());
|
| }
|
| }
|
| return std::vector<int>(pages.begin(), pages.end());
|
|
|