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

Side by Side Diff: content/browser/loader/mojo_async_resource_handler.cc

Issue 2561743003: Use associated interface on DownloadedTempFile (Closed)
Patch Set: typo fix 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/loader/mojo_async_resource_handler.h" 5 #include "content/browser/loader/mojo_async_resource_handler.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 } 164 }
165 165
166 NetLogObserver::PopulateResponseInfo(request(), response); 166 NetLogObserver::PopulateResponseInfo(request(), response);
167 response->head.encoded_data_length = request()->raw_header_size(); 167 response->head.encoded_data_length = request()->raw_header_size();
168 reported_total_received_bytes_ = response->head.encoded_data_length; 168 reported_total_received_bytes_ = response->head.encoded_data_length;
169 169
170 response->head.request_start = request()->creation_time(); 170 response->head.request_start = request()->creation_time();
171 response->head.response_start = base::TimeTicks::Now(); 171 response->head.response_start = base::TimeTicks::Now();
172 sent_received_response_message_ = true; 172 sent_received_response_message_ = true;
173 173
174 mojom::DownloadedTempFilePtr downloaded_file_ptr; 174 mojom::DownloadedTempFileAssociatedPtrInfo downloaded_file_ptr;
175 if (!response->head.download_file_path.empty()) { 175 if (!response->head.download_file_path.empty()) {
mmenke 2017/01/18 20:08:53 Hrm....I assume we never do this for main frames (
tzik 2017/01/19 13:04:41 Do you mean TransferredNavigation case? Right, it'
mmenke 2017/01/19 13:09:08 I mean cases in which we'd want to transfer the UR
176 downloaded_file_ptr = DownloadedTempFileImpl::Create(info->GetChildID(), 176 downloaded_file_ptr = DownloadedTempFileImpl::Create(
177 info->GetRequestID()); 177 binding_.associated_group(), info->GetChildID(), info->GetRequestID());
178 rdh_->RegisterDownloadedTempFile(info->GetChildID(), info->GetRequestID(), 178 rdh_->RegisterDownloadedTempFile(info->GetChildID(), info->GetRequestID(),
179 response->head.download_file_path); 179 response->head.download_file_path);
180 } 180 }
181 181
182 url_loader_client_->OnReceiveResponse(response->head, 182 url_loader_client_->OnReceiveResponse(response->head,
183 std::move(downloaded_file_ptr)); 183 std::move(downloaded_file_ptr));
184 return true; 184 return true;
185 } 185 }
186 186
187 bool MojoAsyncResourceHandler::OnWillStart(const GURL& url, bool* defer) { 187 bool MojoAsyncResourceHandler::OnWillStart(const GURL& url, bool* defer) {
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 mojom::URLLoaderAssociatedRequest mojo_request, 471 mojom::URLLoaderAssociatedRequest mojo_request,
472 mojom::URLLoaderClientAssociatedPtr url_loader_client) { 472 mojom::URLLoaderClientAssociatedPtr url_loader_client) {
473 binding_.Unbind(); 473 binding_.Unbind();
474 binding_.Bind(std::move(mojo_request)); 474 binding_.Bind(std::move(mojo_request));
475 binding_.set_connection_error_handler( 475 binding_.set_connection_error_handler(
476 base::Bind(&MojoAsyncResourceHandler::Cancel, base::Unretained(this))); 476 base::Bind(&MojoAsyncResourceHandler::Cancel, base::Unretained(this)));
477 url_loader_client_ = std::move(url_loader_client); 477 url_loader_client_ = std::move(url_loader_client);
478 } 478 }
479 479
480 } // namespace content 480 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/downloaded_temp_file_impl.cc ('k') | content/browser/loader/resource_dispatcher_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698