当前位置: 首页>>代码示例>>C++>>正文


C++ CefRefPtr::AppendSwitch方法代码示例

本文整理汇总了C++中CefRefPtr::AppendSwitch方法的典型用法代码示例。如果您正苦于以下问题:C++ CefRefPtr::AppendSwitch方法的具体用法?C++ CefRefPtr::AppendSwitch怎么用?C++ CefRefPtr::AppendSwitch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CefRefPtr的用法示例。


在下文中一共展示了CefRefPtr::AppendSwitch方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnBeforeCommandLineProcessing

void ClientApp::OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr<CefCommandLine> command_line)
{
    // disable proxy resolution (we might want to contact a local server from the UI)
    command_line->AppendSwitch(TEXT("no-proxy-server"));
    
    // ignore certificate errors (e.g., in case the app makes requests to HTTPS services with self-signed certificates)
    command_line->AppendSwitch(TEXT("ignore-certificate-errors"));
}
开发者ID:vnmc,项目名称:zephyros,代码行数:8,代码来源:client_app.cpp

示例2: OnBeforeCommandLineProcessing

void FCEFBrowserApp::OnBeforeCommandLineProcessing(const CefString& ProcessType, CefRefPtr< CefCommandLine > CommandLine)
{
	CommandLine->AppendSwitch("disable-gpu");
	CommandLine->AppendSwitch("disable-gpu-compositing");
#if !PLATFORM_MAC
	CommandLine->AppendSwitch("enable-begin-frame-scheduling");
#endif
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:8,代码来源:CEFBrowserApp.cpp

示例3: OnBeforeCommandLineProcessing

void CWebApp::OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr<CefCommandLine> command_line)
{
    command_line->AppendSwitch("disable-gpu-compositing");
    command_line->AppendSwitch("disable-gpu");
    // command_line->AppendSwitch("disable-d3d11");
    command_line->AppendSwitch("enable-begin-frame-scheduling");

    command_line->AppendSwitchWithValue("autoplay-policy", "no-user-gesture-required");
}
开发者ID:Audifire,项目名称:mtasa-blue,代码行数:9,代码来源:CWebApp.cpp

示例4: OnBeforeCommandLineProcessing

void LootApp::OnBeforeCommandLineProcessing(const CefString& process_type,
                                            CefRefPtr<CefCommandLine> command_line) {
  if (process_type.empty()) {
      // Browser process, OK to modify the command line.

      // Disable spell checking.
    command_line->AppendSwitch("--disable-spell-checking");
    command_line->AppendSwitch("--disable-extensions");
  }
}
开发者ID:silentdark,项目名称:loot,代码行数:10,代码来源:loot_app.cpp

示例5: OnBeforeCommandLineProcessing

void WebRendererApp::OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr<CefCommandLine> command_line)
{
	// CEF will NOT shut down properly unless this switch is passed
	// See https://bitbucket.org/chromiumembedded/cef/issues/1680/windows-2454-crash-on-shutdown-with-multi
	command_line->AppendSwitch("disable-extensions");

	// These switches make performance significantly faster, especially at high resolutions
	// See https://bitbucket.org/chromiumembedded/cef/commits/e3c1d8632eb43c1c2793d71639f3f5695696a5e8
	command_line->AppendSwitch("disable-gpu");
	command_line->AppendSwitch("disable-gpu-compositing");
	command_line->AppendSwitch("enable-begin-frame-scheduling");
	command_line->AppendSwitch("enable-experimental-web-platform-features");
}
开发者ID:RabidSquabbit,项目名称:ElDorito,代码行数:13,代码来源:WebRendererApp.cpp

示例6: OnBeforeCommandLineProcessing

//////////////////////////////////////////////////////////////////////////////////////////
// CefApp methods.
void ClientApp::OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr<CefCommandLine> command_line)
{
	// Pass additional command-line flags to the browser process.
	if (process_type.empty()) 
	{
		command_line->AppendSwitchWithValue("ppapi-flash-version", "20.0.0.228");
		command_line->AppendSwitchWithValue("ppapi-flash-path", "PepperFlash\\pepflashplayer.dll");

		//同一个域下的使用同一个渲染进程
		command_line->AppendSwitch("process-per-site");
		command_line->AppendSwitch("disable-gpu");
		command_line->AppendSwitch("disable-gpu-compositing");
		//command_line->AppendSwitchWithValue("proxy-server", "SOCKS5://127.0.0.1:1080");	

		// 开启离屏渲染
		if (CefManager::GetInstance()->IsEnableOffsetRender())
		{
			command_line->AppendSwitch("disable-surfaces");
			command_line->AppendSwitch("enable-begin-frame-scheduling");
		}
	}
}
开发者ID:arlen7772gg,项目名称:NIM_Duilib_Framework,代码行数:24,代码来源:client_app.cpp

