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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2220603003: Remove unnecessary |result| argument from AllowCertificateError() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unnecessary include 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/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 2019 matching lines...) Expand 10 before | Expand all | Expand 10 after
2030 2030
2031 void ChromeContentBrowserClient::AllowCertificateError( 2031 void ChromeContentBrowserClient::AllowCertificateError(
2032 content::WebContents* web_contents, 2032 content::WebContents* web_contents,
2033 int cert_error, 2033 int cert_error,
2034 const net::SSLInfo& ssl_info, 2034 const net::SSLInfo& ssl_info,
2035 const GURL& request_url, 2035 const GURL& request_url,
2036 ResourceType resource_type, 2036 ResourceType resource_type,
2037 bool overridable, 2037 bool overridable,
2038 bool strict_enforcement, 2038 bool strict_enforcement,
2039 bool expired_previous_decision, 2039 bool expired_previous_decision,
2040 const base::Callback<void(bool)>& callback, 2040 const base::Callback<void(content::CertificateRequestResultType)>&
2041 content::CertificateRequestResultType* result) { 2041 callback) {
2042 DCHECK(web_contents); 2042 DCHECK(web_contents);
2043 if (resource_type != content::RESOURCE_TYPE_MAIN_FRAME) { 2043 if (resource_type != content::RESOURCE_TYPE_MAIN_FRAME) {
2044 // A sub-resource has a certificate error. The user doesn't really 2044 // A sub-resource has a certificate error. The user doesn't really
2045 // have a context for making the right decision, so block the 2045 // have a context for making the right decision, so block the
2046 // request hard, without an info bar to allow showing the insecure 2046 // request hard, without an info bar to allow showing the insecure
2047 // content. 2047 // content.
2048 *result = content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY; 2048 if (!callback.is_null())
2049 callback.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY);
2049 return; 2050 return;
2050 } 2051 }
2051 2052
2052 // If the tab is being prerendered, cancel the prerender and the request. 2053 // If the tab is being prerendered, cancel the prerender and the request.
2053 prerender::PrerenderContents* prerender_contents = 2054 prerender::PrerenderContents* prerender_contents =
2054 prerender::PrerenderContents::FromWebContents(web_contents); 2055 prerender::PrerenderContents::FromWebContents(web_contents);
2055 if (prerender_contents) { 2056 if (prerender_contents) {
2056 prerender_contents->Destroy(prerender::FINAL_STATUS_SSL_ERROR); 2057 prerender_contents->Destroy(prerender::FINAL_STATUS_SSL_ERROR);
2057 *result = content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL; 2058 if (!callback.is_null()) {
2059 callback.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL);
2060 }
2058 return; 2061 return;
2059 } 2062 }
2060 2063
2061 // Otherwise, display an SSL blocking page. The interstitial page takes 2064 // Otherwise, display an SSL blocking page. The interstitial page takes
2062 // ownership of ssl_blocking_page. 2065 // ownership of ssl_blocking_page.
2063 int options_mask = 0; 2066 int options_mask = 0;
2064 if (overridable) 2067 if (overridable)
2065 options_mask |= SSLErrorUI::SOFT_OVERRIDE_ENABLED; 2068 options_mask |= SSLErrorUI::SOFT_OVERRIDE_ENABLED;
2066 if (strict_enforcement) 2069 if (strict_enforcement)
2067 options_mask |= SSLErrorUI::STRICT_ENFORCEMENT; 2070 options_mask |= SSLErrorUI::STRICT_ENFORCEMENT;
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
3058 if (channel <= kMaxDisableEncryptionChannel) { 3061 if (channel <= kMaxDisableEncryptionChannel) {
3059 static const char* const kWebRtcDevSwitchNames[] = { 3062 static const char* const kWebRtcDevSwitchNames[] = {
3060 switches::kDisableWebRtcEncryption, 3063 switches::kDisableWebRtcEncryption,
3061 }; 3064 };
3062 to_command_line->CopySwitchesFrom(from_command_line, 3065 to_command_line->CopySwitchesFrom(from_command_line,
3063 kWebRtcDevSwitchNames, 3066 kWebRtcDevSwitchNames,
3064 arraysize(kWebRtcDevSwitchNames)); 3067 arraysize(kWebRtcDevSwitchNames));
3065 } 3068 }
3066 } 3069 }
3067 #endif // defined(ENABLE_WEBRTC) 3070 #endif // defined(ENABLE_WEBRTC)
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/ssl/bad_clock_blocking_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698