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 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 "/home/chronos/user/Downloads", | 789 "/home/chronos/user/Downloads", |
790 "/home/chronos/user/log", | 790 "/home/chronos/user/log", |
791 "/home/chronos/user/WebRTC Logs", | 791 "/home/chronos/user/WebRTC Logs", |
792 "/media", | 792 "/media", |
793 "/opt/oem", | 793 "/opt/oem", |
794 "/usr/share/chromeos-assets", | 794 "/usr/share/chromeos-assets", |
795 "/tmp", | 795 "/tmp", |
796 "/var/log", | 796 "/var/log", |
797 }; | 797 }; |
798 | 798 |
799 // The actual location of "/home/chronos/user/Downloads" is the Downloads | 799 // The actual location of "/home/chronos/user/Xyz" is the Xyz directory under |
800 // directory under the profile path ("/home/chronos/user' is a hard link to | 800 // the profile path ("/home/chronos/user' is a hard link to current primary |
801 // current primary logged in profile.) For the support of multi-profile | 801 // logged in profile.) For the support of multi-profile sessions, we are |
802 // sessions, we are switching to use explicit "$PROFILE_PATH/Downloads" path | 802 // switching to use explicit "$PROFILE_PATH/Xyz" path and here whitelist such |
803 // and here whitelist such access. | 803 // access. |
804 if (!profile_path_.empty()) { | 804 if (!profile_path_.empty()) { |
805 const base::FilePath downloads = profile_path_.AppendASCII("Downloads"); | 805 const base::FilePath downloads = profile_path_.AppendASCII("Downloads"); |
806 if (downloads == path.StripTrailingSeparators() || downloads.IsParent(path)) | 806 if (downloads == path.StripTrailingSeparators() || downloads.IsParent(path)) |
807 return true; | 807 return true; |
| 808 const base::FilePath webrtc_logs = profile_path_.AppendASCII("WebRTC Logs"); |
| 809 if (webrtc_logs == path.StripTrailingSeparators() || |
| 810 webrtc_logs.IsParent(path)) { |
| 811 return true; |
| 812 } |
808 } | 813 } |
809 #elif defined(OS_ANDROID) | 814 #elif defined(OS_ANDROID) |
810 // Access to files in external storage is allowed. | 815 // Access to files in external storage is allowed. |
811 base::FilePath external_storage_path; | 816 base::FilePath external_storage_path; |
812 PathService::Get(base::DIR_ANDROID_EXTERNAL_STORAGE, &external_storage_path); | 817 PathService::Get(base::DIR_ANDROID_EXTERNAL_STORAGE, &external_storage_path); |
813 if (external_storage_path.IsParent(path)) | 818 if (external_storage_path.IsParent(path)) |
814 return true; | 819 return true; |
815 | 820 |
816 // Whitelist of other allowed directories. | 821 // Whitelist of other allowed directories. |
817 static const char* const kLocalAccessWhiteList[] = { | 822 static const char* const kLocalAccessWhiteList[] = { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 data_reduction_proxy::DataReductionProxyRequestType request_type) { | 887 data_reduction_proxy::DataReductionProxyRequestType request_type) { |
883 DCHECK_GE(received_content_length, 0); | 888 DCHECK_GE(received_content_length, 0); |
884 DCHECK_GE(original_content_length, 0); | 889 DCHECK_GE(original_content_length, 0); |
885 StoreAccumulatedContentLength(received_content_length, | 890 StoreAccumulatedContentLength(received_content_length, |
886 original_content_length, | 891 original_content_length, |
887 request_type, | 892 request_type, |
888 reinterpret_cast<Profile*>(profile_)); | 893 reinterpret_cast<Profile*>(profile_)); |
889 received_content_length_ += received_content_length; | 894 received_content_length_ += received_content_length; |
890 original_content_length_ += original_content_length; | 895 original_content_length_ += original_content_length; |
891 } | 896 } |
OLD | NEW |