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" |
(...skipping 16 matching lines...) Expand all Loading... |
27 static GURL GetEffectiveURL(Profile* profile, const GURL& url); | 27 static GURL GetEffectiveURL(Profile* profile, const GURL& url); |
28 static bool ShouldUseProcessPerSite(Profile* profile, | 28 static bool ShouldUseProcessPerSite(Profile* profile, |
29 const GURL& effective_url); | 29 const GURL& effective_url); |
30 static bool DoesSiteRequireDedicatedProcess( | 30 static bool DoesSiteRequireDedicatedProcess( |
31 content::BrowserContext* browser_context, | 31 content::BrowserContext* browser_context, |
32 const GURL& effective_site_url); | 32 const GURL& effective_site_url); |
33 static bool ShouldLockToOrigin(content::BrowserContext* browser_context, | 33 static bool ShouldLockToOrigin(content::BrowserContext* browser_context, |
34 const GURL& effective_site_url); | 34 const GURL& effective_site_url); |
35 static bool CanCommitURL(content::RenderProcessHost* process_host, | 35 static bool CanCommitURL(content::RenderProcessHost* process_host, |
36 const GURL& url); | 36 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, | 37 static bool IsSuitableHost(Profile* profile, |
41 content::RenderProcessHost* process_host, | 38 content::RenderProcessHost* process_host, |
42 const GURL& site_url); | 39 const GURL& site_url); |
43 static bool ShouldTryToUseExistingProcessHost(Profile* profile, | 40 static bool ShouldTryToUseExistingProcessHost(Profile* profile, |
44 const GURL& url); | 41 const GURL& url); |
45 static bool ShouldSwapBrowsingInstancesForNavigation( | 42 static bool ShouldSwapBrowsingInstancesForNavigation( |
46 content::SiteInstance* site_instance, | 43 content::SiteInstance* site_instance, |
47 const GURL& current_url, | 44 const GURL& current_url, |
48 const GURL& new_url); | 45 const GURL& new_url); |
49 static bool ShouldSwapProcessesForRedirect( | 46 static bool ShouldSwapProcessesForRedirect( |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 void GetURLRequestAutoMountHandlers( | 81 void GetURLRequestAutoMountHandlers( |
85 std::vector<storage::URLRequestAutoMountHandler>* handlers) override; | 82 std::vector<storage::URLRequestAutoMountHandler>* handlers) override; |
86 void GetAdditionalFileSystemBackends( | 83 void GetAdditionalFileSystemBackends( |
87 content::BrowserContext* browser_context, | 84 content::BrowserContext* browser_context, |
88 const base::FilePath& storage_partition_path, | 85 const base::FilePath& storage_partition_path, |
89 ScopedVector<storage::FileSystemBackend>* additional_backends) override; | 86 ScopedVector<storage::FileSystemBackend>* additional_backends) override; |
90 void AppendExtraRendererCommandLineSwitches( | 87 void AppendExtraRendererCommandLineSwitches( |
91 base::CommandLine* command_line, | 88 base::CommandLine* command_line, |
92 content::RenderProcessHost* process, | 89 content::RenderProcessHost* process, |
93 Profile* profile) override; | 90 Profile* profile) override; |
| 91 void ResourceDispatcherHostCreated() override; |
| 92 |
| 93 // This callback is registered on the ResourceDispatcherHost for the chrome |
| 94 // extension Origin scheme. We determine whether the extension origin is |
| 95 // valid. Please see the IsIllegalOrigin() function. |
| 96 static void OnHttpHeaderReceived( |
| 97 const std::string& header, |
| 98 const std::string& value, |
| 99 int child_id, |
| 100 content::ResourceContext* resource_context, |
| 101 content::OnHeaderProcessedCallback callback); |
| 102 |
| 103 // Determines whether the extension |origin| passed in can be committed by |
| 104 // the process identified by |child_id| and returns true or false |
| 105 // accordingly. Please refer to the implementation for more information. |
| 106 static bool IsIllegalOrigin(content::ResourceContext* resource_context, |
| 107 int child_id, |
| 108 const GURL& origin); |
94 | 109 |
95 DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClientExtensionsPart); | 110 DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClientExtensionsPart); |
96 }; | 111 }; |
97 | 112 |
98 } // namespace extensions | 113 } // namespace extensions |
99 | 114 |
100 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PA
RT_H_ | 115 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_BROWSER_CLIENT_EXTENSIONS_PA
RT_H_ |
101 | 116 |
OLD | NEW |