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

Side by Side Diff: chrome/browser/extensions/chrome_content_browser_client_extensions_part.h

Issue 2787573003: Remove DumpWithoutCrashing from ShouldAllowOpenURL. (Closed)
Patch Set: Fix unit_tests compile error Created 3 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PART_ H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PART_ H_
6 #define CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PART_ H_ 6 #define CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PART_ H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "chrome/browser/chrome_content_browser_client_parts.h" 10 #include "chrome/browser/chrome_content_browser_client_parts.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 // Helper function to call InfoMap::SetSigninProcess(). 66 // Helper function to call InfoMap::SetSigninProcess().
67 static void SetSigninProcess(content::SiteInstance* site_instance); 67 static void SetSigninProcess(content::SiteInstance* site_instance);
68 68
69 // Creates a new VpnServiceProxy. The caller owns the returned value. It's 69 // Creates a new VpnServiceProxy. The caller owns the returned value. It's
70 // valid to return nullptr. 70 // valid to return nullptr.
71 static std::unique_ptr<content::VpnServiceProxy> GetVpnServiceProxy( 71 static std::unique_ptr<content::VpnServiceProxy> GetVpnServiceProxy(
72 content::BrowserContext* browser_context); 72 content::BrowserContext* browser_context);
73 73
74 private: 74 private:
75 FRIEND_TEST_ALL_PREFIXES(ChromeContentBrowserClientExtensionsPartTest,
76 ShouldAllowOpenURLMetricsForEmptySiteURL);
77 FRIEND_TEST_ALL_PREFIXES(ChromeContentBrowserClientExtensionsPartTest,
78 ShouldAllowOpenURLMetricsForKnownSchemes);
79
80 // Specifies reasons why web-accessible resource checks in ShouldAllowOpenURL
81 // might fail.
82 //
83 // This enum backs an UMA histogram. The order of existing values
84 // should not be changed, and new values should only be added before
85 // FAILURE_LAST.
86 enum ShouldAllowOpenURLFailureReason {
87 FAILURE_FILE_SYSTEM_URL = 0,
88 FAILURE_BLOB_URL,
89 FAILURE_SCHEME_NOT_HTTP_OR_HTTPS_OR_EXTENSION,
90 FAILURE_RESOURCE_NOT_WEB_ACCESSIBLE,
91 FAILURE_LAST,
92 };
93
94 // Records metrics when ShouldAllowOpenURL blocks a load. |site_url|
95 // corresponds to the SiteInstance that initiated the blocked load.
96 static void RecordShouldAllowOpenURLFailure(
97 ShouldAllowOpenURLFailureReason reason,
98 GURL site_url);
Devlin 2017/04/05 01:11:57 const &
alexmos 2017/04/05 17:24:51 Done.
99
75 // ChromeContentBrowserClientParts: 100 // ChromeContentBrowserClientParts:
76 void RenderProcessWillLaunch(content::RenderProcessHost* host) override; 101 void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
77 void SiteInstanceGotProcess(content::SiteInstance* site_instance) override; 102 void SiteInstanceGotProcess(content::SiteInstance* site_instance) override;
78 void SiteInstanceDeleting(content::SiteInstance* site_instance) override; 103 void SiteInstanceDeleting(content::SiteInstance* site_instance) override;
79 void OverrideWebkitPrefs(content::RenderViewHost* rvh, 104 void OverrideWebkitPrefs(content::RenderViewHost* rvh,
80 content::WebPreferences* web_prefs) override; 105 content::WebPreferences* web_prefs) override;
81 void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) override; 106 void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) override;
82 void GetAdditionalAllowedSchemesForFileSystem( 107 void GetAdditionalAllowedSchemesForFileSystem(
83 std::vector<std::string>* additional_allowed_schemes) override; 108 std::vector<std::string>* additional_allowed_schemes) override;
84 void GetURLRequestAutoMountHandlers( 109 void GetURLRequestAutoMountHandlers(
85 std::vector<storage::URLRequestAutoMountHandler>* handlers) override; 110 std::vector<storage::URLRequestAutoMountHandler>* handlers) override;
86 void GetAdditionalFileSystemBackends( 111 void GetAdditionalFileSystemBackends(
87 content::BrowserContext* browser_context, 112 content::BrowserContext* browser_context,
88 const base::FilePath& storage_partition_path, 113 const base::FilePath& storage_partition_path,
89 std::vector<std::unique_ptr<storage::FileSystemBackend>>* 114 std::vector<std::unique_ptr<storage::FileSystemBackend>>*
90 additional_backends) override; 115 additional_backends) override;
91 void AppendExtraRendererCommandLineSwitches( 116 void AppendExtraRendererCommandLineSwitches(
92 base::CommandLine* command_line, 117 base::CommandLine* command_line,
93 content::RenderProcessHost* process, 118 content::RenderProcessHost* process,
94 Profile* profile) override; 119 Profile* profile) override;
95 void ResourceDispatcherHostCreated() override; 120 void ResourceDispatcherHostCreated() override;
96 121
97 DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClientExtensionsPart); 122 DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClientExtensionsPart);
98 }; 123 };
99 124
100 } // namespace extensions 125 } // namespace extensions
101 126
102 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PA RT_H_ 127 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PA RT_H_
103 128
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698