首页 > cef > CEF-CefSettings结构体简介
2017七月31

CEF-CefSettings结构体简介

  // 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.
  ///
  int single_process;

设置为true时,Browser和Renderer使用一个进程,这种方式不被chrome官方支持,相对于多进程模式也缺少稳定性, 此项也可以通过命令行参数“single-process”配置

   

  // 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.
  ///
  int no_sandbox;

设置为true时,禁用子进程的沙箱

   

  // The path to a separate executable that will be launched for sub-processes.
  // By default the browser process executable is used. See the comments on
  // CefExecuteProcess() for details. Also configurable using the
  // "browser-subprocess-path" command-line switch.
  ///
  cef_string_t browser_subprocess_path;

 设置用于启动子进程单独执行器的路径

  

  // 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.
  ///
  int multi_threaded_message_loop;

设置为true时,使用自己独立的消息循环,设置为false,则要在应用中的消息循环调用CefDoMessageLoopWork()函数(执行CEF消息循环处理的单次迭代)

   

  ///
  // 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.
  ///
  int windowless_rendering_enabled;

设置为true启用无窗口渲染支持,如果应用没有使用无窗口渲染,则启用它可能降低某些系统的渲染性能

   

  // 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.
  ///
  int command_line_args_disabled;

设置为true来禁用对命令行参数的处理,如果想指定命令行参数传入主应用程序,实现CefApp::OnBeforeCommandLineProcessing()方法

   

  // 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.
  ///
  cef_string_t cache_path;

设置磁盘上用于存放缓存数据的位置。如果此项为空,某些功能将使用内存缓存,多数功能将使用临时的磁盘缓存。形如本地存储的HTML5数据库只能在设置了缓存路径才能跨session存储

   

  // 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).
  ///
  cef_string_t user_data_path;

设置磁盘上用于存放用户数据的位置,如果为空,默认使用Local Settings\Application Data\CEF\User Data目录

   

  // 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.
  ///
  int persist_session_cookies;

默认使用全局cookie管理器设置此值为true(1),Session cookies通常是短暂的,web browser不会执久化它们

   

  // 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.
  ///
  int persist_user_preferences;

设置此值为true用于将用户首选项做为JSON文件保存到缓存路径目录中.

  

  // 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.
  ///
  cef_string_t product_version;

 产品版本号,如果为空则使用chromium的版本号,如果userAgent指定了就忽略此值,也可配值"product-version"命令行开关

   

  // 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.
  ///
  cef_string_t locale;

如果此项为空,将使用默认值“en-US”。在Linux平台下此项被忽略,使用环境变量中的值,解析的依次顺序为:LANGUAE,LC_ALL,LC_MESSAGES和LANG。此项也可以通过命令行参数“lang”配置

   

  // 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.
  ///
  cef_string_t log_file;

此项设置的文件夹和文件名将用于输出debug日志。如果此项为空,默认的日志文件名为debug.log,位于应用程序所在的目录。此项也可以通过命令参数“log-file”配置

   

  // The log severity. Only messages of this severity level or higher will be
  // logged. Also configurable using the "log-severity" command-line switch with
  // a value of "verbose", "info", "warning", "error", "error-report" or
  // "disable".
  ///
  cef_log_severity_t log_severity;

此项设置日志级别。只有此等级、或者比此等级高的日志的才会被记录。此项可以通过命令行参数“log-severity”配置,可以设置的值为“verbose”,“info”,“warning”,“error”,“error-report”,“disable”

     

  // 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.
  ///
  cef_string_t javascript_flags;

初始化V8引擎时使用自定义的flags,自定义flags的后果是没有被很好测试,可以通过命令行参数"js-flags"配置

   

  // 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.
  ///
  cef_string_t resources_dir_path;

设置资源文件夹的位置。如果此项为空,Windows平台下cef.pak、Linux平台下devtools_resourcs.pak、Mac OS X下的app bundle Resources目录必须位于组件目录。此项也可以通过命令行参数“resource-dir-path”配置

   

  // 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.
  ///
  cef_string_t locales_dir_path;

此项设置locale文件夹位置。如果此项为空,locale文件夹必须位于组件目录,在Mac OS X平台下此项被忽略因为pak文件总是从app bundle Resources目录加载。此项也可以通过命令行参数“locales-dir-path”配置。

   

  // 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.
  ///
  int pack_loading_disabled;

设置为true以禁止加载资源和区域设置的pack文件,如果加载pack文件被禁用了,必须通过CefApp::GetResourceBundleHandler()为浏览器提供一个Resource bundle句柄,此项也可以通过命令行参数“disable-pack-loading”配置。

   

  // 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.
  ///
  int remote_debugging_port;