示例7: OnBeforeCommandLineProcessing

/*--cef(optional_param=process_type)--*/
void App::OnBeforeCommandLineProcessing(
        const CefString& process_type,
        CefRefPtr<CefCommandLine> command_line) {
    // May be called on any thread?
    if (process_type.empty()) {
        // Browser process.
        json_value* appSettings = GetApplicationSettings();
        json_value switches = (*appSettings)["chrome"]["command_line_switches"];
        if (switches.type == json_object) {
            int length = switches.u.object.length;
            for (int i = 0; i < length; i++) {
                std::string name = switches.u.object.values[i].name;
                std::string value = (*switches.u.object.values[i].value);
                if (name.find("-") == 0) {
                    LOG_WARNING << "Invalid command line switch: " << name;
                    continue;
                }
                if (command_line->HasSwitch(name)) {
                    if (value.empty()) {
                        // Switch already set, do nothing.
                    } else {
                        std::string oldValue = command_line->GetSwitchValue(name);
                        if (oldValue != value) {
                            // Overwrite the switch with a new value.
                            command_line->AppendSwitchWithValue(name, value);
                        }
                    }
                } else {
                    if (value.empty()) {
                        command_line->AppendSwitch(name);
                    } else {
                        command_line->AppendSwitchWithValue(name, value);
                    }
                }
            }
        }
    }
    std::string process_name = "browser";
    if (!process_type.empty()) {
        process_name = process_type;
    }
    LOG_DEBUG << "Command line string for the " << process_name << " process: "
              << command_line->GetCommandLineString().ToString();
}
开发者ID:ARSrabon,项目名称:phpdesktop,代码行数:45,代码来源:app.cpp

示例8: OnBeforeCommandLineProcessing

void Application::OnBeforeCommandLineProcessing(
	const CefString& process_type,
	CefRefPtr<CefCommandLine> command_line)
{
	/*
	command_line->AppendSwitch("allow-no-sandbox-job");
	command_line->AppendSwitch("disable-gpu-sandbox");
	command_line->AppendSwitch("disable-3d-apis");
	command_line->AppendSwitch("disable-webgl");
	*/

	command_line->AppendSwitch("off-screen-rendering-enabled");
	command_line->AppendSwitchWithValue("off-screen-frame-rate", "60");
	command_line->AppendSwitch("enable-font-antialiasing");
	command_line->AppendSwitch("enable-media-stream");

	command_line->AppendSwitch("disable-gpu");
	command_line->AppendSwitch("disable-gpu-compositing");
	command_line->AppendSwitch("enable-begin-frame-scheduling");
};
开发者ID:ChairGraveyard,项目名称:RadiantUI,代码行数:20,代码来源:Application.cpp

示例9: OnBeforeCommandLineProcessing

void MainCefApp::OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr< CefCommandLine > command_line)
{
	// Enable WebGL part 2 (other is in CefMediator.cpp) (or not disable is better description)
	if (!setup::ENABLE_WEBGL)
	{
		// Setup for offscreen rendering
		command_line->AppendSwitch("disable-gpu");
		command_line->AppendSwitch("disable-gpu-compositing");
		command_line->AppendSwitch("enable-begin-frame-scheduling"); // breaks WebGL, but better for performance
	}

	command_line->AppendSwitch("enable-logging"); // get LOG(..) writes in console
	command_line->AppendSwitch("no-sandbox"); // for what necessary?

	// EXPERIMENTAL: slow loading?
	// see end of https://bitbucket.org/chromiumembedded/cef/wiki/GeneralUsage#markdown-header-proxy-resolution
	command_line->AppendSwitch("no-proxy-server");

	// EXPERIMENTAL
	// Javascript debugging?
	command_line->AppendArgument("remote-debugging-port=2012");
}
开发者ID:Institute-Web-Science-and-Technologies,项目名称:GazeTheWeb,代码行数:22,代码来源:MainCefApp.cpp

示例10: OnBeforeCommandLineProcessing

void Application::OnBeforeCommandLineProcessing( const CefString& process_type, CefRefPtr<CefCommandLine> command_line )
{
    command_line->AppendSwitch("allow-file-access-from-files");
    //command_line->AppendSwitchWithValue("use-gl", "desktop"); // enforce OpenGL not Angle
    //command_line->AppendSwitch("enable-media-stream"); // WebRTC
}
开发者ID:hsimpson,项目名称:cordova-cef,代码行数:6,代码来源:application.cpp

示例11: OnBeforeCommandLineProcessing

void ClientApp::OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr<CefCommandLine> command_line)
{
	//Extra command line switches
	command_line->AppendSwitch("enable-media-stream");
	command_line->AppendSwitch("no-sandbox");
}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:6,代码来源:ClientApp.cpp


注:本文中的CefRefPtr::AppendSwitch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。