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 #ifndef CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ |
6 #define CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ | 6 #define CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 class TargetPolicy; | 42 class TargetPolicy; |
43 } | 43 } |
44 | 44 |
45 namespace content { | 45 namespace content { |
46 | 46 |
47 class ContentBrowserClient; | 47 class ContentBrowserClient; |
48 class ContentClient; | 48 class ContentClient; |
49 class ContentGpuClient; | 49 class ContentGpuClient; |
50 class ContentRendererClient; | 50 class ContentRendererClient; |
51 class ContentUtilityClient; | 51 class ContentUtilityClient; |
| 52 class OriginTrialPolicy; |
52 struct CdmInfo; | 53 struct CdmInfo; |
53 struct PepperPluginInfo; | 54 struct PepperPluginInfo; |
54 | 55 |
55 // Setter and getter for the client. The client should be set early, before any | 56 // Setter and getter for the client. The client should be set early, before any |
56 // content code is called. | 57 // content code is called. |
57 CONTENT_EXPORT void SetContentClient(ContentClient* client); | 58 CONTENT_EXPORT void SetContentClient(ContentClient* client); |
58 | 59 |
59 #if defined(CONTENT_IMPLEMENTATION) | 60 #if defined(CONTENT_IMPLEMENTATION) |
60 // Content's embedder API should only be used by content. | 61 // Content's embedder API should only be used by content. |
61 ContentClient* GetContentClient(); | 62 ContentClient* GetContentClient(); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // out-of-process iframes, and causes the content layer to consult | 167 // out-of-process iframes, and causes the content layer to consult |
167 // ContentBrowserClient::DoesSiteRequireDedicatedProcess() when making process | 168 // ContentBrowserClient::DoesSiteRequireDedicatedProcess() when making process |
168 // model decisions. | 169 // model decisions. |
169 virtual bool IsSupplementarySiteIsolationModeEnabled(); | 170 virtual bool IsSupplementarySiteIsolationModeEnabled(); |
170 | 171 |
171 // Called by the renderer after the render thread has started, and allows the | 172 // Called by the renderer after the render thread has started, and allows the |
172 // embedder to set up any global origin trial policies (custom public key, or | 173 // embedder to set up any global origin trial policies (custom public key, or |
173 // disabled experiments) | 174 // disabled experiments) |
174 virtual void InitializeOriginTrialPolicy(); | 175 virtual void InitializeOriginTrialPolicy(); |
175 | 176 |
176 // Returns the public key to be used for origin trials, or an empty string if | 177 // Returns the origin trial policy, or nullptr if origin trials are not |
177 // origin trials are not enabled in this context. | 178 // supported by the embedder. |
178 virtual base::StringPiece GetOriginTrialPublicKey() const; | 179 virtual const OriginTrialPolicy* GetOriginTrialPolicy() const; |
179 | |
180 // Returns true if the named experimental feature should be disabled in origin | |
181 // trials, even if a valid token is present. | |
182 virtual bool IsOriginTrialFeatureDisabled(base::StringPiece feature) const; | |
183 | 180 |
184 #if defined(OS_ANDROID) | 181 #if defined(OS_ANDROID) |
185 // Returns true for clients like Android WebView that uses synchronous | 182 // Returns true for clients like Android WebView that uses synchronous |
186 // compositor. Note setting this to true will permit synchronous IPCs from | 183 // compositor. Note setting this to true will permit synchronous IPCs from |
187 // the browser UI thread. | 184 // the browser UI thread. |
188 virtual bool UsingSynchronousCompositing(); | 185 virtual bool UsingSynchronousCompositing(); |
189 | 186 |
190 // Returns the MediaClientAndroid to be used by media code on Android. | 187 // Returns the MediaClientAndroid to be used by media code on Android. |
191 virtual media::MediaClientAndroid* GetMediaClientAndroid(); | 188 virtual media::MediaClientAndroid* GetMediaClientAndroid(); |
192 #endif // OS_ANDROID | 189 #endif // OS_ANDROID |
193 | 190 |
194 private: | 191 private: |
195 friend class ContentClientInitializer; // To set these pointers. | 192 friend class ContentClientInitializer; // To set these pointers. |
196 friend class InternalTestInitializer; | 193 friend class InternalTestInitializer; |
197 | 194 |
198 // The embedder API for participating in browser logic. | 195 // The embedder API for participating in browser logic. |
199 ContentBrowserClient* browser_; | 196 ContentBrowserClient* browser_; |
200 // The embedder API for participating in gpu logic. | 197 // The embedder API for participating in gpu logic. |
201 ContentGpuClient* gpu_; | 198 ContentGpuClient* gpu_; |
202 // The embedder API for participating in renderer logic. | 199 // The embedder API for participating in renderer logic. |
203 ContentRendererClient* renderer_; | 200 ContentRendererClient* renderer_; |
204 // The embedder API for participating in utility logic. | 201 // The embedder API for participating in utility logic. |
205 ContentUtilityClient* utility_; | 202 ContentUtilityClient* utility_; |
206 }; | 203 }; |
207 | 204 |
208 } // namespace content | 205 } // namespace content |
209 | 206 |
210 #endif // CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ | 207 #endif // CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ |
OLD | NEW |