Commit ffc90f42 authored by Wez's avatar Wez Committed by Commit Bot

Copy some diagnostic values to the stack and alias them.

Temporarily add some values to minidumps, to help diagnose BlobReader
crash reports.

Bug: 864351
Change-Id: I70a8b36e83fdb1c43f698d83aaf6b712da6a9264
Reviewed-on: https://chromium-review.googlesource.com/1185906Reviewed-by: default avatarMarijn Kruisselbrink <mek@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585337}
parent bd9bf688
......@@ -14,6 +14,7 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/debug/alias.h"
#include "base/memory/ptr_util.h"
#include "base/task/post_task.h"
#include "base/time/time.h"
......@@ -481,7 +482,21 @@ BlobReader::Status BlobReader::ReadItem() {
// Do the reading.
const BlobDataItem& item = *items.at(current_item_index_);
// TODO(https://crbug.com/864351): Temporary diagnostics.
uint64_t item_offset = item.offset();
base::debug::Alias(&item_offset);
uint64_t item_length = item.length();
base::debug::Alias(&item_length);
int buf_bytes_remaining = read_buf_->BytesRemaining();
base::debug::Alias(&buf_bytes_remaining);
base::debug::Alias(&bytes_to_read);
if (item.type() == BlobDataItem::Type::kBytes) {
// TODO(https://crbug.com/864351): Temporary diagnostics.
const char* item_bytes = item.bytes().data();
base::debug::Alias(&item_bytes);
ReadBytesItem(item, bytes_to_read);
return Status::DONE;
}
......
......@@ -4,6 +4,7 @@
#include "storage/browser/blob/mojo_blob_reader.h"
#include "base/debug/alias.h"
#include "base/trace_event/trace_event.h"
#include "net/base/io_buffer.h"
#include "services/network/public/cpp/net_adapters.h"
......@@ -99,17 +100,28 @@ void MojoBlobReader::DidCalculateSize(int result) {
TRACE_EVENT_ASYNC_END2("Blob", "BlobReader::CountSize", this, "result",
"success", "size", blob_reader_->total_size());
// TODO(https://crbug.com/864351): Temporary diagnostics.
net::HttpByteRange pre_bounds_range = byte_range_;
base::debug::Alias(&pre_bounds_range);
// Apply the range requirement.
if (!byte_range_.ComputeBounds(blob_reader_->total_size())) {
NotifyCompletedAndDeleteIfNeeded(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE);
return;
}
// TODO(https://crbug.com/864351): Temporary diagnostics.
net::HttpByteRange post_bounds_range = byte_range_;
base::debug::Alias(&post_bounds_range);
DCHECK_LE(byte_range_.first_byte_position(),
byte_range_.last_byte_position() + 1);
uint64_t length = base::checked_cast<uint64_t>(
byte_range_.last_byte_position() - byte_range_.first_byte_position() + 1);
// TODO(https://crbug.com/864351): Temporary diagnostics.
base::debug::Alias(&length);
if (blob_reader_->SetReadRange(byte_range_.first_byte_position(), length) !=
BlobReader::Status::DONE) {
NotifyCompletedAndDeleteIfNeeded(blob_reader_->net_error());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment