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/loader/chrome_resource_dispatcher_host_delegate.h" | 5 #include "chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 } | 477 } |
478 #endif | 478 #endif |
479 | 479 |
480 // Don't attempt to append headers to requests that have already started. | 480 // Don't attempt to append headers to requests that have already started. |
481 // TODO(stevet): Remove this once the request ordering issues are resolved | 481 // TODO(stevet): Remove this once the request ordering issues are resolved |
482 // in crbug.com/128048. | 482 // in crbug.com/128048. |
483 if (!request->is_pending()) { | 483 if (!request->is_pending()) { |
484 net::HttpRequestHeaders headers; | 484 net::HttpRequestHeaders headers; |
485 headers.CopyFrom(request->extra_request_headers()); | 485 headers.CopyFrom(request->extra_request_headers()); |
486 bool is_off_the_record = io_data->IsOffTheRecord(); | 486 bool is_off_the_record = io_data->IsOffTheRecord(); |
487 bool is_signed_in = | |
488 !is_off_the_record && | |
489 !io_data->google_services_account_id()->GetValue().empty(); | |
490 variations::AppendVariationHeaders( | 487 variations::AppendVariationHeaders( |
491 request->url(), is_off_the_record, is_signed_in, | 488 request->url(), is_off_the_record, |
492 !is_off_the_record && io_data->GetMetricsEnabledStateOnIOThread(), | 489 !is_off_the_record && io_data->GetMetricsEnabledStateOnIOThread(), |
493 &headers); | 490 &headers); |
494 request->SetExtraRequestHeaders(headers); | 491 request->SetExtraRequestHeaders(headers); |
495 } | 492 } |
496 | 493 |
497 if (io_data->policy_header_helper()) | 494 if (io_data->policy_header_helper()) |
498 io_data->policy_header_helper()->AddPolicyHeaders(request->url(), request); | 495 io_data->policy_header_helper()->AddPolicyHeaders(request->url(), request); |
499 | 496 |
500 signin::FixMirrorRequestHeaderHelper(request, GURL() /* redirect_url */, | 497 signin::FixMirrorRequestHeaderHelper(request, GURL() /* redirect_url */, |
501 io_data, info->GetChildID(), | 498 io_data, info->GetChildID(), |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, | 883 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, |
887 base::Unretained(this), url, request_loading_time)); | 884 base::Unretained(this), url, request_loading_time)); |
888 return; | 885 return; |
889 } | 886 } |
890 | 887 |
891 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? | 888 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? |
892 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); | 889 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); |
893 rappor::SampleDomainAndRegistryFromGURL( | 890 rappor::SampleDomainAndRegistryFromGURL( |
894 g_browser_process->rappor_service(), metric_name, url); | 891 g_browser_process->rappor_service(), metric_name, url); |
895 } | 892 } |
OLD | NEW |