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

Side by Side Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 2014803002: Move DownloadControllerAndroid from content/ to chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed deprecated cookie apis Created 4 years, 6 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h" 5 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 io_data->resource_prefetch_predictor_observer()->OnRequestStarted( 472 io_data->resource_prefetch_predictor_observer()->OnRequestStarted(
473 request, resource_type, info->GetChildID(), info->GetRenderFrameID()); 473 request, resource_type, info->GetChildID(), info->GetRenderFrameID());
474 } 474 }
475 } 475 }
476 476
477 void ChromeResourceDispatcherHostDelegate::DownloadStarting( 477 void ChromeResourceDispatcherHostDelegate::DownloadStarting(
478 net::URLRequest* request, 478 net::URLRequest* request,
479 content::ResourceContext* resource_context, 479 content::ResourceContext* resource_context,
480 int child_id, 480 int child_id,
481 int route_id, 481 int route_id,
482 int request_id,
483 bool is_content_initiated, 482 bool is_content_initiated,
484 bool must_download, 483 bool must_download,
485 ScopedVector<content::ResourceThrottle>* throttles) { 484 ScopedVector<content::ResourceThrottle>* throttles) {
486 BrowserThread::PostTask( 485 BrowserThread::PostTask(
487 BrowserThread::UI, FROM_HERE, 486 BrowserThread::UI, FROM_HERE,
488 base::Bind(&NotifyDownloadInitiatedOnUI, child_id, route_id)); 487 base::Bind(&NotifyDownloadInitiatedOnUI, child_id, route_id));
489 488
490 // If it's from the web, we don't trust it, so we push the throttle on. 489 // If it's from the web, we don't trust it, so we push the throttle on.
491 if (is_content_initiated) { 490 if (is_content_initiated) {
492 const content::ResourceRequestInfo* info = 491 const content::ResourceRequestInfo* info =
493 content::ResourceRequestInfo::ForRequest(request); 492 content::ResourceRequestInfo::ForRequest(request);
494 throttles->push_back(new DownloadResourceThrottle( 493 throttles->push_back(new DownloadResourceThrottle(
495 download_request_limiter_, info->GetWebContentsGetterForRequest(), 494 download_request_limiter_, info->GetWebContentsGetterForRequest(),
496 request->url(), request->method())); 495 request->url(), request->method()));
497 #if BUILDFLAG(ANDROID_JAVA_UI) 496 #if BUILDFLAG(ANDROID_JAVA_UI)
498 throttles->push_back( 497 throttles->push_back(
499 new chrome::InterceptDownloadResourceThrottle( 498 new chrome::InterceptDownloadResourceThrottle(
500 request, child_id, route_id, request_id, must_download)); 499 request, child_id, route_id, must_download));
501 #endif 500 #endif
502 } 501 }
503 502
504 // If this isn't a new request, we've seen this before and added the standard 503 // If this isn't a new request, we've seen this before and added the standard
505 // resource throttles already so no need to add it again. 504 // resource throttles already so no need to add it again.
506 if (!request->is_pending()) { 505 if (!request->is_pending()) {
507 AppendStandardResourceThrottles(request, 506 AppendStandardResourceThrottles(request,
508 resource_context, 507 resource_context,
509 content::RESOURCE_TYPE_MAIN_FRAME, 508 content::RESOURCE_TYPE_MAIN_FRAME,
510 throttles); 509 throttles);
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 data_reduction_proxy::DataReductionProxyData* data_reduction_proxy_data = 842 data_reduction_proxy::DataReductionProxyData* data_reduction_proxy_data =
844 data_reduction_proxy::DataReductionProxyData::GetData(*request); 843 data_reduction_proxy::DataReductionProxyData::GetData(*request);
845 // DeepCopy the DataReductionProxyData from the URLRequest to prevent the 844 // DeepCopy the DataReductionProxyData from the URLRequest to prevent the
846 // URLRequest and DataReductionProxyData from both having ownership of the 845 // URLRequest and DataReductionProxyData from both having ownership of the
847 // same object. This copy will be shortlived as it will be deep copied again 846 // same object. This copy will be shortlived as it will be deep copied again
848 // when content makes a clone of NavigationData for the UI thread. 847 // when content makes a clone of NavigationData for the UI thread.
849 if (data_reduction_proxy_data) 848 if (data_reduction_proxy_data)
850 data->SetDataReductionProxyData(data_reduction_proxy_data->DeepCopy()); 849 data->SetDataReductionProxyData(data_reduction_proxy_data->DeepCopy());
851 return data; 850 return data;
852 } 851 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698