Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(526)

Side by Side Diff: chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc

Issue 2558913003: Restrict transmission of external exp ids to signed in users. (Closed)
Patch Set: Add comments to callsites and API headers. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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();
mmenke 2016/12/09 19:47:44 I think you just need the last check? google_serv
Alexei Svitkine (slow) 2016/12/09 20:10:44 We don't initialize google_services_account_id for
487 variations::AppendVariationHeaders( 490 variations::AppendVariationHeaders(
488 request->url(), is_off_the_record, 491 request->url(), is_off_the_record, is_signed_in,
489 !is_off_the_record && io_data->GetMetricsEnabledStateOnIOThread(), 492 !is_off_the_record && io_data->GetMetricsEnabledStateOnIOThread(),
490 &headers); 493 &headers);
491 request->SetExtraRequestHeaders(headers); 494 request->SetExtraRequestHeaders(headers);
492 } 495 }
493 496
494 if (io_data->policy_header_helper()) 497 if (io_data->policy_header_helper())
495 io_data->policy_header_helper()->AddPolicyHeaders(request->url(), request); 498 io_data->policy_header_helper()->AddPolicyHeaders(request->url(), request);
496 499
497 signin::FixMirrorRequestHeaderHelper(request, GURL() /* redirect_url */, 500 signin::FixMirrorRequestHeaderHelper(request, GURL() /* redirect_url */,
498 io_data, info->GetChildID(), 501 io_data, info->GetChildID(),
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, 886 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad,
884 base::Unretained(this), url, request_loading_time)); 887 base::Unretained(this), url, request_loading_time));
885 return; 888 return;
886 } 889 }
887 890
888 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? 891 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ?
889 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); 892 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow");
890 rappor::SampleDomainAndRegistryFromGURL( 893 rappor::SampleDomainAndRegistryFromGURL(
891 g_browser_process->rappor_service(), metric_name, url); 894 g_browser_process->rappor_service(), metric_name, url);
892 } 895 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698