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

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

Issue 2813243002: network service: pass PlzNavigate resulting data via mojo data pipe (Closed)
Patch Set: ahem Created 3 years, 8 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
« no previous file with comments | « content/browser/loader/navigation_url_loader_network_service.h ('k') | content/child/resource_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/navigation_url_loader_network_service.cc
diff --git a/content/browser/loader/navigation_url_loader_network_service.cc b/content/browser/loader/navigation_url_loader_network_service.cc
index b29827b44656b862170e1c7bc7cfd320bc1b3c4a..c5037164c440568b93b6c7926e5effc457335ff8 100644
--- a/content/browser/loader/navigation_url_loader_network_service.cc
+++ b/content/browser/loader/navigation_url_loader_network_service.cc
@@ -8,7 +8,11 @@
#include "content/browser/frame_host/navigation_request_info.h"
#include "content/browser/loader/navigation_url_loader_delegate.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/global_request_id.h"
+#include "content/public/browser/navigation_data.h"
#include "content/public/browser/navigation_ui_data.h"
+#include "content/public/browser/ssl_status.h"
+#include "content/public/browser/stream_handle.h"
#include "content/public/common/service_manager_connection.h"
#include "content/public/common/service_names.mojom.h"
#include "net/url_request/url_request_context.h"
@@ -62,8 +66,11 @@ void NavigationURLLoaderNetworkService::ProceedWithResponse() {}
void NavigationURLLoaderNetworkService::OnReceiveResponse(
const ResourceResponseHead& head,
mojom::DownloadedTempFilePtr downloaded_file) {
- // TODO(scottmg): This should mirror code in
- // NavigationResourceHandler::OnReponseStarted().
+ // TODO(scottmg): This needs to do more of what
+ // NavigationResourceHandler::OnReponseStarted() does. Or maybe in
+ // OnStartLoadingResponseBody().
+ response_ = base::MakeShared<ResourceResponse>();
+ response_->head = head;
}
void NavigationURLLoaderNetworkService::OnReceiveRedirect(
@@ -91,7 +98,16 @@ void NavigationURLLoaderNetworkService::OnTransferSizeUpdated(
int32_t transfer_size_diff) {}
void NavigationURLLoaderNetworkService::OnStartLoadingResponseBody(
- mojo::ScopedDataPipeConsumerHandle body) {}
+ mojo::ScopedDataPipeConsumerHandle body) {
+ DCHECK(response_);
+ // Temporarily, we pass both a stream (null) and the data pipe to the
+ // delegate until PlzNavigate has shipped and we can be comfortable fully
+ // switching to the data pipe.
+ delegate_->OnResponseStarted(response_, nullptr, std::move(body), SSLStatus(),
+ std::unique_ptr<NavigationData>(),
+ GlobalRequestID() /* request_id? */,
+ false /* is_download? */, false /* is_stream */);
+}
void NavigationURLLoaderNetworkService::OnComplete(
const ResourceRequestCompletionStatus& completion_status) {}
« no previous file with comments | « content/browser/loader/navigation_url_loader_network_service.h ('k') | content/child/resource_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698