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

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: addressing comments 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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(
478 new DownloadResourceThrottle(download_request_limiter_.get(), 478 new DownloadResourceThrottle(download_request_limiter_,
479 child_id, 479 child_id,
480 route_id, 480 route_id,
481 request->url(), 481 request->url(),
482 request->method())); 482 request->method()));
483 #if defined(OS_ANDROID) 483 #if defined(OS_ANDROID)
484 throttles->push_back( 484 throttles->push_back(
485 new chrome::InterceptDownloadResourceThrottle( 485 new chrome::InterceptDownloadResourceThrottle(
486 request, child_id, route_id, request_id)); 486 request, child_id, route_id, request_id));
487 #endif 487 #endif
488 } 488 }
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 url_request->GetTotalReceivedBytes())); 765 url_request->GetTotalReceivedBytes()));
766 } 766 }
767 } 767 }
768 768
769 // static 769 // static
770 void ChromeResourceDispatcherHostDelegate:: 770 void ChromeResourceDispatcherHostDelegate::
771 SetExternalProtocolHandlerDelegateForTesting( 771 SetExternalProtocolHandlerDelegateForTesting(
772 ExternalProtocolHandler::Delegate* delegate) { 772 ExternalProtocolHandler::Delegate* delegate) {
773 g_external_protocol_handler_delegate = delegate; 773 g_external_protocol_handler_delegate = delegate;
774 } 774 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698