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

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

Issue 2561743003: Use associated interface on DownloadedTempFile (Closed)
Patch Set: update LayoutTest/TestExpectations Created 4 years 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 rdh_->delegate()->OnResponseStarted(request(), info->GetContext(), 162 rdh_->delegate()->OnResponseStarted(request(), info->GetContext(),
163 response); 163 response);
164 } 164 }
165 165
166 NetLogObserver::PopulateResponseInfo(request(), response); 166 NetLogObserver::PopulateResponseInfo(request(), response);
167 167
168 response->head.request_start = request()->creation_time(); 168 response->head.request_start = request()->creation_time();
169 response->head.response_start = base::TimeTicks::Now(); 169 response->head.response_start = base::TimeTicks::Now();
170 sent_received_response_message_ = true; 170 sent_received_response_message_ = true;
171 171
172 mojom::DownloadedTempFilePtr downloaded_file_ptr; 172 mojom::DownloadedTempFileAssociatedPtrInfo downloaded_file_ptr;
173 if (!response->head.download_file_path.empty()) { 173 if (!response->head.download_file_path.empty()) {
174 downloaded_file_ptr = DownloadedTempFileImpl::Create(info->GetChildID(), 174 downloaded_file_ptr = DownloadedTempFileImpl::Create(
175 info->GetRequestID()); 175 binding_.associated_group(), info->GetChildID(), info->GetRequestID());
176 rdh_->RegisterDownloadedTempFile(info->GetChildID(), info->GetRequestID(), 176 rdh_->RegisterDownloadedTempFile(info->GetChildID(), info->GetRequestID(),
177 response->head.download_file_path); 177 response->head.download_file_path);
178 } 178 }
179 179
180 url_loader_client_->OnReceiveResponse(response->head, 180 url_loader_client_->OnReceiveResponse(response->head,
181 std::move(downloaded_file_ptr)); 181 std::move(downloaded_file_ptr));
182 return true; 182 return true;
183 } 183 }
184 184
185 bool MojoAsyncResourceHandler::OnWillStart(const GURL& url, bool* defer) { 185 bool MojoAsyncResourceHandler::OnWillStart(const GURL& url, bool* defer) {
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 mojom::URLLoaderAssociatedRequest mojo_request, 458 mojom::URLLoaderAssociatedRequest mojo_request,
459 mojom::URLLoaderClientAssociatedPtr url_loader_client) { 459 mojom::URLLoaderClientAssociatedPtr url_loader_client) {
460 binding_.Unbind(); 460 binding_.Unbind();
461 binding_.Bind(std::move(mojo_request)); 461 binding_.Bind(std::move(mojo_request));
462 binding_.set_connection_error_handler( 462 binding_.set_connection_error_handler(
463 base::Bind(&MojoAsyncResourceHandler::Cancel, base::Unretained(this))); 463 base::Bind(&MojoAsyncResourceHandler::Cancel, base::Unretained(this)));
464 url_loader_client_ = std::move(url_loader_client); 464 url_loader_client_ = std::move(url_loader_client);
465 } 465 }
466 466
467 } // namespace content 467 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698