| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 net::NetLog::TYPE_CHROME_POLICY_ABORTED_REQUEST, | 372 net::NetLog::TYPE_CHROME_POLICY_ABORTED_REQUEST, |
| 373 net::NetLog::StringCallback("url", | 373 net::NetLog::StringCallback("url", |
| 374 &request->url().possibly_invalid_spec())); | 374 &request->url().possibly_invalid_spec())); |
| 375 return net::ERR_BLOCKED_BY_ADMINISTRATOR; | 375 return net::ERR_BLOCKED_BY_ADMINISTRATOR; |
| 376 } | 376 } |
| 377 #endif | 377 #endif |
| 378 | 378 |
| 379 ForwardRequestStatus(REQUEST_STARTED, request, profile_); | 379 ForwardRequestStatus(REQUEST_STARTED, request, profile_); |
| 380 | 380 |
| 381 if (!enable_referrers_->GetValue()) | 381 if (!enable_referrers_->GetValue()) |
| 382 request->set_referrer(std::string()); | 382 request->SetReferrer(std::string()); |
| 383 if (enable_do_not_track_ && enable_do_not_track_->GetValue()) | 383 if (enable_do_not_track_ && enable_do_not_track_->GetValue()) |
| 384 request->SetExtraRequestHeaderByName(kDNTHeader, "1", true /* override */); | 384 request->SetExtraRequestHeaderByName(kDNTHeader, "1", true /* override */); |
| 385 | 385 |
| 386 bool force_safe_search = force_google_safe_search_ && | 386 bool force_safe_search = force_google_safe_search_ && |
| 387 force_google_safe_search_->GetValue(); | 387 force_google_safe_search_->GetValue(); |
| 388 | 388 |
| 389 net::CompletionCallback wrapped_callback = callback; | 389 net::CompletionCallback wrapped_callback = callback; |
| 390 if (force_safe_search) { | 390 if (force_safe_search) { |
| 391 wrapped_callback = base::Bind(&ForceGoogleSafeSearchCallbackWrapper, | 391 wrapped_callback = base::Bind(&ForceGoogleSafeSearchCallbackWrapper, |
| 392 callback, | 392 callback, |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 | 672 |
| 673 void ChromeNetworkDelegate::AccumulateContentLength( | 673 void ChromeNetworkDelegate::AccumulateContentLength( |
| 674 int64 received_content_length, int64 original_content_length) { | 674 int64 received_content_length, int64 original_content_length) { |
| 675 DCHECK_GE(received_content_length, 0); | 675 DCHECK_GE(received_content_length, 0); |
| 676 DCHECK_GE(original_content_length, 0); | 676 DCHECK_GE(original_content_length, 0); |
| 677 StoreAccumulatedContentLength(received_content_length, | 677 StoreAccumulatedContentLength(received_content_length, |
| 678 original_content_length); | 678 original_content_length); |
| 679 received_content_length_ += received_content_length; | 679 received_content_length_ += received_content_length; |
| 680 original_content_length_ += original_content_length; | 680 original_content_length_ += original_content_length; |
| 681 } | 681 } |
| OLD | NEW |