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

Side by Side Diff: chrome/browser/net/chrome_network_delegate.cc

Issue 2877343002: chromeos: Remove kTestType conditional from ChromeNetworkDelegate (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 } 445 }
446 446
447 return allow; 447 return allow;
448 } 448 }
449 449
450 bool ChromeNetworkDelegate::OnCanAccessFile(const net::URLRequest& request, 450 bool ChromeNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
451 const base::FilePath& path) const { 451 const base::FilePath& path) const {
452 #if defined(OS_CHROMEOS) 452 #if defined(OS_CHROMEOS)
453 // If we're running Chrome for ChromeOS on Linux, we want to allow file 453 // If we're running Chrome for ChromeOS on Linux, we want to allow file
454 // access. This is checked here to make IsAccessAllowed() unit-testable. 454 // access. This is checked here to make IsAccessAllowed() unit-testable.
455 if (!base::SysInfo::IsRunningOnChromeOS() || 455 if (!base::SysInfo::IsRunningOnChromeOS())
456 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) {
457 return true; 456 return true;
458 }
459 #endif 457 #endif
460 458
461 return IsAccessAllowed(path, profile_path_); 459 return IsAccessAllowed(path, profile_path_);
462 } 460 }
463 461
464 // static 462 // static
465 bool ChromeNetworkDelegate::IsAccessAllowed( 463 bool ChromeNetworkDelegate::IsAccessAllowed(
466 const base::FilePath& path, 464 const base::FilePath& path,
467 const base::FilePath& profile_path) { 465 const base::FilePath& profile_path) {
468 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) 466 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 if (!data_use_aggregator_) 552 if (!data_use_aggregator_)
555 return; 553 return;
556 554
557 if (is_data_usage_off_the_record_) { 555 if (is_data_usage_off_the_record_) {
558 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes); 556 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes);
559 return; 557 return;
560 } 558 }
561 559
562 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes); 560 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes);
563 } 561 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698