| 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 net::NetLog::TYPE_CHROME_POLICY_ABORTED_REQUEST, | 460 net::NetLog::TYPE_CHROME_POLICY_ABORTED_REQUEST, |
| 461 net::NetLog::StringCallback("url", | 461 net::NetLog::StringCallback("url", |
| 462 &request->url().possibly_invalid_spec())); | 462 &request->url().possibly_invalid_spec())); |
| 463 return net::ERR_BLOCKED_BY_ADMINISTRATOR; | 463 return net::ERR_BLOCKED_BY_ADMINISTRATOR; |
| 464 } | 464 } |
| 465 #endif | 465 #endif |
| 466 | 466 |
| 467 ForwardRequestStatus(REQUEST_STARTED, request, profile_); | 467 ForwardRequestStatus(REQUEST_STARTED, request, profile_); |
| 468 | 468 |
| 469 if (!enable_referrers_->GetValue()) | 469 if (!enable_referrers_->GetValue()) |
| 470 request->set_referrer(std::string()); | 470 request->SetReferrer(std::string()); |
| 471 if (enable_do_not_track_ && enable_do_not_track_->GetValue()) | 471 if (enable_do_not_track_ && enable_do_not_track_->GetValue()) |
| 472 request->SetExtraRequestHeaderByName(kDNTHeader, "1", true /* override */); | 472 request->SetExtraRequestHeaderByName(kDNTHeader, "1", true /* override */); |
| 473 | 473 |
| 474 bool force_safe_search = force_google_safe_search_ && | 474 bool force_safe_search = force_google_safe_search_ && |
| 475 force_google_safe_search_->GetValue(); | 475 force_google_safe_search_->GetValue(); |
| 476 | 476 |
| 477 net::CompletionCallback wrapped_callback = callback; | 477 net::CompletionCallback wrapped_callback = callback; |
| 478 if (force_safe_search) { | 478 if (force_safe_search) { |
| 479 wrapped_callback = base::Bind(&ForceGoogleSafeSearchCallbackWrapper, | 479 wrapped_callback = base::Bind(&ForceGoogleSafeSearchCallbackWrapper, |
| 480 callback, | 480 callback, |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 | 760 |
| 761 void ChromeNetworkDelegate::AccumulateContentLength( | 761 void ChromeNetworkDelegate::AccumulateContentLength( |
| 762 int64 received_content_length, int64 original_content_length) { | 762 int64 received_content_length, int64 original_content_length) { |
| 763 DCHECK_GE(received_content_length, 0); | 763 DCHECK_GE(received_content_length, 0); |
| 764 DCHECK_GE(original_content_length, 0); | 764 DCHECK_GE(original_content_length, 0); |
| 765 StoreAccumulatedContentLength(received_content_length, | 765 StoreAccumulatedContentLength(received_content_length, |
| 766 original_content_length); | 766 original_content_length); |
| 767 received_content_length_ += received_content_length; | 767 received_content_length_ += received_content_length; |
| 768 original_content_length_ += original_content_length; | 768 original_content_length_ += original_content_length; |
| 769 } | 769 } |
| OLD | NEW |