Index: webkit/browser/blob/blob_url_request_job.cc |
diff --git a/webkit/browser/blob/blob_url_request_job.cc b/webkit/browser/blob/blob_url_request_job.cc |
index 9eb196ad40181c50ed19ad9dbf600205e1200b15..2cd201385a72ee950d46f15d79095efc13fa8f96 100644 |
--- a/webkit/browser/blob/blob_url_request_job.cc |
+++ b/webkit/browser/blob/blob_url_request_job.cc |
@@ -4,7 +4,10 @@ |
#include "webkit/browser/blob/blob_url_request_job.h" |
+#include <algorithm> |
#include <limits> |
+#include <string> |
+#include <vector> |
hashimoto
2014/09/05 03:17:27
nit: Are these include needed?
mtomasz
2014/09/05 05:31:42
algorithm for std::min.
string for std::string.
ve
|
#include "base/basictypes.h" |
#include "base/bind.h" |
@@ -13,6 +16,7 @@ |
#include "base/format_macros.h" |
#include "base/message_loop/message_loop.h" |
#include "base/message_loop/message_loop_proxy.h" |
+#include "base/numerics/safe_conversions.h" |
#include "base/stl_util.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/stringprintf.h" |
@@ -223,8 +227,8 @@ void BlobURLRequestJob::DidCountSize(int error) { |
return; |
} |
- remaining_bytes_ = byte_range_.last_byte_position() - |
- byte_range_.first_byte_position() + 1; |
+ remaining_bytes_ = base::checked_cast<int64>( |
+ byte_range_.last_byte_position() - byte_range_.first_byte_position() + 1); |
DCHECK_GE(remaining_bytes_, 0); |
// Do the seek at the beginning of the request. |
@@ -577,6 +581,7 @@ void BlobURLRequestJob::CreateFileStreamReader(size_t index, |
file_system_context_->CrackURL( |
item.filesystem_url())), |
item.offset() + additional_offset, |
+ item.length() - additional_offset, |
hashimoto
2014/09/05 03:17:27
Shouldn't item_length_list_ be used here?
mtomasz
2014/09/05 05:31:42
While filling out item_length_list_, file stream r
|
item.expected_modification_time()) |
.release(); |
break; |