Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 508 return true; | 508 return true; |
| 509 } | 509 } |
| 510 } | 510 } |
| 511 #elif defined(OS_ANDROID) | 511 #elif defined(OS_ANDROID) |
| 512 // Access to files in external storage is allowed. | 512 // Access to files in external storage is allowed. |
| 513 base::FilePath external_storage_path; | 513 base::FilePath external_storage_path; |
| 514 PathService::Get(base::DIR_ANDROID_EXTERNAL_STORAGE, &external_storage_path); | 514 PathService::Get(base::DIR_ANDROID_EXTERNAL_STORAGE, &external_storage_path); |
| 515 if (external_storage_path.IsParent(path)) | 515 if (external_storage_path.IsParent(path)) |
| 516 return true; | 516 return true; |
| 517 | 517 |
| 518 // Allow to load offline pages, which are stored in the $PROFILE_PATH/Offline | |
| 519 // Pages/archives. | |
| 520 if (!profile_path_.empty()) { | |
| 521 const base::FilePath offline_page_archives = | |
| 522 profile_path_.Append(chrome::kOfflinePageArchivesDirname); | |
|
mmenke
2016/10/06 15:28:31
Do we still need the chrome/common/chrome_constant
jianli
2016/10/06 22:31:33
Done.
| |
| 523 if (offline_page_archives.IsParent(path)) | |
| 524 return true; | |
| 525 } | |
| 526 | |
| 527 // Whitelist of other allowed directories. | 518 // Whitelist of other allowed directories. |
| 528 static const char* const kLocalAccessWhiteList[] = { | 519 static const char* const kLocalAccessWhiteList[] = { |
| 529 "/sdcard", | 520 "/sdcard", |
| 530 "/mnt/sdcard", | 521 "/mnt/sdcard", |
| 531 }; | 522 }; |
| 532 #endif | 523 #endif |
| 533 | 524 |
| 534 for (size_t i = 0; i < arraysize(kLocalAccessWhiteList); ++i) { | 525 for (size_t i = 0; i < arraysize(kLocalAccessWhiteList); ++i) { |
| 535 const base::FilePath white_listed_path(kLocalAccessWhiteList[i]); | 526 const base::FilePath white_listed_path(kLocalAccessWhiteList[i]); |
| 536 // base::FilePath::operator== should probably handle trailing separators. | 527 // base::FilePath::operator== should probably handle trailing separators. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 586 if (!data_use_aggregator_) | 577 if (!data_use_aggregator_) |
| 587 return; | 578 return; |
| 588 | 579 |
| 589 if (is_data_usage_off_the_record_) { | 580 if (is_data_usage_off_the_record_) { |
| 590 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes); | 581 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes); |
| 591 return; | 582 return; |
| 592 } | 583 } |
| 593 | 584 |
| 594 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes); | 585 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes); |
| 595 } | 586 } |
| OLD | NEW |