]> git.sesse.net Git - casparcg/blob - dependencies64/cef/include/capi/cef_request_context_capi.h
* Merged html producer and updated to latest CEF version (does not have satisfactory...
[casparcg] / dependencies64 / cef / include / capi / cef_request_context_capi.h
1 // Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 //    * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 //    * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 //    * Neither the name of Google Inc. nor the name Chromium Embedded
14 // Framework nor the names of its contributors may be used to endorse
15 // or promote products derived from this software without specific prior
16 // written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // ---------------------------------------------------------------------------
31 //
32 // This file was generated by the CEF translator tool and should not edited
33 // by hand. See the translator.README.txt file in the tools directory for
34 // more information.
35 //
36
37 #ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
38 #define CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
39 #pragma once
40
41 #include "include/capi/cef_cookie_capi.h"
42 #include "include/capi/cef_request_context_handler_capi.h"
43
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47
48 struct _cef_scheme_handler_factory_t;
49
50 ///
51 // A request context provides request handling for a set of related browser or
52 // URL request objects. A request context can be specified when creating a new
53 // browser via the cef_browser_host_t static factory functions or when creating
54 // a new URL request via the cef_urlrequest_t static factory functions. Browser
55 // objects with different request contexts will never be hosted in the same
56 // render process. Browser objects with the same request context may or may not
57 // be hosted in the same render process depending on the process model. Browser
58 // objects created indirectly via the JavaScript window.open function or
59 // targeted links will share the same render process and the same request
60 // context as the source browser. When running in single-process mode there is
61 // only a single render process (the main process) and so all browsers created
62 // in single-process mode will share the same request context. This will be the
63 // first request context passed into a cef_browser_host_t static factory
64 // function and all other request context objects will be ignored.
65 ///
66 typedef struct _cef_request_context_t {
67   ///
68   // Base structure.
69   ///
70   cef_base_t base;
71
72   ///
73   // Returns true (1) if this object is pointing to the same context as |that|
74   // object.
75   ///
76   int (CEF_CALLBACK *is_same)(struct _cef_request_context_t* self,
77       struct _cef_request_context_t* other);
78
79   ///
80   // Returns true (1) if this object is sharing the same storage as |that|
81   // object.
82   ///
83   int (CEF_CALLBACK *is_sharing_with)(struct _cef_request_context_t* self,
84       struct _cef_request_context_t* other);
85
86   ///
87   // Returns true (1) if this object is the global context. The global context
88   // is used by default when creating a browser or URL request with a NULL
89   // context argument.
90   ///
91   int (CEF_CALLBACK *is_global)(struct _cef_request_context_t* self);
92
93   ///
94   // Returns the handler for this context if any.
95   ///
96   struct _cef_request_context_handler_t* (CEF_CALLBACK *get_handler)(
97       struct _cef_request_context_t* self);
98
99   ///
100   // Returns the cache path for this object. If NULL an "incognito mode" in-
101   // memory cache is being used.
102   ///
103   // The resulting string must be freed by calling cef_string_userfree_free().
104   cef_string_userfree_t (CEF_CALLBACK *get_cache_path)(
105       struct _cef_request_context_t* self);
106
107   ///
108   // Returns the default cookie manager for this object. This will be the global
109   // cookie manager if this object is the global request context. Otherwise,
110   // this will be the default cookie manager used when this request context does
111   // not receive a value via cef_request_tContextHandler::get_cookie_manager().
112   // If |callback| is non-NULL it will be executed asnychronously on the IO
113   // thread after the manager's storage has been initialized.
114   ///
115   struct _cef_cookie_manager_t* (CEF_CALLBACK *get_default_cookie_manager)(
116       struct _cef_request_context_t* self,
117       struct _cef_completion_callback_t* callback);
118
119   ///
120   // Register a scheme handler factory for the specified |scheme_name| and
121   // optional |domain_name|. An NULL |domain_name| value for a standard scheme
122   // will cause the factory to match all domain names. The |domain_name| value
123   // will be ignored for non-standard schemes. If |scheme_name| is a built-in
124   // scheme and no handler is returned by |factory| then the built-in scheme
125   // handler factory will be called. If |scheme_name| is a custom scheme then
126   // you must also implement the cef_app_t::on_register_custom_schemes()
127   // function in all processes. This function may be called multiple times to
128   // change or remove the factory that matches the specified |scheme_name| and
129   // optional |domain_name|. Returns false (0) if an error occurs. This function
130   // may be called on any thread in the browser process.
131   ///
132   int (CEF_CALLBACK *register_scheme_handler_factory)(
133       struct _cef_request_context_t* self, const cef_string_t* scheme_name,
134       const cef_string_t* domain_name,
135       struct _cef_scheme_handler_factory_t* factory);
136
137   ///
138   // Clear all registered scheme handler factories. Returns false (0) on error.
139   // This function may be called on any thread in the browser process.
140   ///
141   int (CEF_CALLBACK *clear_scheme_handler_factories)(
142       struct _cef_request_context_t* self);
143 } cef_request_context_t;
144
145
146 ///
147 // Returns the global context object.
148 ///
149 CEF_EXPORT cef_request_context_t* cef_request_context_get_global_context();
150
151 ///
152 // Creates a new context object with the specified |settings| and optional
153 // |handler|.
154 ///
155 CEF_EXPORT cef_request_context_t* cef_request_context_create_context(
156     const struct _cef_request_context_settings_t* settings,
157     struct _cef_request_context_handler_t* handler);
158
159 ///
160 // Creates a new context object that shares storage with |other| and uses an
161 // optional |handler|.
162 ///
163 CEF_EXPORT cef_request_context_t* create_context_shared(
164     cef_request_context_t* other,
165     struct _cef_request_context_handler_t* handler);
166
167
168 #ifdef __cplusplus
169 }
170 #endif
171
172 #endif  // CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_