Title: [240696] trunk/Source/WebKit
Revision
240696
Author
[email protected]
Date
2019-01-29 17:42:43 -0800 (Tue, 29 Jan 2019)

Log Message

Change NetworkConnectionToWebProcess* to NetworkConnectionToWebProcess& where possible
https://bugs.webkit.org/show_bug.cgi?id=193974

Reviewed by Tim Horton.

* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerFileBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURL):
(WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
(WebKit::NetworkBlobRegistry::unregisterBlobURL):
(WebKit::NetworkBlobRegistry::blobSize):
(WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
(WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
(WebKit::NetworkConnectionToWebProcess::blobSize):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
* NetworkProcess/NetworkProcess.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (240695 => 240696)


--- trunk/Source/WebKit/ChangeLog	2019-01-30 01:16:04 UTC (rev 240695)
+++ trunk/Source/WebKit/ChangeLog	2019-01-30 01:42:43 UTC (rev 240696)
@@ -1,3 +1,32 @@
+2019-01-29  Alex Christensen  <[email protected]>
+
+        Change NetworkConnectionToWebProcess* to NetworkConnectionToWebProcess& where possible
+        https://bugs.webkit.org/show_bug.cgi?id=193974
+
+        Reviewed by Tim Horton.
+
+        * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
+        (WebKit::NetworkBlobRegistry::registerFileBlobURL):
+        (WebKit::NetworkBlobRegistry::registerBlobURL):
+        (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
+        (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
+        (WebKit::NetworkBlobRegistry::unregisterBlobURL):
+        (WebKit::NetworkBlobRegistry::blobSize):
+        (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
+        * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+        (WebKit::NetworkConnectionToWebProcess::didClose):
+        (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
+        (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
+        (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
+        (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
+        (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
+        (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
+        (WebKit::NetworkConnectionToWebProcess::blobSize):
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess):
+        * NetworkProcess/NetworkProcess.h:
+
 2019-01-29  Youenn Fablet  <[email protected]>
 
         Adopt new SPI to evaluate server certificate trust

Modified: trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp (240695 => 240696)


--- trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp	2019-01-30 01:16:04 UTC (rev 240695)
+++ trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp	2019-01-30 01:42:43 UTC (rev 240696)
@@ -48,36 +48,36 @@
 {
 }
 
-void NetworkBlobRegistry::registerFileBlobURL(NetworkConnectionToWebProcess* connection, const URL& url, const String& path, RefPtr<SandboxExtension>&& sandboxExtension, const String& contentType)
+void NetworkBlobRegistry::registerFileBlobURL(NetworkConnectionToWebProcess& connection, const URL& url, const String& path, RefPtr<SandboxExtension>&& sandboxExtension, const String& contentType)
 {
     blobRegistry().registerFileBlobURL(url, BlobDataFileReferenceWithSandboxExtension::create(path, WTFMove(sandboxExtension)), contentType);
 
-    ASSERT(!m_blobsForConnection.get(connection).contains(url));
-    BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(connection);
+    ASSERT(!m_blobsForConnection.get(&connection).contains(url));
+    BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(&connection);
     if (mapIterator == m_blobsForConnection.end())
-        mapIterator = m_blobsForConnection.add(connection, HashSet<URL>()).iterator;
+        mapIterator = m_blobsForConnection.add(&connection, HashSet<URL>()).iterator;
     mapIterator->value.add(url);
 }
 
-void NetworkBlobRegistry::registerBlobURL(NetworkConnectionToWebProcess* connection, const URL& url, Vector<WebCore::BlobPart>&& blobParts, const String& contentType)
+void NetworkBlobRegistry::registerBlobURL(NetworkConnectionToWebProcess& connection, const URL& url, Vector<WebCore::BlobPart>&& blobParts, const String& contentType)
 {
     blobRegistry().registerBlobURL(url, WTFMove(blobParts), contentType);
 
-    ASSERT(!m_blobsForConnection.get(connection).contains(url));
-    BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(connection);
+    ASSERT(!m_blobsForConnection.get(&connection).contains(url));
+    BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(&connection);
     if (mapIterator == m_blobsForConnection.end())
-        mapIterator = m_blobsForConnection.add(connection, HashSet<URL>()).iterator;
+        mapIterator = m_blobsForConnection.add(&connection, HashSet<URL>()).iterator;
     mapIterator->value.add(url);
 }
 
-void NetworkBlobRegistry::registerBlobURL(NetworkConnectionToWebProcess* connection, const URL& url, const URL& srcURL, bool shouldBypassConnectionCheck)
+void NetworkBlobRegistry::registerBlobURL(NetworkConnectionToWebProcess& connection, const URL& url, const URL& srcURL, bool shouldBypassConnectionCheck)
 {
     // The connection may not be registered if NetworkProcess prevously crashed for any reason.
-    BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(connection);
+    BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(&connection);
     if (mapIterator == m_blobsForConnection.end()) {
         if (!shouldBypassConnectionCheck)
             return;
-        mapIterator = m_blobsForConnection.add(connection, HashSet<URL>()).iterator;
+        mapIterator = m_blobsForConnection.add(&connection, HashSet<URL>()).iterator;
     }
 
     blobRegistry().registerBlobURL(url, srcURL);
@@ -86,21 +86,21 @@
     mapIterator->value.add(url);
 }
 
-void NetworkBlobRegistry::registerBlobURLOptionallyFileBacked(NetworkConnectionToWebProcess* connection, const URL& url, const URL& srcURL, const String& fileBackedPath, const String& contentType)
+void NetworkBlobRegistry::registerBlobURLOptionallyFileBacked(NetworkConnectionToWebProcess& connection, const URL& url, const URL& srcURL, const String& fileBackedPath, const String& contentType)
 {
     blobRegistry().registerBlobURLOptionallyFileBacked(url, srcURL, BlobDataFileReferenceWithSandboxExtension::create(fileBackedPath, nullptr), contentType);
 
-    ASSERT(!m_blobsForConnection.get(connection).contains(url));
-    BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(connection);
+    ASSERT(!m_blobsForConnection.get(&connection).contains(url));
+    BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(&connection);
     if (mapIterator == m_blobsForConnection.end())
-        mapIterator = m_blobsForConnection.add(connection, HashSet<URL>()).iterator;
+        mapIterator = m_blobsForConnection.add(&connection, HashSet<URL>()).iterator;
     mapIterator->value.add(url);
 }
 
-void NetworkBlobRegistry::registerBlobURLForSlice(NetworkConnectionToWebProcess* connection, const URL& url, const URL& srcURL, int64_t start, int64_t end)
+void NetworkBlobRegistry::registerBlobURLForSlice(NetworkConnectionToWebProcess& connection, const URL& url, const URL& srcURL, int64_t start, int64_t end)
 {
     // The connection may not be registered if NetworkProcess prevously crashed for any reason.
-    BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(connection);
+    BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(&connection);
     if (mapIterator == m_blobsForConnection.end())
         return;
 
@@ -110,10 +110,10 @@
     mapIterator->value.add(url);
 }
 
-void NetworkBlobRegistry::unregisterBlobURL(NetworkConnectionToWebProcess* connection, const URL& url)
+void NetworkBlobRegistry::unregisterBlobURL(NetworkConnectionToWebProcess& connection, const URL& url)
 {
     // The connection may not be registered if NetworkProcess prevously crashed for any reason.
-    BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(connection);
+    BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(&connection);
     if (mapIterator == m_blobsForConnection.end())
         return;
 
@@ -122,9 +122,9 @@
     mapIterator->value.remove(url);
 }
 
-uint64_t NetworkBlobRegistry::blobSize(NetworkConnectionToWebProcess* connection, const URL& url)
+uint64_t NetworkBlobRegistry::blobSize(NetworkConnectionToWebProcess& connection, const URL& url)
 {
-    if (!m_blobsForConnection.contains(connection) || !m_blobsForConnection.find(connection)->value.contains(url))
+    if (!m_blobsForConnection.contains(&connection) || !m_blobsForConnection.find(&connection)->value.contains(url))
         return 0;
 
     return blobRegistry().blobSize(url);
@@ -154,16 +154,16 @@
     });
 }
 
-void NetworkBlobRegistry::connectionToWebProcessDidClose(NetworkConnectionToWebProcess* connection)
+void NetworkBlobRegistry::connectionToWebProcessDidClose(NetworkConnectionToWebProcess& connection)
 {
-    if (!m_blobsForConnection.contains(connection))
+    if (!m_blobsForConnection.contains(&connection))
         return;
 
-    HashSet<URL>& blobsForConnection = m_blobsForConnection.find(connection)->value;
+    HashSet<URL>& blobsForConnection = m_blobsForConnection.find(&connection)->value;
     for (HashSet<URL>::iterator iter = blobsForConnection.begin(), end = blobsForConnection.end(); iter != end; ++iter)
         blobRegistry().unregisterBlobURL(*iter);
 
-    m_blobsForConnection.remove(connection);
+    m_blobsForConnection.remove(&connection);
 }
 
 Vector<RefPtr<BlobDataFileReference>> NetworkBlobRegistry::filesInBlob(NetworkConnectionToWebProcess& connection, const URL& url)

Modified: trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.h (240695 => 240696)


--- trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.h	2019-01-30 01:16:04 UTC (rev 240695)
+++ trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.h	2019-01-30 01:42:43 UTC (rev 240696)
@@ -46,17 +46,17 @@
     NetworkBlobRegistry();
     static NetworkBlobRegistry& singleton();
 
-    void registerFileBlobURL(NetworkConnectionToWebProcess*, const URL&, const String& path, RefPtr<SandboxExtension>&&, const String& contentType);
-    void registerBlobURL(NetworkConnectionToWebProcess*, const URL&, Vector<WebCore::BlobPart>&&, const String& contentType);
-    void registerBlobURL(NetworkConnectionToWebProcess*, const URL&, const URL& srcURL, bool shouldBypassConnectionCheck);
-    void registerBlobURLOptionallyFileBacked(NetworkConnectionToWebProcess*, const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType);
-    void registerBlobURLForSlice(NetworkConnectionToWebProcess*, const URL&, const URL& srcURL, int64_t start, int64_t end);
-    void unregisterBlobURL(NetworkConnectionToWebProcess*, const URL&);
-    uint64_t blobSize(NetworkConnectionToWebProcess*, const URL&);
+    void registerFileBlobURL(NetworkConnectionToWebProcess&, const URL&, const String& path, RefPtr<SandboxExtension>&&, const String& contentType);
+    void registerBlobURL(NetworkConnectionToWebProcess&, const URL&, Vector<WebCore::BlobPart>&&, const String& contentType);
+    void registerBlobURL(NetworkConnectionToWebProcess&, const URL&, const URL& srcURL, bool shouldBypassConnectionCheck);
+    void registerBlobURLOptionallyFileBacked(NetworkConnectionToWebProcess&, const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType);
+    void registerBlobURLForSlice(NetworkConnectionToWebProcess&, const URL&, const URL& srcURL, int64_t start, int64_t end);
+    void unregisterBlobURL(NetworkConnectionToWebProcess&, const URL&);
+    uint64_t blobSize(NetworkConnectionToWebProcess&, const URL&);
     void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&&)>&&);
     void writeBlobToFilePath(const URL& blobURL, const String& path, CompletionHandler<void(bool success)>&&);
 
-    void connectionToWebProcessDidClose(NetworkConnectionToWebProcess*);
+    void connectionToWebProcessDidClose(NetworkConnectionToWebProcess&);
 
     Vector<RefPtr<WebCore::BlobDataFileReference>> filesInBlob(NetworkConnectionToWebProcess&, const URL&);
     Vector<RefPtr<WebCore::BlobDataFileReference>> filesInBlob(const URL&);

Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (240695 => 240696)


--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2019-01-30 01:16:04 UTC (rev 240695)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2019-01-30 01:42:43 UTC (rev 240696)
@@ -249,8 +249,8 @@
     // root activity trackers.
     stopAllNetworkActivityTracking();
 
-    NetworkBlobRegistry::singleton().connectionToWebProcessDidClose(this);
-    m_networkProcess->removeNetworkConnectionToWebProcess(this);
+    NetworkBlobRegistry::singleton().connectionToWebProcessDidClose(*this);
+    m_networkProcess->removeNetworkConnectionToWebProcess(*this);
 
 #if USE(LIBWEBRTC)
     if (m_rtcProvider) {
@@ -495,37 +495,37 @@
 {
     RefPtr<SandboxExtension> extension = SandboxExtension::create(WTFMove(extensionHandle));
 
-    NetworkBlobRegistry::singleton().registerFileBlobURL(this, url, path, WTFMove(extension), contentType);
+    NetworkBlobRegistry::singleton().registerFileBlobURL(*this, url, path, WTFMove(extension), contentType);
 }
 
 void NetworkConnectionToWebProcess::registerBlobURL(const URL& url, Vector<BlobPart>&& blobParts, const String& contentType)
 {
-    NetworkBlobRegistry::singleton().registerBlobURL(this, url, WTFMove(blobParts), contentType);
+    NetworkBlobRegistry::singleton().registerBlobURL(*this, url, WTFMove(blobParts), contentType);
 }
 
 void NetworkConnectionToWebProcess::registerBlobURLFromURL(const URL& url, const URL& srcURL, bool shouldBypassConnectionCheck)
 {
-    NetworkBlobRegistry::singleton().registerBlobURL(this, url, srcURL, shouldBypassConnectionCheck);
+    NetworkBlobRegistry::singleton().registerBlobURL(*this, url, srcURL, shouldBypassConnectionCheck);
 }
 
 void NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, const String& fileBackedPath, const String& contentType)
 {
-    NetworkBlobRegistry::singleton().registerBlobURLOptionallyFileBacked(this, url, srcURL, fileBackedPath, contentType);
+    NetworkBlobRegistry::singleton().registerBlobURLOptionallyFileBacked(*this, url, srcURL, fileBackedPath, contentType);
 }
 
 void NetworkConnectionToWebProcess::registerBlobURLForSlice(const URL& url, const URL& srcURL, int64_t start, int64_t end)
 {
-    NetworkBlobRegistry::singleton().registerBlobURLForSlice(this, url, srcURL, start, end);
+    NetworkBlobRegistry::singleton().registerBlobURLForSlice(*this, url, srcURL, start, end);
 }
 
 void NetworkConnectionToWebProcess::unregisterBlobURL(const URL& url)
 {
-    NetworkBlobRegistry::singleton().unregisterBlobURL(this, url);
+    NetworkBlobRegistry::singleton().unregisterBlobURL(*this, url);
 }
 
 void NetworkConnectionToWebProcess::blobSize(const URL& url, uint64_t& resultSize)
 {
-    resultSize = NetworkBlobRegistry::singleton().blobSize(this, url);
+    resultSize = NetworkBlobRegistry::singleton().blobSize(*this, url);
 }
 
 void NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&&)>&& completionHandler)

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (240695 => 240696)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2019-01-30 01:16:04 UTC (rev 240695)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2019-01-30 01:42:43 UTC (rev 240696)
@@ -184,9 +184,9 @@
 }
 #endif
 
-void NetworkProcess::removeNetworkConnectionToWebProcess(NetworkConnectionToWebProcess* connection)
+void NetworkProcess::removeNetworkConnectionToWebProcess(NetworkConnectionToWebProcess& connection)
 {
-    size_t vectorIndex = m_webProcessConnections.find(connection);
+    size_t vectorIndex = m_webProcessConnections.find(&connection);
     ASSERT(vectorIndex != notFound);
 
     m_webProcessConnections.remove(vectorIndex);

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.h (240695 => 240696)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.h	2019-01-30 01:16:04 UTC (rev 240695)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.h	2019-01-30 01:42:43 UTC (rev 240696)
@@ -124,7 +124,7 @@
         m_supplements.add(T::supplementName(), std::make_unique<T>(*this));
     }
 
-    void removeNetworkConnectionToWebProcess(NetworkConnectionToWebProcess*);
+    void removeNetworkConnectionToWebProcess(NetworkConnectionToWebProcess&);
 
     AuthenticationManager& authenticationManager();
     DownloadManager& downloadManager();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to