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

Unified Diff: content/browser/blob_storage/chrome_blob_storage_context.cc

Issue 2960023002: Remove SupportsUserData from ResourceRequestBodyImpl. (Closed)
Patch Set: Switch to BlobHandles*, fix two comments Created 3 years, 6 months 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
Index: content/browser/blob_storage/chrome_blob_storage_context.cc
diff --git a/content/browser/blob_storage/chrome_blob_storage_context.cc b/content/browser/blob_storage/chrome_blob_storage_context.cc
index 28734c2b4f99256f455f89376bd54f37bceabd71..5c5904df0b11034510efeba99559283d2d768241 100644
--- a/content/browser/blob_storage/chrome_blob_storage_context.cc
+++ b/content/browser/blob_storage/chrome_blob_storage_context.cc
@@ -14,6 +14,7 @@
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h"
+#include "base/supports_user_data.h"
#include "base/task_runner.h"
#include "base/task_scheduler/post_task.h"
#include "content/browser/resource_context_impl.h"
@@ -22,7 +23,6 @@
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "storage/browser/blob/blob_data_builder.h"
-#include "storage/browser/blob/blob_data_handle.h"
#include "storage/browser/blob/blob_memory_controller.h"
#include "storage/browser/blob/blob_storage_context.h"
@@ -197,8 +197,11 @@ storage::BlobStorageContext* GetBlobStorageContext(
return blob_storage_context->context();
}
-bool AttachRequestBodyBlobDataHandles(ResourceRequestBodyImpl* body,
- ResourceContext* resource_context) {
+bool GetBodyBlobDataHandles(ResourceRequestBodyImpl* body,
+ ResourceContext* resource_context,
+ BlobHandles* blob_handles) {
+ blob_handles->clear();
+
storage::BlobStorageContext* blob_context = GetBlobStorageContext(
GetChromeBlobStorageContextForResourceContext(resource_context));
@@ -211,10 +214,7 @@ bool AttachRequestBodyBlobDataHandles(ResourceRequestBodyImpl* body,
blob_context->GetBlobDataFromUUID(element.blob_uuid());
if (!handle)
return false;
- // Ensure the blob and any attached shareable files survive until
- // upload completion. The |body| takes ownership of |handle|.
- const void* key = handle.get();
- body->SetUserData(key, std::move(handle));
+ blob_handles->push_back(std::move(handle));
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698