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 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
767 // show the profile avatar bubble so that user can complete signin/out action | 767 // show the profile avatar bubble so that user can complete signin/out action |
768 // the native UI. | 768 // the native UI. |
769 signin::ProcessMirrorResponseHeaderIfExists(request, io_data, | 769 signin::ProcessMirrorResponseHeaderIfExists(request, io_data, |
770 info->GetChildID(), | 770 info->GetChildID(), |
771 info->GetRouteID()); | 771 info->GetRouteID()); |
772 | 772 |
773 // Built-in additional protection for the chrome web store origin. | 773 // Built-in additional protection for the chrome web store origin. |
774 #if BUILDFLAG(ENABLE_EXTENSIONS) | 774 #if BUILDFLAG(ENABLE_EXTENSIONS) |
775 GURL webstore_url(extension_urls::GetWebstoreLaunchURL()); | 775 GURL webstore_url(extension_urls::GetWebstoreLaunchURL()); |
776 if (request->url().SchemeIsHTTPOrHTTPS() && | 776 if (request->url().SchemeIsHTTPOrHTTPS() && |
777 request->url().DomainIs(webstore_url.host().c_str())) { | 777 request->url().DomainIs(webstore_url.host())) { |
Charlie Harrison
2017/01/10 00:20:35
Drive-by: this does a string copy. You should use
Andrey Kraynov
2017/01/10 11:15:18
Thanks for pointing!
Done.
| |
778 net::HttpResponseHeaders* response_headers = request->response_headers(); | 778 net::HttpResponseHeaders* response_headers = request->response_headers(); |
779 if (response_headers && | 779 if (response_headers && |
780 !response_headers->HasHeaderValue("x-frame-options", "deny") && | 780 !response_headers->HasHeaderValue("x-frame-options", "deny") && |
781 !response_headers->HasHeaderValue("x-frame-options", "sameorigin")) { | 781 !response_headers->HasHeaderValue("x-frame-options", "sameorigin")) { |
782 response_headers->RemoveHeader("x-frame-options"); | 782 response_headers->RemoveHeader("x-frame-options"); |
783 response_headers->AddHeader("x-frame-options: sameorigin"); | 783 response_headers->AddHeader("x-frame-options: sameorigin"); |
784 } | 784 } |
785 } | 785 } |
786 #endif | 786 #endif |
787 | 787 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
895 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, | 895 base::Bind(&ChromeResourceDispatcherHostDelegate::OnAbortedFrameLoad, |
896 base::Unretained(this), url, request_loading_time)); | 896 base::Unretained(this), url, request_loading_time)); |
897 return; | 897 return; |
898 } | 898 } |
899 | 899 |
900 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? | 900 std::string metric_name = (request_loading_time.InMilliseconds() < 100 ? |
901 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); | 901 "Net.ErrAborted.Fast" : "Net.ErrAborted.Slow"); |
902 rappor::SampleDomainAndRegistryFromGURL( | 902 rappor::SampleDomainAndRegistryFromGURL( |
903 g_browser_process->rappor_service(), metric_name, url); | 903 g_browser_process->rappor_service(), metric_name, url); |
904 } | 904 } |
OLD | NEW |