| 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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 } | 539 } |
| 540 | 540 |
| 541 bool ChromeNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 541 bool ChromeNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
| 542 const net::URLRequest& request, | 542 const net::URLRequest& request, |
| 543 const GURL& target_url, | 543 const GURL& target_url, |
| 544 const GURL& referrer_url) const { | 544 const GURL& referrer_url) const { |
| 545 ReportInvalidReferrerSend(target_url, referrer_url); | 545 ReportInvalidReferrerSend(target_url, referrer_url); |
| 546 return true; | 546 return true; |
| 547 } | 547 } |
| 548 | 548 |
| 549 bool ChromeNetworkDelegate::OnCanQueueReportingReport( |
| 550 const url::Origin& origin) const { |
| 551 if (!cookie_settings_) |
| 552 return true; |
| 553 |
| 554 return cookie_settings_->IsCookieAccessAllowed(origin.GetURL(), |
| 555 origin.GetURL()); |
| 556 } |
| 557 |
| 558 bool ChromeNetworkDelegate::OnCanSendReportingReport( |
| 559 const url::Origin& origin) const { |
| 560 if (!cookie_settings_) |
| 561 return true; |
| 562 |
| 563 return cookie_settings_->IsCookieAccessAllowed(origin.GetURL(), |
| 564 origin.GetURL()); |
| 565 } |
| 566 |
| 567 bool ChromeNetworkDelegate::OnCanSetReportingClient( |
| 568 const url::Origin& origin, |
| 569 const GURL& endpoint) const { |
| 570 if (!cookie_settings_) |
| 571 return true; |
| 572 |
| 573 return cookie_settings_->IsCookieAccessAllowed(endpoint, origin.GetURL()); |
| 574 } |
| 575 |
| 576 bool ChromeNetworkDelegate::OnCanUseReportingClient( |
| 577 const url::Origin& origin, |
| 578 const GURL& endpoint) const { |
| 579 if (!cookie_settings_) |
| 580 return true; |
| 581 |
| 582 return cookie_settings_->IsCookieAccessAllowed(endpoint, origin.GetURL()); |
| 583 } |
| 584 |
| 549 void ChromeNetworkDelegate::ReportDataUsageStats(net::URLRequest* request, | 585 void ChromeNetworkDelegate::ReportDataUsageStats(net::URLRequest* request, |
| 550 int64_t tx_bytes, | 586 int64_t tx_bytes, |
| 551 int64_t rx_bytes) { | 587 int64_t rx_bytes) { |
| 552 if (!data_use_aggregator_) | 588 if (!data_use_aggregator_) |
| 553 return; | 589 return; |
| 554 | 590 |
| 555 if (is_data_usage_off_the_record_) { | 591 if (is_data_usage_off_the_record_) { |
| 556 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes); | 592 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes); |
| 557 return; | 593 return; |
| 558 } | 594 } |
| 559 | 595 |
| 560 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes); | 596 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes); |
| 561 } | 597 } |
| OLD | NEW |