Correctly serialize empty content_type for blobs.

A BlobDataHandle could not have a content_type set, but that should be
treated no different from an empty string, so serialize it as such.
Otherwise this will trigger validation failures causing weird behavior
when for example a blob without a content type is posted on a
MessagePort.

TBR=mek@chromium.org

(cherry picked from commit bb84d169288460af40536ebbe0303cb35f11a5a1)

Bug: 813146
Change-Id: I0a20a6b91391e9aa490a337b93c74f9ab4316e31
Reviewed-on: https://chromium-review.googlesource.com/924338
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#537462}
Reviewed-on: https://chromium-review.googlesource.com/927709
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/branch-heads/3325@{#520}
Cr-Branched-From: bc084a8b5afa3744a74927344e304c02ae54189f-refs/heads/master@{#530369}
diff --git a/third_party/WebKit/Source/core/messaging/BlinkCloneableMessageStructTraits.cpp b/third_party/WebKit/Source/core/messaging/BlinkCloneableMessageStructTraits.cpp
index a2e66e3..3744acc 100644
--- a/third_party/WebKit/Source/core/messaging/BlinkCloneableMessageStructTraits.cpp
+++ b/third_party/WebKit/Source/core/messaging/BlinkCloneableMessageStructTraits.cpp
@@ -15,8 +15,9 @@
   result.ReserveInitialCapacity(input.message->BlobDataHandles().size());
   for (const auto& blob : input.message->BlobDataHandles()) {
     result.push_back(blink::mojom::blink::SerializedBlob::New(
-        blob.value->Uuid(), blob.value->GetType(), blob.value->size(),
-        blob.value->CloneBlobPtr().PassInterface()));
+        blob.value->Uuid(),
+        blob.value->GetType().IsNull() ? g_empty_string : blob.value->GetType(),
+        blob.value->size(), blob.value->CloneBlobPtr().PassInterface()));
   }
   return result;
 }