X Tutup
Skip to content

Commit 750eece

Browse files
committed
- GetJavascriptStackTrace() checks whether running on UI thread.
- Dummy API updated: cefpython.py
1 parent 3691120 commit 750eece

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

cefexample/_changelog.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Version 0.42 not yet released.
22
* Rebind/reload example added to cefadvanced.py.
33
* en-US locale was outdated, came from revision `607`, locales/ directory contains all locales now, the default one is "en-US", others are optional and do not need to be distributed.
4-
* OnConsoleMessage example added to cefadvanced.py
5-
* You can now get javascript stack trace, see: [cefpython].GetJavascriptStackTrace() and [cefpython].GetJavascriptStackTraceFormatted().
4+
* !OnConsoleMessage example added to cefadvanced.py
5+
* You can now get javascript stack trace, see: [cefpython].!GetJavascriptStackTrace() and [cefpython].!GetJavascriptStackTraceFormatted().
66

77
Version 0.41 released on 2012-09-14.
88
* New options in [ApplicationSettings]: auto_detect_proxy_settings_enabled, pack_loading_disabled.

cefexample/cefpython.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ def ExceptHook(type, value, traceObject):
1717
def GetBrowserByWindowID(windowID):
1818
return Browser()
1919

20+
def GetJavascriptStackTrace(frameLimit=100):
21+
return []
22+
23+
def GetJavascriptStackTraceFormatted(frameLimit=100):
24+
return ""
25+
2026
def GetRealPath(file=None, encodeURL=False):
2127
return ""
2228

cefpython.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ def IsKeyModifier(key, modifiers):
261261

262262
def GetJavascriptStackTrace(frameLimit=100):
263263

264+
assert CurrentlyOn(TID_UI), "cefpython.GetJavascriptStackTrace() may only be called on the UI thread"
265+
264266
cdef CefRefPtr[CefV8StackTrace] cefTrace = cef_v8_stack.GetCurrent(int(frameLimit))
265267
cdef int frameCount = (<CefV8StackTrace*>(cefTrace.get())).GetFrameCount()
266268
cdef CefRefPtr[CefV8StackFrame] cefFrame

0 commit comments

Comments
 (0)
X Tutup