Changeset 166756 in webkit
- Timestamp:
- Apr 3, 2014 5:50:49 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSContext.mm
r166367 r166756 214 214 } 215 215 216 - (BOOL)_includesNativeCallStackWhenReportingExceptions 217 { 218 return JSGlobalContextGetIncludesNativeCallStackWhenReportingExceptions(m_context); 219 } 220 221 - (void)_setIncludesNativeCallStackWhenReportingExceptions:(BOOL)includeNativeCallStack 222 { 223 JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions(m_context, includeNativeCallStack); 224 } 225 216 226 @end 217 227 -
trunk/Source/JavaScriptCore/API/JSContextPrivate.h
r166367 r166756 39 39 @property (setter=_setRemoteInspectionEnabled:) BOOL _remoteInspectionEnabled NS_AVAILABLE(10_10, 8_0); 40 40 41 /*! 42 @property 43 @discussion Set whether or not the native call stack is included when reporting exceptions. Default value is YES. 44 */ 45 @property (setter=_setIncludesNativeCallStackWhenReportingExceptions:) BOOL _includesNativeCallStackWhenReportingExceptions NS_AVAILABLE(10_10, 8_0); 46 41 47 @end 42 48 -
trunk/Source/JavaScriptCore/API/JSContextRef.cpp
r166415 r166756 41 41 #include <wtf/text/StringHash.h> 42 42 43 #if ENABLE(REMOTE_INSPECTOR) 44 #include "JSGlobalObjectInspectorController.h" 45 #endif 46 43 47 #if OS(DARWIN) 44 48 #include <mach-o/dyld.h> … … 321 325 exec->vmEntryGlobalObject()->setRemoteDebuggingEnabled(enabled); 322 326 } 327 328 bool JSGlobalContextGetIncludesNativeCallStackWhenReportingExceptions(JSGlobalContextRef ctx) 329 { 330 #if ENABLE(REMOTE_INSPECTOR) 331 if (!ctx) { 332 ASSERT_NOT_REACHED(); 333 return false; 334 } 335 336 ExecState* exec = toJS(ctx); 337 JSLockHolder lock(exec); 338 339 JSGlobalObject* globalObject = exec->vmEntryGlobalObject(); 340 return globalObject->inspectorController().includesNativeCallStackWhenReportingExceptions(); 341 #else 342 UNUSED_PARAM(ctx); 343 return false; 344 #endif 345 } 346 347 void JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions(JSGlobalContextRef ctx, bool includesNativeCallStack) 348 { 349 #if ENABLE(REMOTE_INSPECTOR) 350 if (!ctx) { 351 ASSERT_NOT_REACHED(); 352 return; 353 } 354 355 ExecState* exec = toJS(ctx); 356 JSLockHolder lock(exec); 357 358 JSGlobalObject* globalObject = exec->vmEntryGlobalObject(); 359 globalObject->inspectorController().setIncludesNativeCallStackWhenReportingExceptions(includesNativeCallStack); 360 #else 361 UNUSED_PARAM(ctx); 362 UNUSED_PARAM(includesNativeCallStack); 363 #endif 364 } 365 -
trunk/Source/JavaScriptCore/API/JSContextRefPrivate.h
r166367 r166756 112 112 JS_EXPORT void JSGlobalContextSetRemoteInspectionEnabled(JSGlobalContextRef ctx, bool enabled) CF_AVAILABLE(10_10, 8_0); 113 113 114 /*! 115 @function 116 @abstract Gets the include native call stack when reporting exceptions setting for a context. 117 @param ctx The JSGlobalContext whose setting you want to get. 118 @result The value of the setting, true if remote inspection is enabled, otherwise false. 119 @discussion This setting is true by default. 120 */ 121 JS_EXPORT bool JSGlobalContextGetIncludesNativeCallStackWhenReportingExceptions(JSGlobalContextRef ctx) CF_AVAILABLE(10_10, 8_0); 122 123 /*! 124 @function 125 @abstract Sets the include native call stack when reporting exceptions setting for a context. 126 @param ctx The JSGlobalContext that you want to change. 127 @param includeNativeCallStack The new value of the setting for the context. 128 */ 129 JS_EXPORT void JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions(JSGlobalContextRef ctx, bool includesNativeCallStack) CF_AVAILABLE(10_10, 8_0); 130 114 131 #ifdef __cplusplus 115 132 } -
trunk/Source/JavaScriptCore/ChangeLog
r166732 r166756 1 2014-04-03 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: JSContext inspection provide a way to opt-out of including Native Call Stacks in Exception traces reported to Web Inspector 4 https://bugs.webkit.org/show_bug.cgi?id=131186 5 6 Reviewed by Geoffrey Garen. 7 8 * API/JSContextPrivate.h: 9 * API/JSContext.mm: 10 (-[JSContext _includesNativeCallStackWhenReportingExceptions]): 11 (-[JSContext _setIncludesNativeCallStackWhenReportingExceptions:]): 12 JSContext ObjC SPI to opt-out of including native call stacks in exceptions. 13 14 * API/JSContextRefPrivate.h: 15 * API/JSContextRef.cpp: 16 (JSGlobalContextGetIncludesNativeCallStackWhenReportingExceptions): 17 (JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions): 18 JSContext C SPI to opt-out of including native call stacks in exceptions. 19 20 * inspector/JSGlobalObjectInspectorController.h: 21 * inspector/JSGlobalObjectInspectorController.cpp: 22 (Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController): 23 (Inspector::JSGlobalObjectInspectorController::reportAPIException): 24 Only include the native call stack if the setting is enabled. It is enabled by default. 25 1 26 2014-04-03 Mark Lam <mark.lam@apple.com> 2 27 -
trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
r165575 r166756 56 56 , m_injectedScriptManager(std::make_unique<InjectedScriptManager>(*this, InjectedScriptHost::create())) 57 57 , m_inspectorFrontendChannel(nullptr) 58 , m_includeNativeCallStackWithExceptions(true) 58 59 { 59 60 auto runtimeAgent = std::make_unique<JSGlobalObjectRuntimeAgent>(m_injectedScriptManager.get(), m_globalObject); … … 148 149 149 150 RefPtr<ScriptCallStack> callStack = createScriptCallStackFromException(exec, exception, ScriptCallStack::maxCallStackSizeToCapture); 150 appendAPIBacktrace(callStack.get()); 151 if (includesNativeCallStackWhenReportingExceptions()) 152 appendAPIBacktrace(callStack.get()); 151 153 152 154 // FIXME: <http://webkit.org/b/115087> Web Inspector: Should not evaluate JavaScript handling exceptions -
trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.h
r165199 r166756 65 65 void globalObjectDestroyed(); 66 66 67 bool includesNativeCallStackWhenReportingExceptions() const { return m_includeNativeCallStackWithExceptions; } 68 void setIncludesNativeCallStackWhenReportingExceptions(bool includesNativeCallStack) { m_includeNativeCallStackWithExceptions = includesNativeCallStack; } 69 67 70 void reportAPIException(JSC::ExecState*, JSC::JSValue exception); 68 71 … … 86 89 InspectorFrontendChannel* m_inspectorFrontendChannel; 87 90 RefPtr<InspectorBackendDispatcher> m_inspectorBackendDispatcher; 91 bool m_includeNativeCallStackWithExceptions; 88 92 }; 89 93
Note: See TracChangeset
for help on using the changeset viewer.