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

Unified Diff: content/browser/loader/mojo_async_resource_handler.cc

Issue 2658583002: Revert of Use associated interface on DownloadedTempFile (Closed)
Patch Set: Rebased. Created 3 years, 11 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/loader/mojo_async_resource_handler.cc
diff --git a/content/browser/loader/mojo_async_resource_handler.cc b/content/browser/loader/mojo_async_resource_handler.cc
index c2070cdb6b9ddac81f96e656c381eb4382bd423b..6b1f93b10f42c29fffba5400110b0175ea814e95 100644
--- a/content/browser/loader/mojo_async_resource_handler.cc
+++ b/content/browser/loader/mojo_async_resource_handler.cc
@@ -8,7 +8,6 @@
#include <utility>
#include <vector>
-#include "base/bind.h"
#include "base/command_line.h"
#include "base/location.h"
#include "base/logging.h"
@@ -60,11 +59,6 @@ void InitializeResourceBufferConstants() {
GetNumericArg("resource-buffer-size", &g_allocation_size);
}
-void NotReached(mojom::URLLoaderAssociatedRequest mojo_request,
- mojom::URLLoaderClientAssociatedPtr url_loader_client) {
- NOTREACHED();
-}
-
} // namespace
// This class is for sharing the ownership of a ScopedDataPipeProducerHandle
@@ -116,8 +110,7 @@ MojoAsyncResourceHandler::MojoAsyncResourceHandler(
net::URLRequest* request,
ResourceDispatcherHostImpl* rdh,
mojom::URLLoaderAssociatedRequest mojo_request,
- mojom::URLLoaderClientAssociatedPtr url_loader_client,
- ResourceType resource_type)
+ mojom::URLLoaderClientAssociatedPtr url_loader_client)
: ResourceHandler(request),
rdh_(rdh),
binding_(this, std::move(mojo_request)),
@@ -130,12 +123,8 @@ MojoAsyncResourceHandler::MojoAsyncResourceHandler(
binding_.set_connection_error_handler(
base::Bind(&MojoAsyncResourceHandler::Cancel, base::Unretained(this)));
- if (IsResourceTypeFrame(resource_type)) {
- GetRequestInfo()->set_on_transfer(base::Bind(
- &MojoAsyncResourceHandler::OnTransfer, weak_factory_.GetWeakPtr()));
- } else {
- GetRequestInfo()->set_on_transfer(base::Bind(&NotReached));
- }
+ GetRequestInfo()->set_on_transfer(base::Bind(
+ &MojoAsyncResourceHandler::OnTransfer, weak_factory_.GetWeakPtr()));
}
MojoAsyncResourceHandler::~MojoAsyncResourceHandler() {
@@ -188,10 +177,10 @@ bool MojoAsyncResourceHandler::OnResponseStarted(ResourceResponse* response,
response->head.response_start = base::TimeTicks::Now();
sent_received_response_message_ = true;
- mojom::DownloadedTempFileAssociatedPtrInfo downloaded_file_ptr;
+ mojom::DownloadedTempFilePtr downloaded_file_ptr;
if (!response->head.download_file_path.empty()) {
- downloaded_file_ptr = DownloadedTempFileImpl::Create(
- binding_.associated_group(), info->GetChildID(), info->GetRequestID());
+ downloaded_file_ptr = DownloadedTempFileImpl::Create(info->GetChildID(),
+ info->GetRequestID());
rdh_->RegisterDownloadedTempFile(info->GetChildID(), info->GetRequestID(),
response->head.download_file_path);
}
« no previous file with comments | « content/browser/loader/mojo_async_resource_handler.h ('k') | content/browser/loader/mojo_async_resource_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698