可以设置1024-65535之间的值,用于在指定端口开启远程调试。例如,如果设置的值为8080,远程调试的URL为http://localhost:8080。CEF或者Chrome浏览器能够调试CEF。此项也可以通过命令行参数“remote-debugging-port”配置。  

   

  // 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.
  ///
  int uncaught_exception_stack_size;

捕获异常的帧数,指定一个正值来启用CefRenderProcessHandler::OnUncaughtException()回调,指定为0(默认值)则OnUncaughtException()不会被调用,此项也可以通过命令行参数"uncaught-exception-stack-size"配置

       

  // 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.
  ///
  int context_safety_implementation;

安全计数

   

  // 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.
  ///
  cef_color_t background_color;

背景色

  

  // 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.
  ///
  cef_string_t accept_language_list;

逗号分隔的语言列表

   

   

   

文章作者:hgy413
本文地址:https://hgy413.com/4134.html
版权所有 © 转载时必须以链接形式注明作者和原始出处!

16 Responses to “CEF-CefSettings结构体简介”

  1. #1 minecraft 回复 | 引用 Post:2018-10-04 23:08

    Good post. I learn something new and challenging on websites I stumbleupon everyday.
    It will always be interesting to read articles from other
    authors and use a little something from their websites.

  2. #2 minecraft 回复 | 引用 Post:2018-10-07 18:49

    Thanks for finally writing about >blog topic <Loved it!

  3. What’s Going down i am new to this, I stumbled upon this I have found It absolutely helpful and it has helped
    me out loads. I am hoping to contribute & aid different customers like its aided me.
    Good job.

  4. #4 Benefits of Coconut Oil 回复 | 引用 Post:2018-10-21 07:05

    Hi would you mind letting me know which webhost you’re working
    with? I’ve loaded your blog in 3 completely different internet browsers and I must say this blog loads a lot quicker then most.

    Can you recommend a good web hosting provider at a reasonable price?
    Thank you, I appreciate it!

  5. #5 descargar facebook 回复 | 引用 Post:2018-11-02 00:29

    Good information. Lucky me I came across your site by chance
    (stumbleupon). I have book marked it for later!

  6. #6 descargar facebook 回复 | 引用 Post:2018-11-02 18:06

    Hello, i think that i saw you visited my web site so i came to “return the
    favor”.I am trying to find things to enhance my web site!I suppose
    its ok to use a few of your ideas!!

  7. #7 quest bars cheap 回复 | 引用 Post:2018-11-03 04:41

    Greetings! Very useful advice within this article! It is the
    little changes that produce the most significant changes.
    Thanks for sharing!

  8. #8 Sling TV 回复 | 引用 Post:2018-11-14 06:57

    I go to see every day a few web sites and websites to read content, but this website provides feature based content.

  9. Sling tv coupons and promo codes for november 2018
    Good site you have here.. It’s hard to find quality writing like
    yours these days. I honestly appreciate people like you!

    Take care!! Sling tv coupons and promo codes for november 2018

  10. What i don’t realize is actually how you’re not actually a lot more neatly-preferred than you might be now.
    You’re so intelligent. You recognize thus considerably with regards to this matter,
    made me in my view believe it from a lot of various angles.

    Its like women and men don’t seem to be involved unless it’s one thing to
    accomplish with Woman gaga! Your personal stuffs excellent.
    Always maintain it up!

  11. #11 descargar facebook 回复 | 引用 Post:2018-11-22 09:19

    I love reading through an article that can make people think.
    Also, thanks for permitting me to comment!

  12. #12 g well 回复 | 引用 Post:2020-06-10 12:36

    Awesome post.

  13. #13 g think 回复 | 引用 Post:2020-06-10 16:20

    Thanks for every other magnificent article. Where else could
    anyone get that type of information in such an ideal manner
    of writing? I have a presentation subsequent week, and I am at
    the look for such information.

  14. #14 look g 回复 | 引用 Post:2020-06-12 10:19

    I’m not that much of a online reader to be honest but
    your sites really nice, keep it up! I’ll go ahead and bookmark your
    site to come back later. Cheers

  15. #15 it g 回复 | 引用 Post:2020-06-12 11:28

    I like what you guys tend to be up too. This kind of
    clever work and exposure! Keep up the terrific works guys I’ve included you guys to
    my own blogroll.

  16. #16 g 回复 | 引用 Post:2020-06-12 20:54

    It’s hard to come by educated people for this subject, however,
    you seem like you know what you’re talking about! Thanks

发表评论