Commit 71783b53 authored by Marijn Kruisselbrink's avatar Marijn Kruisselbrink Committed by Commit Bot

[Blobs] Remove no longer used method that looked up blobs by UUID.

Bug: 740744
Change-Id: Ic22655d70695ca04ab30300293ecd24a92dab3ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1867295Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarDaniel Murphy <dmurph@chromium.org>
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708326}
parent 5e6837c4
...@@ -18,14 +18,12 @@ ...@@ -18,14 +18,12 @@
#include "base/supports_user_data.h" #include "base/supports_user_data.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "base/task_runner.h" #include "base/task_runner.h"
#include "content/browser/resource_context_impl.h"
#include "content/public/browser/blob_handle.h" #include "content/public/browser/blob_handle.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/common/content_features.h" #include "content/public/common/content_features.h"
#include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_receiver.h"
#include "services/network/public/cpp/resource_request_body.h"
#include "services/network/public/cpp/wrapper_shared_url_loader_factory.h" #include "services/network/public/cpp/wrapper_shared_url_loader_factory.h"
#include "storage/browser/blob/blob_data_builder.h" #include "storage/browser/blob/blob_data_builder.h"
#include "storage/browser/blob/blob_impl.h" #include "storage/browser/blob/blob_impl.h"
...@@ -264,28 +262,6 @@ storage::BlobStorageContext* GetBlobStorageContext( ...@@ -264,28 +262,6 @@ storage::BlobStorageContext* GetBlobStorageContext(
return blob_storage_context->context(); return blob_storage_context->context();
} }
bool GetBodyBlobDataHandles(network::ResourceRequestBody* body,
ResourceContext* resource_context,
BlobHandles* blob_handles) {
blob_handles->clear();
storage::BlobStorageContext* blob_context = GetBlobStorageContext(
GetChromeBlobStorageContextForResourceContext(resource_context));
DCHECK(blob_context);
for (size_t i = 0; i < body->elements()->size(); ++i) {
const network::DataElement& element = (*body->elements())[i];
if (element.type() != network::mojom::DataElementType::kBlob)
continue;
std::unique_ptr<storage::BlobDataHandle> handle =
blob_context->GetBlobDataFromUUID(element.blob_uuid());
if (!handle)
return false;
blob_handles->push_back(std::move(handle));
}
return true;
}
const char kBlobStorageContextKeyName[] = "content_blob_storage_context"; const char kBlobStorageContextKeyName[] = "content_blob_storage_context";
} // namespace content } // namespace content
...@@ -25,10 +25,6 @@ namespace base { ...@@ -25,10 +25,6 @@ namespace base {
class TaskRunner; class TaskRunner;
} }
namespace network {
class ResourceRequestBody;
}
namespace storage { namespace storage {
class BlobStorageContext; class BlobStorageContext;
} }
...@@ -36,7 +32,6 @@ class BlobStorageContext; ...@@ -36,7 +32,6 @@ class BlobStorageContext;
namespace content { namespace content {
class BlobHandle; class BlobHandle;
class BrowserContext; class BrowserContext;
class ResourceContext;
// A context class that keeps track of BlobStorageController used by the chrome. // A context class that keeps track of BlobStorageController used by the chrome.
// There is an instance associated with each BrowserContext. There could be // There is an instance associated with each BrowserContext. There could be
...@@ -109,15 +104,6 @@ class CONTENT_EXPORT ChromeBlobStorageContext ...@@ -109,15 +104,6 @@ class CONTENT_EXPORT ChromeBlobStorageContext
storage::BlobStorageContext* GetBlobStorageContext( storage::BlobStorageContext* GetBlobStorageContext(
ChromeBlobStorageContext* blob_storage_context); ChromeBlobStorageContext* blob_storage_context);
using BlobHandles = std::vector<std::unique_ptr<storage::BlobDataHandle>>;
// Attempts to create a vector of BlobDataHandles that ensure any blob data
// associated with |body| isn't cleaned up until the handles are destroyed.
// Returns false on failure. This is used for POST and PUT requests.
bool GetBodyBlobDataHandles(network::ResourceRequestBody* body,
ResourceContext* resource_context,
BlobHandles* blob_handles);
extern const char kBlobStorageContextKeyName[]; extern const char kBlobStorageContextKeyName[];
} // namespace content } // namespace content
......
...@@ -747,7 +747,6 @@ class NavigationURLLoaderImpl::URLLoaderRequestController ...@@ -747,7 +747,6 @@ class NavigationURLLoaderImpl::URLLoaderRequestController
if (should_clear_upload) { if (should_clear_upload) {
// The request body is no longer applicable. // The request body is no longer applicable.
resource_request_->request_body.reset(); resource_request_->request_body.reset();
blob_handles_.clear();
} }
resource_request_->url = redirect_info_.new_url; resource_request_->url = redirect_info_.new_url;
...@@ -1132,7 +1131,6 @@ class NavigationURLLoaderImpl::URLLoaderRequestController ...@@ -1132,7 +1131,6 @@ class NavigationURLLoaderImpl::URLLoaderRequestController
std::vector<std::string> url_loader_removed_headers_; std::vector<std::string> url_loader_removed_headers_;
net::HttpRequestHeaders url_loader_modified_headers_; net::HttpRequestHeaders url_loader_modified_headers_;
BlobHandles blob_handles_;
std::vector<GURL> url_chain_; std::vector<GURL> url_chain_;
// Current URL that is being navigated, updated after redirection. // Current URL that is being navigated, updated after redirection.
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/logging.h" #include "base/logging.h"
#include "content/browser/blob_storage/chrome_blob_storage_context.h"
#include "content/browser/webui/url_data_manager_backend.h" #include "content/browser/webui/url_data_manager_backend.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
...@@ -25,13 +24,6 @@ ResourceContext::ResourceContext() {} ...@@ -25,13 +24,6 @@ ResourceContext::ResourceContext() {}
ResourceContext::~ResourceContext() { ResourceContext::~ResourceContext() {
} }
ChromeBlobStorageContext* GetChromeBlobStorageContextForResourceContext(
const ResourceContext* resource_context) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
return UserDataAdapter<ChromeBlobStorageContext>::Get(
resource_context, kBlobStorageContextKeyName);
}
URLDataManagerBackend* GetURLDataManagerForResourceContext( URLDataManagerBackend* GetURLDataManagerForResourceContext(
ResourceContext* context) { ResourceContext* context) {
DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_CURRENTLY_ON(BrowserThread::IO);
...@@ -46,11 +38,6 @@ URLDataManagerBackend* GetURLDataManagerForResourceContext( ...@@ -46,11 +38,6 @@ URLDataManagerBackend* GetURLDataManagerForResourceContext(
void InitializeResourceContext(BrowserContext* browser_context) { void InitializeResourceContext(BrowserContext* browser_context) {
ResourceContext* resource_context = browser_context->GetResourceContext(); ResourceContext* resource_context = browser_context->GetResourceContext();
resource_context->SetUserData(
kBlobStorageContextKeyName,
std::make_unique<UserDataAdapter<ChromeBlobStorageContext>>(
ChromeBlobStorageContext::GetFor(browser_context)));
resource_context->DetachFromSequence(); resource_context->DetachFromSequence();
} }
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
namespace content { namespace content {
class ChromeBlobStorageContext;
class BrowserContext; class BrowserContext;
class URLDataManagerBackend; class URLDataManagerBackend;
...@@ -18,9 +17,6 @@ class URLDataManagerBackend; ...@@ -18,9 +17,6 @@ class URLDataManagerBackend;
// the IO thread. These are only accessed by content so they're not on the // the IO thread. These are only accessed by content so they're not on the
// public API. // public API.
ChromeBlobStorageContext* GetChromeBlobStorageContextForResourceContext(
const ResourceContext* resource_context);
URLDataManagerBackend* GetURLDataManagerForResourceContext( URLDataManagerBackend* GetURLDataManagerForResourceContext(
ResourceContext* context); ResourceContext* context);
......
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