MCPcopy Create free account
hub / github.com/cztomczak/cefpython / OnBeforeCommandLineProcessing

Method OnBeforeCommandLineProcessing

src/subprocess/cefpython_app.cpp:57–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55// -----------------------------------------------------------------------------
56
57void CefPythonApp::OnBeforeCommandLineProcessing(
58 const CefString& process_type,
59 CefRefPtr<CefCommandLine> command_line) {
60 // IMPORTANT NOTES
61 // ---------------
62 // NOTE 1: Currently CEF logging is limited and you cannot log
63 // info messages during execution of this function. The
64 // default log severity in Chromium is LOG_ERROR, thus
65 // you can will only see log messages when using LOG(ERROR)
66 // here. You won't see LOG(WARNING) nor LOG(INFO) messages
67 // here.
68 // NOTE 2: The "g_debug" variable is never set at this moment
69 // due to IPC messaging delay. There is some code here
70 // that depends on this variable, but it is currently
71 // never executed.
72
73#ifdef BROWSER_PROCESS
74 // This is included only in the Browser process, when building
75 // the libcefpythonapp library.
76 if (process_type.empty()) {
77 // Empty proc type, so this must be the main browser process.
78 App_OnBeforeCommandLineProcessing_BrowserProcess(command_line);
79 }
80#endif // BROWSER_PROCESS
81
82 // IMPORTANT: This code is currently dead due to g_debug and
83 // LOG(INFO) issues described at the top of this
84 // function. Command line string for subprocesses are
85 // are currently logged in OnBeforeChildProcess().
86 // Command line string for the main browser process
87 // is currently never logged.
88 std::string process_name = process_type.ToString();
89 if (process_name.empty()) {
90 process_name = "browser";
91 }
92#ifdef BROWSER_PROCESS
93 std::string logMessage = "[Browser process] ";
94#else // BROWSER_PROCESS
95 std::string logMessage = "[Non-browser process] ";
96#endif // BROWSER_PROCESS
97 logMessage.append("Command line string for the ");
98 logMessage.append(process_name);
99 logMessage.append(" process: ");
100 std::string clString = command_line->GetCommandLineString().ToString();
101 logMessage.append(clString.c_str());
102 if (g_debug) {
103 // This code is currently never executed, see the "IMPORTANT"
104 // comment above and comments at the top of this function.
105 LOG(INFO) << logMessage.c_str();
106 }
107
108#ifdef OS_WIN
109 // Set AppUserModelID (AppID) when "--app-user-model-id" switch
110 // is provided. This fixes pinning to taskbar issues on Windows 10.
111 // See Issue #395 for details.
112 //
113 // AppID here is set in all processes (Browser, Renderer, GPU, etc.).
114 //

Callers

nothing calls this directly

Calls 5

ToStringMethod · 0.80
c_strMethod · 0.80
ToWStringMethod · 0.80
emptyMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected