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 !io_data->google_services_account_id()->GetValue().empty(); |
487 variations::AppendVariationHeaders( | 489 variations::AppendVariationHeaders( |
488 request->url(), is_off_the_record, | 490 request->url(), is_off_the_record, is_signed_in, |
489 !is_off_the_record && io_data->GetMetricsEnabledStateOnIOThread(), | 491 !is_off_the_record && io_data->GetMetricsEnabledStateOnIOThread(), |
490 &headers); | 492 &headers); |
491 request->SetExtraRequestHeaders(headers); | 493 request->SetExtraRequestHeaders(headers); |
492 } | 494 } |
493 | 495 |
494 if (io_data->policy_header_helper()) | 496 if (io_data->policy_header_helper()) |
495 io_data->policy_header_helper()->AddPolicyHeaders(request->url(), request); | 497 io_data->policy_header_helper()->AddPolicyHeaders(request->url(), request); |
496 | 498 |
497 signin::FixMirrorRequestHeaderHelper(request, GURL() /* redirect_url */, | 499 signin::FixMirrorRequestHeaderHelper(request, GURL() /* redirect_url */, |
498 io_data, info->GetChildID(), | 500 io_data, info->GetChildID(), |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, | 885 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, |
884 base::Unretained(this), url, request_loading_time)); | 886 base::Unretained(this), url, request_loading_time)); |
885 return; | 887 return; |
886 } | 888 } |
887 | 889 |
888 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? | 890 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? |
889 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); | 891 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); |
890 rappor::SampleDomainAndRegistryFromGURL( | 892 rappor::SampleDomainAndRegistryFromGURL( |
891 g_browser_process->rappor_service(), metric_name, url); | 893 g_browser_process->rappor_service(), metric_name, url); |
892 } | 894 } |
OLD | NEW |