OLD | NEW |
---|---|
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" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 class ResourceContext; | 13 class ResourceContext; |
14 class VpnServiceProxy; | 14 class VpnServiceProxy; |
15 } | 15 } |
16 | 16 |
17 namespace extensions { | 17 namespace extensions { |
18 | 18 |
19 class Extension; | |
20 class InfoMap; | |
21 | |
19 // Implements the extensions portion of ChromeContentBrowserClient. | 22 // Implements the extensions portion of ChromeContentBrowserClient. |
20 class ChromeContentBrowserClientExtensionsPart | 23 class ChromeContentBrowserClientExtensionsPart |
21 : public ChromeContentBrowserClientParts { | 24 : public ChromeContentBrowserClientParts { |
22 public: | 25 public: |
23 ChromeContentBrowserClientExtensionsPart(); | 26 ChromeContentBrowserClientExtensionsPart(); |
24 ~ChromeContentBrowserClientExtensionsPart() override; | 27 ~ChromeContentBrowserClientExtensionsPart() override; |
25 | 28 |
26 // Corresponds to the ChromeContentBrowserClient function of the same name. | 29 // Corresponds to the ChromeContentBrowserClient function of the same name. |
27 static GURL GetEffectiveURL(Profile* profile, const GURL& url); | 30 static GURL GetEffectiveURL(Profile* profile, const GURL& url); |
28 static bool ShouldUseProcessPerSite(Profile* profile, | 31 static bool ShouldUseProcessPerSite(Profile* profile, |
29 const GURL& effective_url); | 32 const GURL& effective_url); |
30 static bool DoesSiteRequireDedicatedProcess( | 33 static bool DoesSiteRequireDedicatedProcess( |
31 content::BrowserContext* browser_context, | 34 content::BrowserContext* browser_context, |
32 const GURL& effective_site_url); | 35 const GURL& effective_site_url); |
33 static bool ShouldLockToOrigin(content::BrowserContext* browser_context, | 36 static bool ShouldLockToOrigin(content::BrowserContext* browser_context, |
34 const GURL& effective_site_url); | 37 const GURL& effective_site_url); |
35 static bool CanCommitURL(content::RenderProcessHost* process_host, | 38 static bool CanCommitURL(content::RenderProcessHost* process_host, |
36 const GURL& url); | 39 const GURL& url); |
37 static bool IsIllegalOrigin(content::ResourceContext* resource_context, | |
38 int child_process_id, | |
39 const GURL& origin); | |
40 static bool IsSuitableHost(Profile* profile, | 40 static bool IsSuitableHost(Profile* profile, |
41 content::RenderProcessHost* process_host, | 41 content::RenderProcessHost* process_host, |
42 const GURL& site_url); | 42 const GURL& site_url); |
43 static bool ShouldTryToUseExistingProcessHost(Profile* profile, | 43 static bool ShouldTryToUseExistingProcessHost(Profile* profile, |
44 const GURL& url); | 44 const GURL& url); |
45 static bool ShouldSwapBrowsingInstancesForNavigation( | 45 static bool ShouldSwapBrowsingInstancesForNavigation( |
46 content::SiteInstance* site_instance, | 46 content::SiteInstance* site_instance, |
47 const GURL& current_url, | 47 const GURL& current_url, |
48 const GURL& new_url); | 48 const GURL& new_url); |
49 static bool ShouldSwapProcessesForRedirect( | 49 static bool ShouldSwapProcessesForRedirect( |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 std::vector<storage::URLRequestAutoMountHandler>* handlers) override; | 85 std::vector<storage::URLRequestAutoMountHandler>* handlers) override; |
86 void GetAdditionalFileSystemBackends( | 86 void GetAdditionalFileSystemBackends( |
87 content::BrowserContext* browser_context, | 87 content::BrowserContext* browser_context, |
88 const base::FilePath& storage_partition_path, | 88 const base::FilePath& storage_partition_path, |
89 ScopedVector<storage::FileSystemBackend>* additional_backends) override; | 89 ScopedVector<storage::FileSystemBackend>* additional_backends) override; |
90 void AppendExtraRendererCommandLineSwitches( | 90 void AppendExtraRendererCommandLineSwitches( |
91 base::CommandLine* command_line, | 91 base::CommandLine* command_line, |
92 content::RenderProcessHost* process, | 92 content::RenderProcessHost* process, |
93 Profile* profile) override; | 93 Profile* profile) override; |
94 | 94 |
95 // Helper functions to register and unregister an extension process. Invoked | |
jam
2016/08/02 17:01:46
nit: since they're just static private methods, no
ananta
2016/08/02 22:28:27
Done.
| |
96 // on the IO thread. | |
97 static void RegisterExtensionProcessHelper( | |
98 InfoMap* info_map, | |
99 const Extension* extension, | |
100 int process_id, | |
101 int site_instance_id, | |
102 const content::ResourceContext* context); | |
103 | |
104 static void UnregisterExtensionProcessHelper( | |
105 InfoMap* info_map, | |
106 const Extension* extension, | |
107 int process_id, | |
108 int site_instance_id, | |
109 const content::ResourceContext* context); | |
110 | |
95 DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClientExtensionsPart); | 111 DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClientExtensionsPart); |
96 }; | 112 }; |
97 | 113 |
98 } // namespace extensions | 114 } // namespace extensions |
99 | 115 |
100 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PA RT_H_ | 116 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PA RT_H_ |
101 | 117 |
OLD | NEW |