X Tutup
Skip to content

Commit 0ece555

Browse files
committed
Added commandLineSwitches param to cefpython.Initialize().
See Issue 65. Debug options set in python (debug and log_file) are now shared with the C++ browser process code. See Issue 98. Added new option "debug" to ApplicationSettings. See Issue 100. All examples have been updated to use this option, instead of overwriting cefpython module g_debug global variable.
1 parent 85dd535 commit 0ece555

File tree

22 files changed

+517
-319
lines changed

22 files changed

+517
-319
lines changed

cefpython/app.pyx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright (c) 2012-2013 The CEF Python authors. All rights reserved.
2+
# License: New BSD License.
3+
# Website: http://code.google.com/p/cefpython/
4+
5+
cdef public void App_OnBeforeCommandLineProcessing_BrowserProcess(
6+
CefRefPtr[CefCommandLine] cefCommandLine
7+
) except * with gil:
8+
global g_commandLineSwitches
9+
try:
10+
AppendSwitchesToCommandLine(cefCommandLine, g_commandLineSwitches)
11+
Debug("App_OnBeforeCommandLineProcessing_BrowserProcess()")
12+
except:
13+
(exc_type, exc_value, exc_trace) = sys.exc_info()
14+
sys.excepthook(exc_type, exc_value, exc_trace)

cefpython/browser_process_handler_cef3.pyx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,20 @@
55
cdef public void BrowserProcessHandler_OnRenderProcessThreadCreated(
66
CefRefPtr[CefListValue] extra_info
77
) except * with gil:
8-
global g_debug
9-
global g_applicationSettings
10-
cdef py_string logFile
118
try:
12-
logFile = "debug.log"
13-
if "log_file" in g_applicationSettings:
14-
logFile = g_applicationSettings["log_file"]
15-
extra_info.get().SetBool(0, bool(g_debug))
16-
extra_info.get().SetString(1, PyToCefStringValue(logFile))
9+
# Keys 0 and 1 are already set in C++ code - to pass debug options.
10+
pass
11+
except:
12+
(exc_type, exc_value, exc_trace) = sys.exc_info()
13+
sys.excepthook(exc_type, exc_value, exc_trace)
14+
15+
cdef public void BrowserProcessHandler_OnBeforeChildProcessLaunch(
16+
CefRefPtr[CefCommandLine] cefCommandLine
17+
) except * with gil:
18+
global g_commandLineSwitches
19+
try:
20+
AppendSwitchesToCommandLine(cefCommandLine, g_commandLineSwitches)
21+
Debug("BrowserProcessHandler_OnBeforeChildProcessLaunch()")
1722
except:
1823
(exc_type, exc_value, exc_trace) = sys.exc_info()
1924
sys.excepthook(exc_type, exc_value, exc_trace)

cefpython/cef3/cefpython_public_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// All the imports that are required when including "cefpython.h".
1818
#include "include/cef_client.h"
1919
#include "include/cef_urlrequest.h"
20+
#include "include/cef_command_line.h"
2021
#include "util.h"
2122

2223
// Python 3.2 fix - DL_IMPORT is not defined in Python.h

0 commit comments

Comments
 (0)
X Tutup