Commit d484d41c authored by qinmin's avatar qinmin Committed by Commit bot

Speculative fix when translating blob data to a file path

Accoding to the stack on crbug.com/410602, BlobData can be null.
However, I am not able to reproduce the bug with any test cases.
So this is just a safe speculative fix.

BUG=410602

Review URL: https://codereview.chromium.org/601043003

Cr-Commit-Position: refs/heads/master@{#297007}
parent cdb492db
...@@ -51,7 +51,13 @@ static void RequestPlatformPathFromBlobURL( ...@@ -51,7 +51,13 @@ static void RequestPlatformPathFromBlobURL(
ChromeBlobStorageContext::GetFor(browser_context); ChromeBlobStorageContext::GetFor(browser_context);
scoped_ptr<storage::BlobDataHandle> handle = scoped_ptr<storage::BlobDataHandle> handle =
context->context()->GetBlobDataFromPublicURL(url); context->context()->GetBlobDataFromPublicURL(url);
const std::vector<storage::BlobData::Item> items = handle->data()->items(); storage::BlobData* data = handle->data();
if (!data) {
ReturnResultOnUIThread(callback, "");
NOTREACHED();
return;
}
const std::vector<storage::BlobData::Item> items = data->items();
// TODO(qinmin): handle the case when the blob data is not a single file. // TODO(qinmin): handle the case when the blob data is not a single file.
DLOG_IF(WARNING, items.size() != 1u) DLOG_IF(WARNING, items.size() != 1u)
......
...@@ -263,6 +263,11 @@ void MediaPlayerBridge::OnAuthCredentialsRetrieved( ...@@ -263,6 +263,11 @@ void MediaPlayerBridge::OnAuthCredentialsRetrieved(
} }
void MediaPlayerBridge::ExtractMediaMetadata(const std::string& url) { void MediaPlayerBridge::ExtractMediaMetadata(const std::string& url) {
if (url.empty()) {
OnMediaError(MEDIA_ERROR_FORMAT);
return;
}
int fd; int fd;
int64 offset; int64 offset;
int64 size; int64 size;
......
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