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

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

Issue 2258483002: X-Chrome-Connected is stripped when it should not be in headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months 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/renderer_host/chrome_resource_dispatcher_host_delegate. h" 5 #include "chrome/browser/renderer_host/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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 variations::AppendVariationHeaders( 467 variations::AppendVariationHeaders(
468 request->url(), is_off_the_record, 468 request->url(), is_off_the_record,
469 !is_off_the_record && io_data->GetMetricsEnabledStateOnIOThread(), 469 !is_off_the_record && io_data->GetMetricsEnabledStateOnIOThread(),
470 &headers); 470 &headers);
471 request->SetExtraRequestHeaders(headers); 471 request->SetExtraRequestHeaders(headers);
472 } 472 }
473 473
474 if (io_data->policy_header_helper()) 474 if (io_data->policy_header_helper())
475 io_data->policy_header_helper()->AddPolicyHeaders(request->url(), request); 475 io_data->policy_header_helper()->AddPolicyHeaders(request->url(), request);
476 476
477 signin::AppendMirrorRequestHeaderHelper(request, GURL() /* redirect_url */, 477 signin::FixMirrorRequestHeaderHelper(request, GURL() /* redirect_url */,
478 io_data, info->GetChildID(), 478 io_data, info->GetChildID(),
479 info->GetRouteID()); 479 info->GetRouteID());
480 480
481 AppendStandardResourceThrottles(request, 481 AppendStandardResourceThrottles(request,
482 resource_context, 482 resource_context,
483 resource_type, 483 resource_type,
484 throttles); 484 throttles);
485 #if !defined(DISABLE_NACL) 485 #if !defined(DISABLE_NACL)
486 if (!is_prerendering) { 486 if (!is_prerendering) {
487 AppendComponentUpdaterThrottles(request, 487 AppendComponentUpdaterThrottles(request,
488 resource_context, 488 resource_context,
489 resource_type, 489 resource_type,
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 793
794 void ChromeResourceDispatcherHostDelegate::OnRequestRedirected( 794 void ChromeResourceDispatcherHostDelegate::OnRequestRedirected(
795 const GURL& redirect_url, 795 const GURL& redirect_url,
796 net::URLRequest* request, 796 net::URLRequest* request,
797 content::ResourceContext* resource_context, 797 content::ResourceContext* resource_context,
798 content::ResourceResponse* response) { 798 content::ResourceResponse* response) {
799 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); 799 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
800 800
801 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); 801 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);
802 802
803 // In the Mirror world, Chrome should append a X-Chrome-Connected header to 803 // In the Mirror world, Chrome should append a X-Chrome-Connected header to
eroman 2016/08/23 20:02:36 What is the Mirror world? Is this a public project
Ramin Halavati 2016/08/26 17:04:31 Added a comment.
804 // all Gaia requests from a connected profile so Gaia could return a 204 804 // all Gaia requests from a connected profile so Gaia could return a 204
805 // response and let Chrome handle the action with native UI. The only 805 // response and let Chrome handle the action with native UI. The only
806 // exception is requests from gaia webview, since the native profile 806 // exception is requests from gaia webview, since the native profile
807 // management UI is built on top of it. 807 // management UI is built on top of it.
808 signin::AppendMirrorRequestHeaderHelper( 808 signin::FixMirrorRequestHeaderHelper(
809 request, redirect_url, io_data, info->GetChildID(), info->GetRouteID()); 809 request, redirect_url, io_data, info->GetChildID(), info->GetRouteID());
810 810
811 if (io_data->resource_prefetch_predictor_observer()) { 811 if (io_data->resource_prefetch_predictor_observer()) {
812 io_data->resource_prefetch_predictor_observer()->OnRequestRedirected( 812 io_data->resource_prefetch_predictor_observer()->OnRequestRedirected(
813 redirect_url, request); 813 redirect_url, request);
814 } 814 }
815 815
816 if (io_data->policy_header_helper()) 816 if (io_data->policy_header_helper())
817 io_data->policy_header_helper()->AddPolicyHeaders(redirect_url, request); 817 io_data->policy_header_helper()->AddPolicyHeaders(redirect_url, request);
818 } 818 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, 890 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad,
891 base::Unretained(this), url, request_loading_time)); 891 base::Unretained(this), url, request_loading_time));
892 return; 892 return;
893 } 893 }
894 894
895 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? 895 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ?
896 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); 896 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow");
897 rappor::SampleDomainAndRegistryFromGURL( 897 rappor::SampleDomainAndRegistryFromGURL(
898 g_browser_process->rappor_service(), metric_name, url); 898 g_browser_process->rappor_service(), metric_name, url);
899 } 899 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698