content_browser_client.h revision a1401311d1ab56c4ed0a474bd38c108f75cb0cd9
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
3// found in the LICENSE file.
4
5#ifndef CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
6#define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
7
8#include <map>
9#include <string>
10#include <utility>
11#include <vector>
12
13#include "base/callback_forward.h"
14#include "base/memory/linked_ptr.h"
15#include "base/memory/scoped_ptr.h"
16#include "base/memory/scoped_vector.h"
17#include "base/values.h"
18#include "content/public/browser/certificate_request_result_type.h"
19#include "content/public/common/content_client.h"
20#include "content/public/common/socket_permission_request.h"
21#include "content/public/common/window_container_type.h"
22#include "net/base/mime_util.h"
23#include "net/cookies/canonical_cookie.h"
24#include "net/url_request/url_request_job_factory.h"
25#include "third_party/WebKit/public/web/WebNotificationPresenter.h"
26#include "ui/base/window_open_disposition.h"
27#include "webkit/common/resource_type.h"
28
29#if defined(OS_POSIX) && !defined(OS_MACOSX)
30#include "base/posix/global_descriptors.h"
31#endif
32
33#if defined(OS_POSIX)
34#include "content/public/browser/file_descriptor_info.h"
35#endif
36
37class GURL;
38struct WebPreferences;
39
40namespace base {
41class CommandLine;
42class DictionaryValue;
43class FilePath;
44}
45
46namespace blink {
47struct WebWindowFeatures;
48}
49
50namespace gfx {
51class ImageSkia;
52}
53
54namespace net {
55class CookieOptions;
56class CookieStore;
57class HttpNetworkSession;
58class NetLog;
59class SSLCertRequestInfo;
60class SSLInfo;
61class URLRequest;
62class URLRequestContext;
63class URLRequestContextGetter;
64class X509Certificate;
65}
66
67namespace sandbox {
68class TargetPolicy;
69}
70
71namespace ui {
72class SelectFilePolicy;
73}
74
75namespace fileapi {
76class ExternalMountPoints;
77class FileSystemBackend;
78}
79
80namespace content {
81
82class AccessTokenStore;
83class BrowserChildProcessHost;
84class BrowserContext;
85class BrowserMainParts;
86class BrowserPluginGuestDelegate;
87class BrowserPpapiHost;
88class BrowserURLHandler;
89class LocationProvider;
90class MediaObserver;
91class QuotaPermissionContext;
92class RenderProcessHost;
93class RenderViewHost;
94class RenderViewHostDelegateView;
95class ResourceContext;
96class SiteInstance;
97class SpeechRecognitionManagerDelegate;
98class VibrationProvider;
99class WebContents;
100class WebContentsViewDelegate;
101class WebContentsViewPort;
102struct MainFunctionParams;
103struct Referrer;
104struct ShowDesktopNotificationHostMsgParams;
105
106// A mapping from the scheme name to the protocol handler that services its
107// content.
108typedef std::map<
109  std::string, linked_ptr<net::URLRequestJobFactory::ProtocolHandler> >
110    ProtocolHandlerMap;
111
112// A scoped vector of protocol handlers.
113typedef ScopedVector<net::URLRequestJobFactory::ProtocolHandler>
114    ProtocolHandlerScopedVector;
115
116// Embedder API (or SPI) for participating in browser logic, to be implemented
117// by the client of the content browser. See ChromeContentBrowserClient for the
118// principal implementation. The methods are assumed to be called on the UI
119// thread unless otherwise specified. Use this "escape hatch" sparingly, to
120// avoid the embedder interface ballooning and becoming very specific to Chrome.
121// (Often, the call out to the client can happen in a different part of the code
122// that either already has a hook out to the embedder, or calls out to one of
123// the observer interfaces.)
124class CONTENT_EXPORT ContentBrowserClient {
125 public:
126  virtual ~ContentBrowserClient() {}
127
128  // Allows the embedder to set any number of custom BrowserMainParts
129  // implementations for the browser startup code. See comments in
130  // browser_main_parts.h.
131  virtual BrowserMainParts* CreateBrowserMainParts(
132      const MainFunctionParams& parameters);
133
134  // Allows an embedder to return their own WebContentsViewPort implementation.
135  // Return NULL to let the default one for the platform be created. Otherwise
136  // |render_view_host_delegate_view| also needs to be provided, and it is
137  // owned by the embedder.
138  virtual WebContentsViewPort* OverrideCreateWebContentsView(
139      WebContents* web_contents,
140      RenderViewHostDelegateView** render_view_host_delegate_view);
141
142  // If content creates the WebContentsView implementation, it will ask the
143  // embedder to return an (optional) delegate to customize it. The view will
144  // own the delegate.
145  virtual WebContentsViewDelegate* GetWebContentsViewDelegate(
146      WebContents* web_contents);
147
148  // Notifies that a guest WebContents has been created. A guest WebContents
149  // represents a renderer that's hosted within a BrowserPlugin. Creation can
150  // occur an arbitrary length of time before attachment. If the new guest has
151  // an |opener_web_contents|, then it's a new window created by that opener.
152  // If the guest was created via navigation, then |extra_params| will be
153  // non-NULL. |extra_params| are parameters passed to the BrowserPlugin object
154  // element by the content embedder. These parameters may include the API to
155  // enable for the given guest. |guest_delegate| is a return parameter of
156  // the delegate in the content embedder that will service the guest in the
157  // content layer. The content layer takes ownership of the |guest_delegate|.
158  virtual void GuestWebContentsCreated(
159      SiteInstance* guest_site_instance,
160      WebContents* guest_web_contents,
161      WebContents* opener_web_contents,
162      BrowserPluginGuestDelegate** guest_delegate,
163      scoped_ptr<base::DictionaryValue> extra_params) {}
164
165  // Notifies that a guest WebContents has been attached to a BrowserPlugin.
166  // A guest is attached to a BrowserPlugin when the guest has acquired an
167  // embedder WebContents. This happens on initial navigation or when a new
168  // window is attached to a BrowserPlugin. |extra_params| are params sent
169  // from javascript.
170  virtual void GuestWebContentsAttached(
171      WebContents* guest_web_contents,
172      WebContents* embedder_web_contents,
173      const base::DictionaryValue& extra_params) {}
174
175  // Notifies that a render process will be created. This is called before
176  // the content layer adds its own BrowserMessageFilters, so that the
177  // embedder's IPC filters have priority.
178  virtual void RenderProcessWillLaunch(RenderProcessHost* host) {}
179
180  // Notifies that a BrowserChildProcessHost has been created.
181  virtual void BrowserChildProcessHostCreated(BrowserChildProcessHost* host) {}
182
183  // Get the effective URL for the given actual URL, to allow an embedder to
184  // group different url schemes in the same SiteInstance.
185  virtual GURL GetEffectiveURL(BrowserContext* browser_context,
186                               const GURL& url);
187
188  // Returns whether all instances of the specified effective URL should be
189  // rendered by the same process, rather than using process-per-site-instance.
190  virtual bool ShouldUseProcessPerSite(BrowserContext* browser_context,
191                                       const GURL& effective_url);
192
193  // Returns a list additional WebUI schemes, if any.  These additional schemes
194  // act as aliases to the chrome: scheme.  The additional schemes may or may
195  // not serve specific WebUI pages depending on the particular URLDataSource
196  // and its override of URLDataSource::ShouldServiceRequest. For all schemes
197  // returned here, view-source is allowed.
198  virtual void GetAdditionalWebUISchemes(
199      std::vector<std::string>* additional_schemes) {}
200
201  // Returns a list of webUI hosts to ignore the storage partition check in
202  // URLRequestChromeJob::CheckStoragePartitionMatches.
203  virtual void GetAdditionalWebUIHostsToIgnoreParititionCheck(
204      std::vector<std::string>* hosts) {}
205
206  // Creates the main net::URLRequestContextGetter. Should only be called once
207  // per ContentBrowserClient object.
208  // TODO(ajwong): Remove once http://crbug.com/159193 is resolved.
209  virtual net::URLRequestContextGetter* CreateRequestContext(
210      BrowserContext* browser_context,
211      ProtocolHandlerMap* protocol_handlers,
212      ProtocolHandlerScopedVector protocol_interceptors);
213
214  // Creates the net::URLRequestContextGetter for a StoragePartition. Should
215  // only be called once per partition_path per ContentBrowserClient object.
216  // TODO(ajwong): Remove once http://crbug.com/159193 is resolved.
217  virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
218      BrowserContext* browser_context,
219      const base::FilePath& partition_path,
220      bool in_memory,
221      ProtocolHandlerMap* protocol_handlers,
222      ProtocolHandlerScopedVector protocol_interceptors);
223
224  // Returns whether a specified URL is handled by the embedder's internal
225  // protocol handlers.
226  virtual bool IsHandledURL(const GURL& url);
227
228  // Returns whether the given process is allowed to commit |url|.  This is a
229  // more conservative check than IsSuitableHost, since it is used after a
230  // navigation has committed to ensure that the process did not exceed its
231  // authority.
232  virtual bool CanCommitURL(RenderProcessHost* process_host, const GURL& url);
233
234  // Returns whether a URL should be allowed to open from a specific context.
235  // This also applies in cases where the new URL will open in another process.
236  virtual bool ShouldAllowOpenURL(SiteInstance* site_instance, const GURL& url);
237
238  // Returns whether a new view for a given |site_url| can be launched in a
239  // given |process_host|.
240  virtual bool IsSuitableHost(RenderProcessHost* process_host,
241                              const GURL& site_url);
242
243  // Returns whether a new process should be created or an existing one should
244  // be reused based on the URL we want to load. This should return false,
245  // unless there is a good reason otherwise.
246  virtual bool ShouldTryToUseExistingProcessHost(
247      BrowserContext* browser_context, const GURL& url);
248
249  // Called when a site instance is first associated with a process.
250  virtual void SiteInstanceGotProcess(SiteInstance* site_instance) {}
251
252  // Called from a site instance's destructor.
253  virtual void SiteInstanceDeleting(SiteInstance* site_instance) {}
254
255  // Called when a worker process is created.
256  virtual void WorkerProcessCreated(SiteInstance* site_instance,
257                                    int worker_process_id) {}
258
259  // Called when a worker process is terminated.
260  virtual void WorkerProcessTerminated(SiteInstance* site_instance,
261                                       int worker_process_id) {}
262
263  // Returns true if for the navigation from |current_url| to |new_url|
264  // in |site_instance|, a new SiteInstance and BrowsingInstance should be
265  // created (even if we are in a process model that doesn't usually swap.)
266  // This forces a process swap and severs script connections with existing
267  // tabs.
268  virtual bool ShouldSwapBrowsingInstancesForNavigation(
269      SiteInstance* site_instance,
270      const GURL& current_url,
271      const GURL& new_url);
272
273  // Returns true if the given navigation redirect should cause a renderer
274  // process swap.
275  // This is called on the IO thread.
276  virtual bool ShouldSwapProcessesForRedirect(ResourceContext* resource_context,
277                                              const GURL& current_url,
278                                              const GURL& new_url);
279
280  // Returns true if the passed in URL should be assigned as the site of the
281  // current SiteInstance, if it does not yet have a site.
282  virtual bool ShouldAssignSiteForURL(const GURL& url);
283
284  // See CharacterEncoding's comment.
285  virtual std::string GetCanonicalEncodingNameByAliasName(
286      const std::string& alias_name);
287
288  // Allows the embedder to pass extra command line flags.
289  // switches::kProcessType will already be set at this point.
290  virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
291                                              int child_process_id) {}
292
293  // Returns the locale used by the application.
294  // This is called on the UI and IO threads.
295  virtual std::string GetApplicationLocale();
296
297  // Returns the languages used in the Accept-Languages HTTP header.
298  // (Not called GetAcceptLanguages so it doesn't clash with win32).
299  virtual std::string GetAcceptLangs(BrowserContext* context);
300
301  // Returns the default favicon.  The callee doesn't own the given bitmap.
302  virtual gfx::ImageSkia* GetDefaultFavicon();
303
304  // Allow the embedder to control if an AppCache can be used for the given url.
305  // This is called on the IO thread.
306  virtual bool AllowAppCache(const GURL& manifest_url,
307                             const GURL& first_party,
308                             ResourceContext* context);
309
310  // Allow the embedder to control if the given cookie can be read.
311  // This is called on the IO thread.
312  virtual bool AllowGetCookie(const GURL& url,
313                              const GURL& first_party,
314                              const net::CookieList& cookie_list,
315                              ResourceContext* context,
316                              int render_process_id,
317                              int render_frame_id);
318
319  // Allow the embedder to control if the given cookie can be set.
320  // This is called on the IO thread.
321  virtual bool AllowSetCookie(const GURL& url,
322                              const GURL& first_party,
323                              const std::string& cookie_line,
324                              ResourceContext* context,
325                              int render_process_id,
326                              int render_frame_id,
327                              net::CookieOptions* options);
328
329  // This is called on the IO thread.
330  virtual bool AllowSaveLocalState(ResourceContext* context);
331
332  // Allow the embedder to control if access to web database by a shared worker
333  // is allowed. |render_frame| is a vector of pairs of
334  // RenderProcessID/RenderFrameID of RenderFrame that are using this worker.
335  // This is called on the IO thread.
336  virtual bool AllowWorkerDatabase(
337      const GURL& url,
338      const base::string16& name,
339      const base::string16& display_name,
340      unsigned long estimated_size,
341      ResourceContext* context,
342      const std::vector<std::pair<int, int> >& render_frames);
343
344  // Allow the embedder to control if access to file system by a shared worker
345  // is allowed.
346  // This is called on the IO thread.
347  virtual bool AllowWorkerFileSystem(
348      const GURL& url,
349      ResourceContext* context,
350      const std::vector<std::pair<int, int> >& render_frames);
351
352  // Allow the embedder to control if access to IndexedDB by a shared worker
353  // is allowed.
354  // This is called on the IO thread.
355  virtual bool AllowWorkerIndexedDB(
356      const GURL& url,
357      const base::string16& name,
358      ResourceContext* context,
359      const std::vector<std::pair<int, int> >& render_frames);
360
361  // Allow the embedder to override the request context based on the URL for
362  // certain operations, like cookie access. Returns NULL to indicate the
363  // regular request context should be used.
364  // This is called on the IO thread.
365  virtual net::URLRequestContext* OverrideRequestContextForURL(
366      const GURL& url, ResourceContext* context);
367
368  // Allow the embedder to specify a string version of the storage partition
369  // config with a site.
370  virtual std::string GetStoragePartitionIdForSite(
371      content::BrowserContext* browser_context,
372      const GURL& site);
373
374  // Allows the embedder to provide a validation check for |partition_id|s.
375  // This domain of valid entries should match the range of outputs for
376  // GetStoragePartitionIdForChildProcess().
377  virtual bool IsValidStoragePartitionId(BrowserContext* browser_context,
378                                         const std::string& partition_id);
379
380  // Allows the embedder to provide a storage parititon configuration for a
381  // site. A storage partition configuration includes a domain of the embedder's
382  // choice, an optional name within that domain, and whether the partition is
383  // in-memory only.
384  //
385  // If |can_be_default| is false, the caller is telling the embedder that the
386  // |site| is known to not be in the default partition. This is useful in
387  // some shutdown situations where the bookkeeping logic that maps sites to
388  // their partition configuration are no longer valid.
389  //
390  // The |partition_domain| is [a-z]* UTF-8 string, specifying the domain in
391  // which partitions live (similar to namespace). Within a domain, partitions
392  // can be uniquely identified by the combination of |partition_name| and
393  // |in_memory| values. When a partition is not to be persisted, the
394  // |in_memory| value must be set to true.
395  virtual void GetStoragePartitionConfigForSite(
396      content::BrowserContext* browser_context,
397      const GURL& site,
398      bool can_be_default,
399      std::string* partition_domain,
400      std::string* partition_name,
401      bool* in_memory);
402
403  // Create and return a new quota permission context.
404  virtual QuotaPermissionContext* CreateQuotaPermissionContext();
405
406  // Informs the embedder that a certificate error has occured.  If
407  // |overridable| is true and if |strict_enforcement| is false, the user
408  // can ignore the error and continue. The embedder can call the callback
409  // asynchronously. If |result| is not set to
410  // CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE, the request will be cancelled
411  // or denied immediately, and the callback won't be run.
412  virtual void AllowCertificateError(
413      int render_process_id,
414      int render_frame_id,
415      int cert_error,
416      const net::SSLInfo& ssl_info,
417      const GURL& request_url,
418      ResourceType::Type resource_type,
419      bool overridable,
420      bool strict_enforcement,
421      const base::Callback<void(bool)>& callback,
422      CertificateRequestResultType* result) {}
423
424  // Selects a SSL client certificate and returns it to the |callback|. If no
425  // certificate was selected NULL is returned to the |callback|.
426  virtual void SelectClientCertificate(
427      int render_process_id,
428      int render_frame_id,
429      const net::HttpNetworkSession* network_session,
430      net::SSLCertRequestInfo* cert_request_info,
431      const base::Callback<void(net::X509Certificate*)>& callback) {}
432
433  // Adds a new installable certificate or private key.
434  // Typically used to install an X.509 user certificate.
435  // Note that it's up to the embedder to verify that the data is
436  // well-formed. |cert_data| will be NULL if file_size is 0.
437  virtual void AddCertificate(
438      net::URLRequest* request,
439      net::CertificateMimeType cert_type,
440      const void* cert_data,
441      size_t cert_size,
442      int render_process_id,
443      int render_view_id) {}
444
445  // Returns a class to get notifications about media event. The embedder can
446  // return NULL if they're not interested.
447  virtual MediaObserver* GetMediaObserver();
448
449  // Asks permission to show desktop notifications.
450  virtual void RequestDesktopNotificationPermission(
451      const GURL& source_origin,
452      int callback_context,
453      int render_process_id,
454      int render_view_id) {}
455
456  // Checks if the given page has permission to show desktop notifications.
457  // This is called on the IO thread.
458  virtual blink::WebNotificationPresenter::Permission
459      CheckDesktopNotificationPermission(
460          const GURL& source_url,
461          ResourceContext* context,
462          int render_process_id);
463
464  // Show a desktop notification.  If |worker| is true, the request came from an
465  // HTML5 web worker, otherwise, it came from a renderer.
466  virtual void ShowDesktopNotification(
467      const ShowDesktopNotificationHostMsgParams& params,
468      int render_process_id,
469      int render_view_id,
470      bool worker) {}
471
472  // Cancels a displayed desktop notification.
473  virtual void CancelDesktopNotification(
474      int render_process_id,
475      int render_view_id,
476      int notification_id) {}
477
478  // Returns true if the given page is allowed to open a window of the given
479  // type. If true is returned, |no_javascript_access| will indicate whether
480  // the window that is created should be scriptable/in the same process.
481  // This is called on the IO thread.
482  virtual bool CanCreateWindow(const GURL& opener_url,
483                               const GURL& opener_top_level_frame_url,
484                               const GURL& source_origin,
485                               WindowContainerType container_type,
486                               const GURL& target_url,
487                               const content::Referrer& referrer,
488                               WindowOpenDisposition disposition,
489                               const blink::WebWindowFeatures& features,
490                               bool user_gesture,
491                               bool opener_suppressed,
492                               content::ResourceContext* context,
493                               int render_process_id,
494                               bool is_guest,
495                               int opener_id,
496                               bool* no_javascript_access);
497
498  // Returns a title string to use in the task manager for a process host with
499  // the given URL, or the empty string to fall back to the default logic.
500  // This is called on the IO thread.
501  virtual std::string GetWorkerProcessTitle(const GURL& url,
502                                            ResourceContext* context);
503
504  // Notifies the embedder that the ResourceDispatcherHost has been created.
505  // This is when it can optionally add a delegate.
506  virtual void ResourceDispatcherHostCreated() {}
507
508  // Allows the embedder to return a delegate for the SpeechRecognitionManager.
509  // The delegate will be owned by the manager. It's valid to return NULL.
510  virtual SpeechRecognitionManagerDelegate*
511      GetSpeechRecognitionManagerDelegate();
512
513  // Getters for common objects.
514  virtual net::NetLog* GetNetLog();
515
516  // Creates a new AccessTokenStore for gelocation.
517  virtual AccessTokenStore* CreateAccessTokenStore();
518
519  // Returns true if fast shutdown is possible.
520  virtual bool IsFastShutdownPossible();
521
522  // Called by WebContents to override the WebKit preferences that are used by
523  // the renderer. The content layer will add its own settings, and then it's up
524  // to the embedder to update it if it wants.
525  virtual void OverrideWebkitPrefs(RenderViewHost* render_view_host,
526                                   const GURL& url,
527                                   WebPreferences* prefs) {}
528
529  // Inspector setting was changed and should be persisted.
530  virtual void UpdateInspectorSetting(RenderViewHost* rvh,
531                                      const std::string& key,
532                                      const std::string& value) {}
533
534  // Notifies that BrowserURLHandler has been created, so that the embedder can
535  // optionally add their own handlers.
536  virtual void BrowserURLHandlerCreated(BrowserURLHandler* handler) {}
537
538  // Clears browser cache.
539  virtual void ClearCache(RenderViewHost* rvh) {}
540
541  // Clears browser cookies.
542  virtual void ClearCookies(RenderViewHost* rvh) {}
543
544  // Returns the default download directory.
545  // This can be called on any thread.
546  virtual base::FilePath GetDefaultDownloadDirectory();
547
548  // Returns the default filename used in downloads when we have no idea what
549  // else we should do with the file.
550  virtual std::string GetDefaultDownloadName();
551
552  // Notification that a pepper plugin has just been spawned. This allows the
553  // embedder to add filters onto the host to implement interfaces.
554  // This is called on the IO thread.
555  virtual void DidCreatePpapiPlugin(BrowserPpapiHost* browser_host) {}
556
557  // Gets the host for an external out-of-process plugin.
558  virtual content::BrowserPpapiHost* GetExternalBrowserPpapiHost(
559      int plugin_child_id);
560
561  // Returns true if the given browser_context and site_url support hosting
562  // BrowserPlugins.
563  virtual bool SupportsBrowserPlugin(BrowserContext* browser_context,
564                                     const GURL& site_url);
565
566  // Returns true if the socket operation specified by |params| is allowed from
567  // the given |browser_context| and |url|. If |params| is NULL, this method
568  // checks the basic "socket" permission, which is for those operations that
569  // don't require a specific socket permission rule.
570  // |private_api| indicates whether this permission check is for the private
571  // Pepper socket API or the public one.
572  virtual bool AllowPepperSocketAPI(BrowserContext* browser_context,
573                                    const GURL& url,
574                                    bool private_api,
575                                    const SocketPermissionRequest* params);
576
577  // Returns an implementation of a file selecition policy. Can return NULL.
578  virtual ui::SelectFilePolicy* CreateSelectFilePolicy(
579      WebContents* web_contents);
580
581  // Returns additional allowed scheme set which can access files in
582  // FileSystem API.
583  virtual void GetAdditionalAllowedSchemesForFileSystem(
584      std::vector<std::string>* additional_schemes) {}
585
586  // Returns additional file system backends for FileSystem API.
587  // |browser_context| is needed in the additional FileSystemBackends.
588  // It has mount points to create objects returned by additional
589  // FileSystemBackends, and SpecialStoragePolicy for permission granting.
590  virtual void GetAdditionalFileSystemBackends(
591      BrowserContext* browser_context,
592      const base::FilePath& storage_partition_path,
593      ScopedVector<fileapi::FileSystemBackend>* additional_backends) {}
594
595  // Allows an embedder to return its own LocationProvider implementation.
596  // Return NULL to use the default one for the platform to be created.
597  // FYI: Used by an external project; please don't remove.
598  // Contact Viatcheslav Ostapenko at sl.ostapenko@samsung.com for more
599  // information.
600  virtual LocationProvider* OverrideSystemLocationProvider();
601
602  // Allows an embedder to return its own VibrationProvider implementation.
603  // Return NULL to use the default one for the platform to be created.
604  // FYI: Used by an external project; please don't remove.
605  // Contact Viatcheslav Ostapenko at sl.ostapenko@samsung.com for more
606  // information.
607  virtual VibrationProvider* OverrideVibrationProvider();
608
609#if defined(OS_POSIX) && !defined(OS_MACOSX)
610  // Populates |mappings| with all files that need to be mapped before launching
611  // a child process.
612  virtual void GetAdditionalMappedFilesForChildProcess(
613      const base::CommandLine& command_line,
614      int child_process_id,
615      std::vector<FileDescriptorInfo>* mappings) {}
616#endif
617
618#if defined(OS_WIN)
619  // Returns the name of the dll that contains cursors and other resources.
620  virtual const wchar_t* GetResourceDllName();
621
622  // This is called on the PROCESS_LAUNCHER thread before the renderer process
623  // is launched. It gives the embedder a chance to add loosen the sandbox
624  // policy.
625  virtual void PreSpawnRenderer(sandbox::TargetPolicy* policy,
626                                bool* success) {}
627#endif
628
629  // Returns true if plugin referred to by the url can use
630  // pp::FileIO::RequestOSFileHandle.
631  virtual bool IsPluginAllowedToCallRequestOSFileHandle(
632      content::BrowserContext* browser_context,
633      const GURL& url);
634
635  // Returns true if dev channel APIs are available for plugins.
636  virtual bool IsPluginAllowedToUseDevChannelAPIs();
637
638  // Returns a special cookie store to use for a given render process, or NULL
639  // if the default cookie store should be used
640  // This is called on the IO thread.
641  virtual net::CookieStore* OverrideCookieStoreForRenderProcess(
642      int render_process_id_);
643};
644
645}  // namespace content
646
647#endif  // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
648