| 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 return true; | 471 return true; |
| 472 #else | 472 #else |
| 473 #if defined(OS_CHROMEOS) | 473 #if defined(OS_CHROMEOS) |
| 474 // If we're running Chrome for ChromeOS on Linux, we want to allow file | 474 // If we're running Chrome for ChromeOS on Linux, we want to allow file |
| 475 // access. | 475 // access. |
| 476 if (!base::SysInfo::IsRunningOnChromeOS() || | 476 if (!base::SysInfo::IsRunningOnChromeOS() || |
| 477 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) { | 477 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) { |
| 478 return true; | 478 return true; |
| 479 } | 479 } |
| 480 | 480 |
| 481 if (base::IsLink(path.StripTrailingSeparators())) |
| 482 return false; |
| 483 |
| 481 // Use a whitelist to only allow access to files residing in the list of | 484 // Use a whitelist to only allow access to files residing in the list of |
| 482 // directories below. | 485 // directories below. |
| 483 static const char* const kLocalAccessWhiteList[] = { | 486 static const char* const kLocalAccessWhiteList[] = { |
| 484 "/home/chronos/user/Downloads", | 487 "/home/chronos/user/Downloads", |
| 485 "/home/chronos/user/log", | 488 "/home/chronos/user/log", |
| 486 "/home/chronos/user/WebRTC Logs", | 489 "/home/chronos/user/WebRTC Logs", |
| 487 "/media", | 490 "/media", |
| 488 "/opt/oem", | 491 "/opt/oem", |
| 489 "/usr/share/chromeos-assets", | 492 "/usr/share/chromeos-assets", |
| 490 "/tmp", | 493 "/tmp", |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 if (!data_use_aggregator_) | 579 if (!data_use_aggregator_) |
| 577 return; | 580 return; |
| 578 | 581 |
| 579 if (is_data_usage_off_the_record_) { | 582 if (is_data_usage_off_the_record_) { |
| 580 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes); | 583 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes); |
| 581 return; | 584 return; |
| 582 } | 585 } |
| 583 | 586 |
| 584 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes); | 587 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes); |
| 585 } | 588 } |
| OLD | NEW |