Changeset 241304 in webkit
- Timestamp:
- Feb 12, 2019 10:45:31 AM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r241299 r241304 1 2019-02-12 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 [WPE][GTK] Unsafe g_unsetenv() use in WebProcessPool::platformInitialize 4 https://bugs.webkit.org/show_bug.cgi?id=194370 5 6 Reviewed by Darin Adler. 7 8 Change a couple WTFLogAlways to use g_warning, for good measure. Of course this isn't 9 necessary, but it will make errors more visible. 10 11 * inspector/remote/glib/RemoteInspectorGlib.cpp: 12 (Inspector::RemoteInspector::start): 13 (Inspector::dbusConnectionCallAsyncReadyCallback): 14 * inspector/remote/glib/RemoteInspectorServer.cpp: 15 (Inspector::RemoteInspectorServer::start): 16 1 17 2019-02-12 Andy Estes <aestes@apple.com> 2 18 -
trunk/Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorGlib.cpp
r240330 r241304 80 80 inspector->setupConnection(WTFMove(connection)); 81 81 else if (!g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) 82 WTFLogAlways("RemoteInspector failed to connect to inspector server at: %s: %s", g_getenv("WEBKIT_INSPECTOR_SERVER"), error->message);82 g_warning("RemoteInspector failed to connect to inspector server at: %s: %s", g_getenv("WEBKIT_INSPECTOR_SERVER"), error->message); 83 83 }, this); 84 84 } … … 179 179 GRefPtr<GVariant> resultVariant = adoptGRef(g_dbus_connection_call_finish(G_DBUS_CONNECTION(source), result, &error.outPtr())); 180 180 if (!resultVariant && !g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) 181 WTFLogAlways("RemoteInspector failed to send DBus message: %s", error->message);181 g_warning("RemoteInspector failed to send DBus message: %s", error->message); 182 182 } 183 183 -
trunk/Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorServer.cpp
r233077 r241304 198 198 if (!m_dbusServer) { 199 199 if (!g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) 200 WTFLogAlways("Failed to start remote inspector server on %s: %s\n", dbusAddress.get(), error->message);200 g_warning("Failed to start remote inspector server on %s: %s\n", dbusAddress.get(), error->message); 201 201 return false; 202 202 } -
trunk/Source/WebKit/ChangeLog
r241303 r241304 1 2019-02-12 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 [WPE][GTK] Unsafe g_unsetenv() use in WebProcessPool::platformInitialize 4 https://bugs.webkit.org/show_bug.cgi?id=194370 5 6 Reviewed by Darin Adler. 7 8 It is incorrect to use g_unsetenv() here because it is MT-Unsafe. We know that it is 9 impossible and unreasonable to expect the application has not started other threads at this 10 point, and threads will be calling getenv(). WebKit itself has probably already started 11 threads of its own. 12 13 Fortunately, the remote inspector in the web process is already prepared to deal with 14 failure to connect to the inspector server, so we don't need to do anything except stop 15 messing with the environment. 16 17 Note these files are copies of each other. I'll merge them together in a follow-up patch. 18 19 * UIProcess/gtk/WebProcessPoolGtk.cpp: 20 (WebKit::initializeRemoteInspectorServer): 21 (WebKit::WebProcessPool::platformInitialize): 22 * UIProcess/wpe/WebProcessPoolWPE.cpp: 23 (WebKit::initializeRemoteInspectorServer): 24 (WebKit::WebProcessPool::platformInitialize): 25 1 26 2019-02-08 Beth Dakin <bdakin@apple.com> 2 27 -
trunk/Source/WebKit/UIProcess/gtk/WebProcessPoolGtk.cpp
r241224 r241304 46 46 47 47 #if ENABLE(REMOTE_INSPECTOR) 48 static boolinitializeRemoteInspectorServer(const char* address)48 static void initializeRemoteInspectorServer(const char* address) 49 49 { 50 50 if (Inspector::RemoteInspectorServer::singleton().isRunning()) 51 return true;51 return; 52 52 53 53 if (!address[0]) 54 return false;54 return; 55 55 56 56 GUniquePtr<char> inspectorAddress(g_strdup(address)); 57 57 char* portPtr = g_strrstr(inspectorAddress.get(), ":"); 58 58 if (!portPtr) 59 return false;59 return; 60 60 61 61 *portPtr = '\0'; … … 63 63 guint64 port = g_ascii_strtoull(portPtr, nullptr, 10); 64 64 if (!port) 65 return false;65 return; 66 66 67 returnInspector::RemoteInspectorServer::singleton().start(inspectorAddress.get(), port);67 Inspector::RemoteInspectorServer::singleton().start(inspectorAddress.get(), port); 68 68 } 69 69 #endif … … 78 78 { 79 79 #if ENABLE(REMOTE_INSPECTOR) 80 if (const char* address = g_getenv("WEBKIT_INSPECTOR_SERVER")) { 81 if (!initializeRemoteInspectorServer(address)) 82 g_unsetenv("WEBKIT_INSPECTOR_SERVER"); 83 } 80 if (const char* address = g_getenv("WEBKIT_INSPECTOR_SERVER")) 81 initializeRemoteInspectorServer(address); 84 82 #endif 85 83 -
trunk/Source/WebKit/UIProcess/wpe/WebProcessPoolWPE.cpp
r240437 r241304 52 52 53 53 #if ENABLE(REMOTE_INSPECTOR) 54 static boolinitializeRemoteInspectorServer(const char* address)54 static void initializeRemoteInspectorServer(const char* address) 55 55 { 56 56 if (Inspector::RemoteInspectorServer::singleton().isRunning()) 57 return true;57 return; 58 58 59 59 if (!address[0]) 60 return false;60 return; 61 61 62 62 GUniquePtr<char> inspectorAddress(g_strdup(address)); 63 63 char* portPtr = g_strrstr(inspectorAddress.get(), ":"); 64 64 if (!portPtr) 65 return false;65 return; 66 66 67 67 *portPtr = '\0'; … … 69 69 guint64 port = g_ascii_strtoull(portPtr, nullptr, 10); 70 70 if (!port) 71 return false;71 return; 72 72 73 returnInspector::RemoteInspectorServer::singleton().start(inspectorAddress.get(), port);73 Inspector::RemoteInspectorServer::singleton().start(inspectorAddress.get(), port); 74 74 } 75 75 #endif … … 78 78 { 79 79 #if ENABLE(REMOTE_INSPECTOR) 80 if (const char* address = g_getenv("WEBKIT_INSPECTOR_SERVER")) { 81 if (!initializeRemoteInspectorServer(address)) 82 g_unsetenv("WEBKIT_INSPECTOR_SERVER"); 83 } 80 if (const char* address = g_getenv("WEBKIT_INSPECTOR_SERVER")) 81 initializeRemoteInspectorServer(address); 84 82 #endif 85 83 }
Note: See TracChangeset
for help on using the changeset viewer.