Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3032)

Unified Diff: blimp/engine/mojo/blob_channel_service.cc

Issue 2517733002: Throw IPC errors on invalid Mojo BlobChannel messages. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/engine/mojo/blob_channel_service.cc
diff --git a/blimp/engine/mojo/blob_channel_service.cc b/blimp/engine/mojo/blob_channel_service.cc
index d3b93f70de125aeed64a460667c97e82f82cfed9..a603b12271349eb7b280c3802bdf5c95649a05aa 100644
--- a/blimp/engine/mojo/blob_channel_service.cc
+++ b/blimp/engine/mojo/blob_channel_service.cc
@@ -13,6 +13,7 @@
#include "base/task_runner_util.h"
#include "base/threading/thread.h"
#include "blimp/net/blob_channel/blob_channel_sender.h"
+#include "mojo/public/cpp/bindings/message.h"
#include "mojo/public/cpp/system/buffer.h"
namespace blimp {
@@ -73,12 +74,13 @@ void BlobChannelService::PutBlob(const std::string& id,
// Map |data| into the address space and copy out its contents.
if (!data.is_valid()) {
- LOG(ERROR) << "Invalid data handle received from renderer process.";
+ mojo::ReportBadMessage(
+ "Invalid data handle received from renderer process.");
return;
}
if (size > kMaxBlobSizeBytes) {
- LOG(ERROR) << "Blob size too big: " << size;
+ mojo::ReportBadMessage("Blob size too large.");
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698