OLD | NEW |
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/net/chrome_network_delegate.h" | 5 #include "chrome/browser/net/chrome_network_delegate.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 if (g_allow_file_access_) | 529 if (g_allow_file_access_) |
530 return true; | 530 return true; |
531 | 531 |
532 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) | 532 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
533 return true; | 533 return true; |
534 #else | 534 #else |
535 #if defined(OS_CHROMEOS) | 535 #if defined(OS_CHROMEOS) |
536 // If we're running Chrome for ChromeOS on Linux, we want to allow file | 536 // If we're running Chrome for ChromeOS on Linux, we want to allow file |
537 // access. | 537 // access. |
538 if (!base::SysInfo::IsRunningOnChromeOS() || | 538 if (!base::SysInfo::IsRunningOnChromeOS() || |
539 CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) { | 539 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) { |
540 return true; | 540 return true; |
541 } | 541 } |
542 | 542 |
543 // Use a whitelist to only allow access to files residing in the list of | 543 // Use a whitelist to only allow access to files residing in the list of |
544 // directories below. | 544 // directories below. |
545 static const char* const kLocalAccessWhiteList[] = { | 545 static const char* const kLocalAccessWhiteList[] = { |
546 "/home/chronos/user/Downloads", | 546 "/home/chronos/user/Downloads", |
547 "/home/chronos/user/log", | 547 "/home/chronos/user/log", |
548 "/home/chronos/user/WebRTC Logs", | 548 "/home/chronos/user/WebRTC Logs", |
549 "/media", | 549 "/media", |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 bool ChromeNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 626 bool ChromeNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
627 const net::URLRequest& request, | 627 const net::URLRequest& request, |
628 const GURL& target_url, | 628 const GURL& target_url, |
629 const GURL& referrer_url) const { | 629 const GURL& referrer_url) const { |
630 base::debug::StackTrace callstack; | 630 base::debug::StackTrace callstack; |
631 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 631 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
632 base::Bind(&ReportInvalidReferrerSend, target_url, | 632 base::Bind(&ReportInvalidReferrerSend, target_url, |
633 referrer_url, callstack)); | 633 referrer_url, callstack)); |
634 return true; | 634 return true; |
635 } | 635 } |
OLD | NEW |