-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathcef3types.pas
2445 lines (2012 loc) · 83.1 KB
/
cef3types.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(*
* Free Pascal Chromium Embedded 3
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Author: [email protected]
* Repository: https://github.com/dliw/fpCEF3
*
*
* Originally based on 'Delphi Chromium Embedded 3' by Henri Gourvest
*
* Embarcadero Technologies, Inc is not permitted to use or redistribute
* this source code without explicit permission.
*
*)
Unit cef3types;
{$MODE objfpc}{$H+}
{$I cef.inc}
Interface
Uses
{$IFDEF WINDOWS}Windows,{$ENDIF}
{$IFDEF UNIX}BaseUnix,{$ENDIF}
{$IFDEF DARWIN}CocoaAll,{$ENDIF}
ctypes;
Type
{$IFDEF CEF_STRING_TYPE_UTF8}
ustring = UTF8String;
{$ELSE}
ustring = UnicodeString;
{$ENDIF}
rbstring = AnsiString;
TUrlParts = record
spec: ustring;
scheme: ustring;
username: ustring;
password: ustring;
host: ustring;
port: ustring;
origin: ustring;
path: ustring;
query: ustring;
end;
PSize = ^TSize;
TSize = csize_t;
{ *** cef_string_types.h *** }
// CEF provides functions for converting between UTF-8, -16 and -32 strings.
// CEF string types are safe for reading from multiple threads but not for
// modification. It is the user's responsibility to provide synchronization if
// modifying CEF strings from multiple threads.
// CEF character type definitions. wchar_t is 2 bytes on Windows and 4 bytes on
// most other platforms.
Char16 = WideChar;
PChar16 = PWideChar;
// CEF string type definitions. Whomever allocates |str| is responsible for
// providing an appropriate |dtor| implementation that will free the string in
// the same memory space. When reusing an existing string structure make sure
// to call |dtor| for the old value before assigning new |str| and |dtor|
// values. Static strings will have a NULL |dtor| value. Using the below
// functions if you want this managed for you.
PCefStringWide = ^TCefStringWide;
TCefStringWide = record
str: PWideChar;
length: csize_t;
dtor: procedure(str: PWideChar); cconv;
end;
PCefStringUtf8 = ^TCefStringUtf8;
TCefStringUtf8 = record
str: PAnsiChar;
length: csize_t;
dtor: procedure(str: PAnsiChar); cconv;
end;
PCefStringUtf16 = ^TCefStringUtf16;
TCefStringUtf16 = record
str: PChar16;
length: csize_t;
dtor: procedure(str: PChar16); cconv;
end;
// It is sometimes necessary for the system to allocate string structures with
// the expectation that the user will free them. The userfree types act as a
// hint that the user is responsible for freeing the structure.
PCefStringUserFreeWide = ^TCefStringUserFreeWide;
TCefStringUserFreeWide = type TCefStringWide;
PCefStringUserFreeUtf8 = ^TCefStringUserFreeUtf8;
TCefStringUserFreeUtf8 = type TCefStringUtf8;
PCefStringUserFreeUtf16 = ^TCefStringUserFreeUtf16;
TCefStringUserFreeUtf16 = type TCefStringUtf16;
{ *** cef_string.h *** }
{$IFDEF CEF_STRING_TYPE_UTF8}
TCefChar = AnsiChar;
PCefChar = PAnsiChar;
TCefStringUserFree = TCefStringUserFreeUtf8;
PCefStringUserFree = PCefStringUserFreeUtf8;
TCefString = TCefStringUtf8;
PCefString = PCefStringUtf8;
{$ENDIF}
{$IFDEF CEF_STRING_TYPE_UTF16}
TCefChar = Char16;
PCefChar = PChar16;
TCefStringUserFree = TCefStringUserFreeUtf16;
PCefStringUserFree = PCefStringUserFreeUtf16;
TCefString = TCefStringUtf16;
PCefString = PCefStringUtf16;
{$ENDIF}
{$IFDEF CEF_STRING_TYPE_WIDE}
TCefChar = WideChar;
PCefChar = PWideChar;
TCefStringUserFree = TCefStringUserFreeWide;
PCefStringUserFree = PCefStringUserFreeWide;
TCefString = TCefStringWide;
PCefString = PCefStringWide;
{$ENDIF}
{ *** cef_string_list.h *** }
// CEF string maps are a set of key/value string pairs.
TCefStringList = Pointer;
{ *** cef_string_map.h *** }
// CEF string maps are a set of key/value string pairs.
TCefStringMap = Pointer;
{ *** cef_string_multimap.h *** }
// CEF string multimaps are a set of key/value string pairs.
// More than one value can be assigned to a single key.
TCefStringMultimap = Pointer;
{ *** platform specific types *** }
{$IFDEF WINDOWS}
Const
kNullCursorHandle = nil;
kNullEventHandle = nil;
kNullWindowHandle = nil;
Type
TCefCursorHandle = HCURSOR;
TCefEventHandle = PMSG;
TCefWindowHandle = HWND;
{$ENDIF}
{$IFDEF LINUX}
Const
kNullCursorHandle = 0;
kNullEventHandle = nil;
kNullWindowHandle = 0;
Type
PXEvent = Pointer; // ^XEvent;
TCefCursorHandle = culong;
TCefEventHandle = PXEvent;
TCefWindowHandle = culong;
{$ENDIF}
{$IFDEF DARWIN}
Const
kNullCursorHandle = nil;
kNullEventHandle = nil;
kNullWindowHandle = nil;
Type
TCefCursorHandle = NSCursor;
TCefEventHandle = NSEvent;
TCefWindowHandle = NSView;
{$ENDIF}
// Structure representing CefExecuteProcess arguments.
PCefMainArgs = ^TCefMainArgs;
TCefMainArgs = record
{$IFDEF WINDOWS}
instance : HINST;
{$ELSE}
argc : Integer;
argv : PPChar;
{$ENDIF}
end;
// Structure representing window information.
PCefWindowInfo = ^TCefWindowInfo;
TCefWindowInfo = record
{$IFDEF WINDOWS}
// Standard parameters required by CreateWindowEx()
ex_style : DWORD;
window_name : TCefString;
style : DWORD;
x, y, width, height : Integer;
parent_window : TCefWindowHandle;
menu : HMENU;
// Set to true (1) to create the browser using windowless (off-screen)
// rendering. No window will be created for the browser and all rendering will
// occur via the CefRenderHandler interface. The |parent_window| value will be
// used to identify monitor info and to act as the parent window for dialogs,
// context menus, etc. If |parent_window| is not provided then the main screen
// monitor will be used and some functionality that requires a parent window
// may not function correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
windowless_rendering_enabled: Integer;
// Set to true (1) to enable transparent painting in combination with
// windowless rendering. When this value is true a transparent background
// color will be used (RGBA=0x00000000). When this value is false the
// background will be white and opaque.
transparent_painting_enabled: Integer;
// Handle for the new browser window. Only used with windowed rendering.
window: TCefWindowHandle;
{$ENDIF}
{$IFDEF LINUX}
x: cuint;
y: cuint;
width: cuint;
height: cuint;
// Pointer for the parent window.
parent_window: TCefWindowHandle;
// Set to true (1) to create the browser using windowless (off-screen)
// rendering. No window will be created for the browser and all rendering will
// occur via the CefRenderHandler interface. The |parent_window| value will be
// used to identify monitor info and to act as the parent window for dialogs,
// context menus, etc. If |parent_window| is not provided then the main screen
// monitor will be used and some functionality that requires a parent window
// may not function correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
windowless_rendering_enabled: Integer;
// Set to true (1) to enable transparent painting in combination with
// windowless rendering. When this value is true a transparent background
// color will be used (RGBA=0x00000000). When this value is false the
// background will be white and opaque.
transparent_painting_enabled: Integer;
// Pointer for the new browser window. Only used with windowed rendering.
window: TCefWindowHandle;
{$ENDIF}
{$IFDEF DARWIN}
window_name: TCefString;
x, y, width, height: Integer;
// Set to true (1) to create the view initially hidden.
hidden: Integer;
// NSView pointer for the parent view.
parent_view: TCefWindowHandle;
// Set to true (1) to create the browser using windowless (off-screen)
// rendering. No view will be created for the browser and all rendering will
// occur via the CefRenderHandler interface. The |parent_view| value will be
// used to identify monitor info and to act as the parent view for dialogs,
// context menus, etc. If |parent_view| is not provided then the main screen
// monitor will be used and some functionality that requires a parent view
// may not function correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
windowless_rendering_enabled: Integer;
// Set to true (1) to enable transparent painting in combination with
// windowless rendering. When this value is true a transparent background
// color will be used (RGBA=0x00000000). When this value is false the
// background will be white and opaque.
transparent_painting_enabled: Integer;
// NSView pointer for the new browser view. Only used with windowed rendering.
view: TCefWindowHandle;
{$ENDIF}
end;
{ *** cef_thread_internal.h *** }
{$IFDEF WINDOWS}
TCefPlatformThreadId = DWord;
TCefPlatformThreadHandle = DWord;
{$ELSE}
TCefPlatformThreadId = pid_t;
TCefPlatformThreadHandle = pthread_t;
{$ENDIF}
{ *** cef_time.h *** }
// Time information. Values should always be in UTC.
PCefTime = ^TCefTime;
TCefTime = record
year: Integer; // Four or five digit year "2007" (1601 to 30827 on
// Windows, 1970 to 2038 on 32-bit POSIX)
month: Integer; // 1-based month (values 1 = January, etc.)
day_of_week: Integer; // 0-based day of week (0 = Sunday, etc.)
day_of_month: Integer; // 1-based day of month (1-31)
hour: Integer; // Hour within the current day (0-23)
minute: Integer; // Minute within the current hour (0-59)
second: Integer; // Second within the current minute (0-59 plus leap
// seconds which may take it up to 60).
millisecond: Integer; // Milliseconds within the current second (0-999)
end;
{ *** cef_types.h *** }
// 32-bit ARGB color value, not premultiplied. The color components are always
// in a known order. Equivalent to the SkColor type.
PCefColor = ^TCefColor;
TCefColor = UInt32;
function CefColorGetA(color: TCefColor): Byte;
function CefColorGetR(color: TCefColor): Byte;
function CefColorGetG(color: TCefColor): Byte;
function CefColorGetB(color: TCefColor): Byte;
function CefColorSetARGB(a, r, g, b: Byte): TCefColor;
Type
// Log severity levels.
TCefLogSeverity = (
// Default logging (currently INFO logging).
LOGSEVERITY_DEFAULT,
// Verbose logging.
LOGSEVERITY_VERBOSE,
// INFO logging.
LOGSEVERITY_INFO,
// WARNING logging.
LOGSEVERITY_WARNING,
// ERROR logging.
LOGSEVERITY_ERROR_REPORT,
// Disables logging completely.
LOGSEVERITY_DISABLE = 99
);
// Represents the state of a setting.
TCefState = (
// Use the default state for the setting.
STATE_DEFAULT = 0,
// Enable or allow the setting.
STATE_ENABLED,
// Disable or disallow the setting.
STATE_DISABLED
);
// Initialization settings. Specify NULL or 0 to get the recommended default
// values. Many of these and other settings can also configured using command-
// line switches.
PCefSettings = ^TCefSettings;
TCefSettings = record
// Size of this structure.
size: csize_t;
// Set to true (1) to use a single process for the browser and renderer. This
// run mode is not officially supported by Chromium and is less stable than
// the multi-process default. Also configurable using the "single-process"
// command-line switch.
single_process: Integer;
// Set to true (1) to disable the sandbox for sub-processes. See
// cef_sandbox_win.h for requirements to enable the sandbox on Windows. Also
// configurable using the "no-sandbox" command-line switch.
no_sandbox: Integer;
// The path to a separate executable that will be launched for sub-processes.
// If this value is empty on Windows or Linux then the main process executable
// will be used. If this value is empty on macOS then a helper executable must
// exist at "Contents/Frameworks/<app> Helper.app/Contents/MacOS/<app> Helper"
// in the top-level app bundle. See the comments on CefExecuteProcess() for
// details. Also configurable using the "browser-subprocess-path" command-line
// switch.
browser_subprocess_path: TCefString;
// The path to the CEF framework directory on macOS. If this value is empty
// then the framework must exist at "Contents/Frameworks/Chromium Embedded
// Framework.framework" in the top-level app bundle. Also configurable using
// the "framework-dir-path" command-line switch.
framework_dir_path: TCefString;
// Set to true (1) to have the browser process message loop run in a separate
// thread. If false (0) than the CefDoMessageLoopWork() function must be
// called from your application message loop. This option is only supported on
// Windows.
multi_threaded_message_loop: Integer;
// Set to true (1) to control browser process main (UI) thread message pump
// scheduling via the CefBrowserProcessHandler::OnScheduleMessagePumpWork()
// callback. This option is recommended for use in combination with the
// CefDoMessageLoopWork() function in cases where the CEF message loop must be
// integrated into an existing application message loop (see additional
// comments and warnings on CefDoMessageLoopWork). Enabling this option is not
// recommended for most users; leave this option disabled and use either the
// CefRunMessageLoop() function or multi_threaded_message_loop if possible.
external_message_pump: Integer;
// Set to true (1) to enable windowless (off-screen) rendering support. Do not
// enable this value if the application does not use windowless rendering as
// it may reduce rendering performance on some systems.
windowless_rendering_enabled: Integer;
// Set to true (1) to disable configuration of browser process features using
// standard CEF and Chromium command-line arguments. Configuration can still
// be specified using CEF data structures or via the
// CefApp::OnBeforeCommandLineProcessing() method.
command_line_args_disabled: Integer;
// The location where cache data will be stored on disk. If empty then
// browsers will be created in "incognito mode" where in-memory caches are
// used for storage and no data is persisted to disk. HTML5 databases such as
// localStorage will only persist across sessions if a cache path is
// specified. Can be overridden for individual CefRequestContext instances via
// the CefRequestContextSettings.cache_path value.
cache_path: TCefString;
// The location where user data such as spell checking dictionary files will
// be stored on disk. If empty then the default platform-specific user data
// directory will be used ("~/.cef_user_data" directory on Linux,
// "~/Library/Application Support/CEF/User Data" directory on Mac OS X,
// "Local Settings\Application Data\CEF\User Data" directory under the user
// profile directory on Windows).
user_data_path: TCefString;
// To persist session cookies (cookies without an expiry date or validity
// interval) by default when using the global cookie manager set this value to
// true (1). Session cookies are generally intended to be transient and most
// Web browsers do not persist them. A |cache_path| value must also be
// specified to enable this feature. Also configurable using the
// "persist-session-cookies" command-line switch. Can be overridden for
// individual CefRequestContext instances via the
// CefRequestContextSettings.persist_session_cookies value.
persist_session_cookies: Integer;
// To persist user preferences as a JSON file in the cache path directory set
// this value to true (1). A |cache_path| value must also be specified
// to enable this feature. Also configurable using the
// "persist-user-preferences" command-line switch. Can be overridden for
// individual CefRequestContext instances via the
// CefRequestContextSettings.persist_user_preferences value.
persist_user_preferences: Integer;
// Value that will be returned as the User-Agent HTTP header. If empty the
// default User-Agent string will be used. Also configurable using the
// "user-agent" command-line switch.
user_agent: TCefString;
// Value that will be inserted as the product portion of the default
// User-Agent string. If empty the Chromium product version will be used. If
// |userAgent| is specified this value will be ignored. Also configurable
// using the "product-version" command-line switch.
product_version: TCefString;
// The locale string that will be passed to WebKit. If empty the default
// locale of "en-US" will be used. This value is ignored on Linux where locale
// is determined using environment variable parsing with the precedence order:
// LANGUAGE, LC_ALL, LC_MESSAGES and LANG. Also configurable using the "lang"
// command-line switch.
locale: TCefString;
// The directory and file name to use for the debug log. If empty a default
// log file name and location will be used. On Windows and Linux a "debug.log"
// file will be written in the main executable directory. On Mac OS X a
// "~/Library/Logs/<app name>_debug.log" file will be written where <app name>
// is the name of the main app executable. Also configurable using the
// "log-file" command-line switch.
log_file: TCefString;
// The log severity. Only messages of this severity level or higher will be
// logged.
log_severity: TCefLogSeverity;
// Custom flags that will be used when initializing the V8 JavaScript engine.
// The consequences of using custom flags may not be well tested. Also
// configurable using the "js-flags" command-line switch.
javascript_flags: TCefString;
// The fully qualified path for the resources directory. If this value is
// empty the cef.pak and/or devtools_resources.pak files must be located in
// the module directory on Windows/Linux or the app bundle Resources directory
// on Mac OS X. Also configurable using the "resources-dir-path" command-line
// switch.
resources_dir_path: TCefString;
// The fully qualified path for the locales directory. If this value is empty
// the locales directory must be located in the module directory. This value
// is ignored on Mac OS X where pack files are always loaded from the app
// bundle Resources directory. Also configurable using the "locales-dir-path"
// command-line switch.
locales_dir_path: TCefString;
// Set to true (1) to disable loading of pack files for resources and locales.
// A resource bundle handler must be provided for the browser and render
// processes via CefApp::GetResourceBundleHandler() if loading of pack files
// is disabled. Also configurable using the "disable-pack-loading" command-
// line switch.
pack_loading_disabled: Integer;
// Set to a value between 1024 and 65535 to enable remote debugging on the
// specified port. For example, if 8080 is specified the remote debugging URL
// will be http://localhost:8080. CEF can be remotely debugged from any CEF or
// Chrome browser window. Also configurable using the "remote-debugging-port"
// command-line switch.
remote_debugging_port: Integer;
// The number of stack trace frames to capture for uncaught exceptions.
// Specify a positive value to enable the CefRenderProcessHandler::
// OnUncaughtException() callback. Specify 0 (default value) and
// OnUncaughtException() will not be called. Also configurable using the
// "uncaught-exception-stack-size" command-line switch.
uncaught_exception_stack_size: Integer;
// By default CEF V8 references will be invalidated (the IsValid() method will
// return false) after the owning context has been released. This reduces the
// need for external record keeping and avoids crashes due to the use of V8
// references after the associated context has been released.
//
// CEF currently offers two context safety implementations with different
// performance characteristics. The default implementation (value of 0) uses a
// map of hash values and should provide better performance in situations with
// a small number contexts. The alternate implementation (value of 1) uses a
// hidden value attached to each context and should provide better performance
// in situations with a large number of contexts.
//
// If you need better performance in the creation of V8 references and you
// plan to manually track context lifespan you can disable context safety by
// specifying a value of -1.
//
// Also configurable using the "context-safety-implementation" command-line
// switch.
context_safety_implementation: Integer;
// Set to true (1) to ignore errors related to invalid SSL certificates.
// Enabling this setting can lead to potential security vulnerabilities like
// "man in the middle" attacks. Applications that load content from the
// internet should not enable this setting. Also configurable using the
// "ignore-certificate-errors" command-line switch. Can be overridden for
// individual CefRequestContext instances via the
// CefRequestContextSettings.ignore_certificate_errors value.
ignore_certificate_error: Integer;
// Set to true (1) to enable date-based expiration of built in network
// security information (i.e. certificate transparency logs, HSTS preloading
// and pinning information). Enabling this option improves network security
// but may cause HTTPS load failures when using CEF binaries built more than
// 10 weeks in the past. See https://www.certificate-transparency.org/ and
// https://www.chromium.org/hsts for details. Also configurable using the
// "enable-net-security-expiration" command-line switch. Can be overridden for
// individual CefRequestContext instances via the
// CefRequestContextSettings.enable_net_security_expiration value.
enable_net_security_expiration: Integer;
// Opaque background color used for accelerated content. By default the
// background color will be white. Only the RGB compontents of the specified
// value will be used. The alpha component must greater than 0 to enable use
// of the background color but will be otherwise ignored.
background_color: TCefColor;
// Comma delimited ordered list of language codes without any whitespace that
// will be used in the "Accept-Language" HTTP header. May be overridden on a
// per-browser basis using the CefBrowserSettings.accept_language_list value.
// If both values are empty then "en-US,en" will be used. Can be overridden
// for individual CefRequestContext instances via the
// CefRequestContextSettings.accept_language_list value.
accept_language_list: TCefString;
end;
// Request context initialization settings. Specify NULL or 0 to get the
// recommended default values.
PCefRequestContextSettings = ^TCefRequestContextSettings;
TCefRequestContextSettings = record
// Size of this structure.
size: csize_t;
// The location where cache data will be stored on disk. If empty then
// browsers will be created in "incognito mode" where in-memory caches are
// used for storage and no data is persisted to disk. HTML5 databases such as
// localStorage will only persist across sessions if a cache path is
// specified. To share the global browser cache and related configuration set
// this value to match the CefSettings.cache_path value.
cache_path: TCefString;
// To persist session cookies (cookies without an expiry date or validity
// interval) by default when using the global cookie manager set this value to
// true (1). Session cookies are generally intended to be transient and most
// Web browsers do not persist them. Can be set globally using the
// CefSettings.persist_session_cookies value. This value will be ignored if
// |cache_path| is empty or if it matches the CefSettings.cache_path value.
persist_session_cookies: Integer;
// To persist user preferences as a JSON file in the cache path directory set
// this value to true (1). Can be set globally using the
// CefSettings.persist_user_preferences value. This value will be ignored if
// |cache_path| is empty or if it matches the CefSettings.cache_path value.
persist_user_preferences: Integer;
// Set to true (1) to ignore errors related to invalid SSL certificates.
// Enabling this setting can lead to potential security vulnerabilities like
// "man in the middle" attacks. Applications that load content from the
// internet should not enable this setting. Can be set globally using the
// CefSettings.ignore_certificate_errors value. This value will be ignored if
// |cache_path| matches the CefSettings.cache_path value.
ignore_certificate_errors: Integer;
// Set to true (1) to enable date-based expiration of built in network
// security information (i.e. certificate transparency logs, HSTS preloading
// and pinning information). Enabling this option improves network security
// but may cause HTTPS load failures when using CEF binaries built more than
// 10 weeks in the past. See https://www.certificate-transparency.org/ and
// https://www.chromium.org/hsts for details. Can be set globally using the
// CefSettings.enable_net_security_expiration value.
enable_net_security_expiration: Integer;
// Comma delimited ordered list of language codes without any whitespace that
// will be used in the "Accept-Language" HTTP header. Can be set globally
// using the CefSettings.accept_language_list value or overridden on a per-
// browser basis using the CefBrowserSettings.accept_language_list value. If
// all values are empty then "en-US,en" will be used. This value will be
// ignored if |cache_path| matches the CefSettings.cache_path value.
accept_language_list: TCefString;
end;
// Browser initialization settings. Specify NULL or 0 to get the recommended
// default values. The consequences of using custom values may not be well
// tested. Many of these and other settings can also configured using command-
// line switches.
PCefBrowserSettings = ^TCefBrowserSettings;
TCefBrowserSettings = record
// Size of this structure.
size: csize_t;
// The maximum rate in frames per second (fps) that CefRenderHandler::OnPaint
// will be called for a windowless browser. The actual fps may be lower if
// the browser cannot generate frames at the requested rate. The minimum
// value is 1 and the maximum value is 60 (default 30). This value can also be
// changed dynamically via CefBrowserHost::SetWindowlessFrameRate.
windowless_frame_rate: Integer;
// The below values map to WebPreferences settings.
// Font settings.
standard_font_family: TCefString;
fixed_font_family: TCefString;
serif_font_family: TCefString;
sans_serif_font_family: TCefString;
cursive_font_family: TCefString;
fantasy_font_family: TCefString;
default_font_size: Integer;
default_fixed_font_size: Integer;
minimum_font_size: Integer;
minimum_logical_font_size: Integer;
// Default encoding for Web content. If empty "ISO-8859-1" will be used. Also
// configurable using the "default-encoding" command-line switch.
default_encoding: TCefString;
// Controls the loading of fonts from remote sources. Also configurable using
// the "disable-remote-fonts" command-line switch.
remote_fonts: TCefState;
// Controls whether JavaScript can be executed. Also configurable using the
// "disable-javascript" command-line switch.
javascript: TCefState;
// Controls whether JavaScript can be used for opening windows. Also
// configurable using the "disable-javascript-open-windows" command-line
// switch.
javascript_open_windows: TCefState;
// Controls whether JavaScript can be used to close windows that were not
// opened via JavaScript. JavaScript can still be used to close windows that
// were opened via JavaScript or that have no back/forward history. Also
// configurable using the "disable-javascript-close-windows" command-line
// switch.
javascript_close_windows: TCefState;
// Controls whether JavaScript can access the clipboard. Also configurable
// using the "disable-javascript-access-clipboard" command-line switch.
javascript_access_clipboard: TCefState;
// Controls whether DOM pasting is supported in the editor via
// execCommand("paste"). The |javascript_access_clipboard| setting must also
// be enabled. Also configurable using the "disable-javascript-dom-paste"
// command-line switch.
javascript_dom_paste: TCefState;
// Controls whether any plugins will be loaded. Also configurable using the
// "disable-plugins" command-line switch.
plugins: TCefState;
// Controls whether file URLs will have access to all URLs. Also configurable
// using the "allow-universal-access-from-files" command-line switch.
universal_access_from_file_urls: TCefState;
// Controls whether file URLs will have access to other file URLs. Also
// configurable using the "allow-access-from-files" command-line switch.
file_access_from_file_urls: TCefState;
// Controls whether web security restrictions (same-origin policy) will be
// enforced. Disabling this setting is not recommend as it will allow risky
// security behavior such as cross-site scripting (XSS). Also configurable
// using the "disable-web-security" command-line switch.
web_security: TCefState;
// Controls whether image URLs will be loaded from the network. A cached image
// will still be rendered if requested. Also configurable using the
// "disable-image-loading" command-line switch.
image_loading: TCefState;
// Controls whether standalone images will be shrunk to fit the page. Also
// configurable using the "image-shrink-standalone-to-fit" command-line
// switch.
image_shrink_standalone_to_fit: TCefState;
// Controls whether text areas can be resized. Also configurable using the
// "disable-text-area-resize" command-line switch.
text_area_resize: TCefState;
// Controls whether the tab key can advance focus to links. Also configurable
// using the "disable-tab-to-links" command-line switch.
tab_to_links: TCefState;
// Controls whether local storage can be used. Also configurable using the
// "disable-local-storage" command-line switch.
local_storage: TCefState;
// Controls whether databases can be used. Also configurable using the
// "disable-databases" command-line switch.
databases: TCefState;
// Controls whether the application cache can be used. Also configurable using
// the "disable-application-cache" command-line switch.
application_cache: TCefState;
// Controls whether WebGL can be used. Note that WebGL requires hardware
// support and may not work on all systems even when enabled. Also
// configurable using the "disable-webgl" command-line switch.
webgl: TCefState;
// Opaque background color used for the browser before a document is loaded
// and when no document color is specified. By default the background color
// will be the same as CefSettings.background_color. Only the RGB compontents
// of the specified value will be used. The alpha component must greater than
// 0 to enable use of the background color but will be otherwise ignored.
background_color: TCefColor;
// Comma delimited ordered list of language codes without any whitespace that
// will be used in the "Accept-Language" HTTP header. May be set globally
// using the CefBrowserSettings.accept_language_list value. If both values are
// empty then "en-US,en" will be used.
accept_language_list: TCefString;
end;
TCefReturnValue = (
// Cancel immediately.
RV_CANCEL = 0,
// Continue immediately.
RV_CONTINUE,
// Continue asynchronously (usually via a callback).
RV_CONTINUE_ASYNC
);
// URL component parts.
PCefUrlParts = ^TCefUrlParts;
TCefUrlParts = record
// The complete URL specification.
spec: TCefString;
// Scheme component not including the colon (e.g., "http").
scheme: TCefString;
// User name component.
username: TCefString;
// Password component.
password: TCefString;
// Host component. This may be a hostname, an IPv4 address or an IPv6 literal
// surrounded by square brackets (e.g., "[2001:db8::1]").
host: TCefString;
// Port number component.
port: TCefString;
// Origin contains just the scheme, host, and port from a URL. Equivalent to
// clearing any username and password, replacing the path with a slash, and
// clearing everything after that. This value will be empty for non-standard
// URLs.
origin: TCefString;
// Path component including the first slash following the host.
path: TCefString;
// Query string component (i.e., everything following the '?').
query: TCefString;
end;
// Cookie information.
PCefCookie = ^TCefCookie;
TCefCookie = record
// The cookie name.
name: TCefString;
// The cookie value.
value: TCefString;
// If |domain| is empty a host cookie will be created instead of a domain
// cookie. Domain cookies are stored with a leading "." and are visible to
// sub-domains whereas host cookies are not.
domain: TCefString;
// If |path| is non-empty only URLs at or below the path will get the cookie
// value.
path: TCefString;
// If |secure| is true the cookie will only be sent for HTTPS requests.
secure: Integer;
// If |httponly| is true the cookie will only be sent for HTTP requests.
httponly: Integer;
// The cookie creation date. This is automatically populated by the system on
// cookie creation.
creation: TCefTime;
// The cookie last access date. This is automatically populated by the system
// on access.
last_access: TCefTime;
// The cookie expiration date is only valid if |has_expires| is true.
has_expires: Integer;
expires: TCefTime;
end;
// Process termination status values.
TCefTerminationStatus = (
// Non-zero exit status.
TS_ABNORMAL_TERMINATION,
// SIGKILL or task manager kill.
TS_PROCESS_WAS_KILLED,
// Segmentation fault.
TS_PROCESS_CRASHED
);
// Path key values.
TCefPathKey = (
// Current directory.
PK_DIR_CURRENT,
// Directory containing PK_FILE_EXE.
PK_DIR_EXE,
// Directory containing PK_FILE_MODULE.
PK_DIR_MODULE,
// Temporary directory.
PK_DIR_TEMP,
// Path and filename of the current executable.
PK_FILE_EXE,
// Path and filename of the module containing the CEF code (usually the libcef
// module).
PK_FILE_MODULE,
// "Local Settings\Application Data" directory under the user profile
// directory on Windows.
PK_LOCAL_APP_DATA,
// "Application Data" directory under the user profile directory on Windows
// and "~/Library/Application Support" directory on Mac OS X.
PK_USER_DATA
);
// Storage types.
TCefStorageType = (
ST_LOCALSTORAGE = 0,
ST_SESSIONSTORAGE
);
// Supported error code values. See net\base\net_error_list.h for complete
// descriptions of the error codes.
TCefErrorCode = Integer;
Const
ERR_NONE = 0;
ERR_FAILED = -2;
ERR_ABORTED = -3;
ERR_INVALID_ARGUMENT = -4;
ERR_INVALID_HANDLE = -5;
ERR_FILE_NOT_FOUND = -6;
ERR_TIMED_OUT = -7;
ERR_FILE_TOO_BIG = -8;
ERR_UNEXPECTED = -9;
ERR_ACCESS_DENIED = -10;
ERR_NOT_IMPLEMENTED = -11;
ERR_CONNECTION_CLOSED = -100;
ERR_CONNECTION_RESET = -101;
ERR_CONNECTION_REFUSED = -102;
ERR_CONNECTION_ABORTED = -103;
ERR_CONNECTION_FAILED = -104;
ERR_NAME_NOT_RESOLVED = -105;
ERR_INTERNET_DISCONNECTED = -106;
ERR_SSL_PROTOCOL_ERROR = -107;
ERR_ADDRESS_INVALID = -108;
ERR_ADDRESS_UNREACHABLE = -109;
ERR_SSL_CLIENT_AUTH_CERT_NEEDED = -110;
ERR_TUNNEL_CONNECTION_FAILED = -111;
ERR_NO_SSL_VERSIONS_ENABLED = -112;
ERR_SSL_VERSION_OR_CIPHER_MISMATCH = -113;
ERR_SSL_RENEGOTIATION_REQUESTED = -114;
ERR_CERT_COMMON_NAME_INVALID = -200;
ERR_CERT_BEGIN = ERR_CERT_COMMON_NAME_INVALID;
ERR_CERT_DATE_INVALID = -201;
ERR_CERT_AUTHORITY_INVALID = -202;
ERR_CERT_CONTAINS_ERRORS = -203;
ERR_CERT_NO_REVOCATION_MECHANISM = -204;
ERR_CERT_UNABLE_TO_CHECK_REVOCATION = -205;
ERR_CERT_REVOKED = -206;
ERR_CERT_INVALID = -207;
ERR_CERT_WEAK_SIGNATURE_ALGORITHM = -208;
// -209 is available: was ERR_CERT_NOT_IN_DNS.
ERR_CERT_NON_UNIQUE_NAME = -210;
ERR_CERT_WEAK_KEY = -211;
ERR_CERT_NAME_CONSTRAINT_VIOLATION = -212;
ERR_CERT_VALIDITY_TOO_LONG = -213;
ERR_CERT_END = ERR_CERT_VALIDITY_TOO_LONG;
ERR_INVALID_URL = -300;
ERR_DISALLOWED_URL_SCHEME = -301;
ERR_UNKNOWN_URL_SCHEME = -302;
ERR_TOO_MANY_REDIRECTS = -310;
ERR_UNSAFE_REDIRECT = -311;
ERR_UNSAFE_PORT = -312;
ERR_INVALID_RESPONSE = -320;
ERR_INVALID_CHUNKED_ENCODING = -321;
ERR_METHOD_NOT_SUPPORTED = -322;
ERR_UNEXPECTED_PROXY_AUTH = -323;
ERR_EMPTY_RESPONSE = -324;
ERR_RESPONSE_HEADERS_TOO_BIG = -325;
ERR_CACHE_MISS = -400;
ERR_INSECURE_RESPONSE = -501;
Type
// Supported certificate status code values. See net\cert\cert_status_flags.h
// for more information. CERT_STATUS_NONE is new in CEF because we use an
// enum while cert_status_flags.h uses a typedef and static const variables.
TCefCertStatusFlags = (
CERT_STATUS_COMMON_NAME_INVALID, //= 1 shl 0
CERT_STATUS_DATE_INVALID, //= 1 shl 1
CERT_STATUS_AUTHORITY_INVALID, //= 1 shl 2
// 1 << 3 is reserved for ERR_CERT_CONTAINS_ERRORS (not useful with WinHTTP).
CERT_STATUS_NO_REVOCATION_MECHANISM = 4, //= 1 shl 4
CERT_STATUS_UNABLE_TO_CHECK_REVOCATION, //= 1 shl 5
CERT_STATUS_REVOKED, //= 1 shl 6
CERT_STATUS_INVALID, //= 1 shl 7
CERT_STATUS_WEAK_SIGNATURE_ALGORITHM, //= 1 shl 8
// 1 << 9 was used for CERT_STATUS_NOT_IN_DNS
CERT_STATUS_NON_UNIQUE_NAME = 10, //= 1 shl 10
CERT_STATUS_WEAK_KEY, //= 1 shl 11
// 1 << 12 was used for CERT_STATUS_WEAK_DH_KEY
CERT_STATUS_PINNED_KEY_MISSING =13, //= 1 shl 13
CERT_STATUS_NAME_CONSTRAINT_VIOLATION, //= 1 shl 14
CERT_STATUS_VALIDITY_TOO_LONG, //= 1 shl 15
// Bits 16 to 31 are for non-error statuses.
CERT_STATUS_IS_EV, //= 1 shl 16
CERT_STATUS_REV_CHECKING_ENABLED, //= 1 shl 17
// Bit 18 was CERT_STATUS_IS_DNSSEC
CERT_STATUS_SHA1_SIGNATURE_PRESENT = 19, //= 1 shl 19
CERT_STATUS_CT_COMPLIANCE_FAILED //= 1 shl 20
);
TCefCertStatus = set of TCefCertStatusFlags;
Const
CERT_STATUS_NONE: TCefCertStatus = [];