Refactor ChromeSecurityExploitBrowserTest to work with mojo blobs.

This changes how this test creates blobs, so the tests work regardless
of the underlying blob IPC mechanism. Once blob URL management is also
migrated to mojo the tests for that will need to be rewritten to deal
with that, but this at least for now makes the test still meaningful
both with and without mojo blobs enabled.

Bug: 777585
Change-Id: Ic1bfdfc11251dce85aee4ad74e4f90546e7df164
Reviewed-on: https://chromium-review.googlesource.com/736168
Reviewed-by: Nick Carter <[email protected]>
Reviewed-by: Reilly Grant <[email protected]>
Commit-Queue: Marijn Kruisselbrink <[email protected]>
Cr-Commit-Position: refs/heads/master@{#511845}
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index 1e3eb64..fa8b0b7f1 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -310,17 +310,20 @@
 
 // static
 void BrowserContext::CreateMemoryBackedBlob(BrowserContext* browser_context,
-                                            const char* data, size_t length,
-                                            const BlobCallback& callback) {
+                                            const char* data,
+                                            size_t length,
+                                            const std::string& content_type,
+                                            BlobCallback callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
 
   ChromeBlobStorageContext* blob_context =
       ChromeBlobStorageContext::GetFor(browser_context);
   BrowserThread::PostTaskAndReplyWithResult(
       BrowserThread::IO, FROM_HERE,
-      base::Bind(&ChromeBlobStorageContext::CreateMemoryBackedBlob,
-                 base::WrapRefCounted(blob_context), data, length),
-      callback);
+      base::BindOnce(&ChromeBlobStorageContext::CreateMemoryBackedBlob,
+                     base::WrapRefCounted(blob_context), data, length,
+                     content_type),
+      std::move(callback));
 }
 
 // static
@@ -330,17 +333,17 @@
     int64_t offset,
     int64_t size,
     const base::Time& expected_modification_time,
-    const BlobCallback& callback) {
+    BlobCallback callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
 
   ChromeBlobStorageContext* blob_context =
       ChromeBlobStorageContext::GetFor(browser_context);
   BrowserThread::PostTaskAndReplyWithResult(
       BrowserThread::IO, FROM_HERE,
-      base::Bind(&ChromeBlobStorageContext::CreateFileBackedBlob,
-                 base::WrapRefCounted(blob_context), path, offset, size,
-                 expected_modification_time),
-      callback);
+      base::BindOnce(&ChromeBlobStorageContext::CreateFileBackedBlob,
+                     base::WrapRefCounted(blob_context), path, offset, size,
+                     expected_modification_time),
+      std::move(callback));
 }
 
 // static