Changeset 173238 in webkit
- Timestamp:
- Sep 3, 2014 3:50:17 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r173237 r173238 1 2014-09-03 Joseph Pecoraro <pecoraro@apple.com> 2 3 Avoid warning if a process does not have access to com.apple.webinspector 4 https://bugs.webkit.org/show_bug.cgi?id=136473 5 6 Reviewed by Alexey Proskuryakov. 7 8 Pre-check for access to the mach port to avoid emitting warnings 9 in syslog for processes that do not have access. 10 11 * inspector/remote/RemoteInspector.mm: 12 (Inspector::canAccessWebInspectorMachPort): 13 (Inspector::RemoteInspector::shared): 14 1 15 2014-09-03 Filip Pizlo <fpizlo@apple.com> 2 16 -
trunk/Source/JavaScriptCore/inspector/remote/RemoteInspector.mm
r172532 r173238 41 41 #if __has_include(<xpc/xpc.h>) 42 42 #import <xpc/xpc.h> 43 #e lse43 #endif 44 44 extern "C" { 45 45 xpc_connection_t xpc_connection_create_mach_service(const char* name, dispatch_queue_t, uint64_t flags); 46 46 void xpc_release(xpc_object_t); 47 47 } 48 49 #if __has_include(<sandbox/private.h>) 50 #import <sandbox/private.h> 51 #else 52 enum sandbox_filter_type { 53 SANDBOX_FILTER_GLOBAL_NAME, 54 }; 48 55 #endif 56 extern "C" { 57 int sandbox_check(pid_t, const char *operation, enum sandbox_filter_type, ...); 58 } 49 59 50 60 #if PLATFORM(IOS) … … 54 64 namespace Inspector { 55 65 66 static bool canAccessWebInspectorMachPort() 67 { 68 return sandbox_check(getpid(), "mach-lookup", SANDBOX_FILTER_GLOBAL_NAME, WIRXPCMachPortName) == 0; 69 } 70 56 71 static void dispatchAsyncOnQueueSafeForAnyDebuggable(void (^block)()) 57 72 { … … 79 94 static dispatch_once_t once; 80 95 dispatch_once(&once, ^{ 81 JSC::initializeThreading(); 82 if (RemoteInspector::startEnabled) 83 shared.get().start(); 96 if (canAccessWebInspectorMachPort()) { 97 JSC::initializeThreading(); 98 if (RemoteInspector::startEnabled) 99 shared.get().start(); 100 } 84 101 }); 85 102
Note: See TracChangeset
for help on using the changeset viewer.