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

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

Issue 1229933010: move file access permission logic to DownloadResourceThrottle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years, 5 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 <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 int request_id, 467 int request_id,
468 bool is_content_initiated, 468 bool is_content_initiated,
469 bool must_download, 469 bool must_download,
470 ScopedVector<content::ResourceThrottle>* throttles) { 470 ScopedVector<content::ResourceThrottle>* throttles) {
471 BrowserThread::PostTask( 471 BrowserThread::PostTask(
472 BrowserThread::UI, FROM_HERE, 472 BrowserThread::UI, FROM_HERE,
473 base::Bind(&NotifyDownloadInitiatedOnUI, child_id, route_id)); 473 base::Bind(&NotifyDownloadInitiatedOnUI, child_id, route_id));
474 474
475 // If it's from the web, we don't trust it, so we push the throttle on. 475 // If it's from the web, we don't trust it, so we push the throttle on.
476 if (is_content_initiated) { 476 if (is_content_initiated) {
477 throttles->push_back( 477 throttles->push_back(new DownloadResourceThrottle(
478 new DownloadResourceThrottle(download_request_limiter_.get(), 478 download_request_limiter_, child_id, route_id, request->url(),
479 child_id, 479 request->method()));
480 route_id,
481 request->url(),
482 request->method()));
483 #if defined(OS_ANDROID) 480 #if defined(OS_ANDROID)
484 throttles->push_back( 481 throttles->push_back(
485 new chrome::InterceptDownloadResourceThrottle( 482 new chrome::InterceptDownloadResourceThrottle(
486 request, child_id, route_id, request_id)); 483 request, child_id, route_id, request_id));
487 #endif 484 #endif
488 } 485 }
489 486
490 // If this isn't a new request, we've seen this before and added the standard 487 // If this isn't a new request, we've seen this before and added the standard
491 // resource throttles already so no need to add it again. 488 // resource throttles already so no need to add it again.
492 if (!request->is_pending()) { 489 if (!request->is_pending()) {
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 url_request->GetTotalReceivedBytes())); 762 url_request->GetTotalReceivedBytes()));
766 } 763 }
767 } 764 }
768 765
769 // static 766 // static
770 void ChromeResourceDispatcherHostDelegate:: 767 void ChromeResourceDispatcherHostDelegate::
771 SetExternalProtocolHandlerDelegateForTesting( 768 SetExternalProtocolHandlerDelegateForTesting(
772 ExternalProtocolHandler::Delegate* delegate) { 769 ExternalProtocolHandler::Delegate* delegate) {
773 g_external_protocol_handler_delegate = delegate; 770 g_external_protocol_handler_delegate = delegate;
774 } 771 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_target_determiner_unittest.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698