Title: [273144] trunk/Source/WebKit
Revision
273144
Author
katherine_che...@apple.com
Date
2021-02-19 09:55:36 -0800 (Fri, 19 Feb 2021)

Log Message

Add better error handling to ResourceLoadStatisticsDatabaseStore::needsUpdatedPrivateClickMeasurementSchema()
https://bugs.webkit.org/show_bug.cgi?id=222169
<rdar://problem/74522283>

Reviewed by Darin Adler.

Add better error handling for the case where the query to find the
UnattributedPrivateClickMeasurement table fails. This is unlikely to
happen in practice, however, if it does, we should add logging and
a debug ASSERT.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::needsUpdatedPrivateClickMeasurementSchema):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (273143 => 273144)


--- trunk/Source/WebKit/ChangeLog	2021-02-19 17:38:37 UTC (rev 273143)
+++ trunk/Source/WebKit/ChangeLog	2021-02-19 17:55:36 UTC (rev 273144)
@@ -1,3 +1,19 @@
+2021-02-19  Kate Cheney  <katherine_che...@apple.com>
+
+        Add better error handling to ResourceLoadStatisticsDatabaseStore::needsUpdatedPrivateClickMeasurementSchema()
+        https://bugs.webkit.org/show_bug.cgi?id=222169
+        <rdar://problem/74522283>
+
+        Reviewed by Darin Adler.
+
+        Add better error handling for the case where the query to find the
+        UnattributedPrivateClickMeasurement table fails. This is unlikely to
+        happen in practice, however, if it does, we should add logging and
+        a debug ASSERT.
+
+        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
+        (WebKit::ResourceLoadStatisticsDatabaseStore::needsUpdatedPrivateClickMeasurementSchema):
+
 2021-02-19  Devin Rousso  <drou...@apple.com>
 
         [Payment Request] add an `object data` to `PaymentDetailsBase` so that data specific to Apple Pay can be provided

Modified: trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp (273143 => 273144)


--- trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp	2021-02-19 17:38:37 UTC (rev 273143)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp	2021-02-19 17:55:36 UTC (rev 273144)
@@ -435,14 +435,19 @@
     // Fetch the schema for the existing UnattributedPrivateClickMeasurement table.
     SQLiteStatement statement(m_database, "SELECT type, sql FROM sqlite_master WHERE tbl_name='UnattributedPrivateClickMeasurement' AND type = 'table'");
     if (statement.prepare() != SQLITE_OK) {
-        LOG_ERROR("Unable to prepare statement to fetch schema for the UnattributedPrivateClickMeasurement table.");
+        RELEASE_LOG_ERROR(Network, "%p - ResourceLoadStatisticsDatabaseStore::needsUpdatedPrivateClickMeasurementSchema Unable to prepare statement to fetch schema for the UnattributedPrivateClickMeasurement table, error message: %{private}s", this, m_database.lastErrorMsg());
         ASSERT_NOT_REACHED();
         return false;
     }
 
-    if (statement.step() == SQLITE_ROW)
-        currentSchema = statement.getColumnText(1);
+    if (statement.step() != SQLITE_ROW) {
+        RELEASE_LOG_ERROR(Network, "%p - ResourceLoadStatisticsDatabaseStore::needsUpdatedPrivateClickMeasurementSchema error executing statement to fetch UnattributedPrivateClickMeasurement schema, error message: %{private}s", this, m_database.lastErrorMsg());
+        ASSERT_NOT_REACHED();
+        return false;
+    }
 
+    currentSchema = statement.getColumnText(1);
+
     if (!currentSchema.isEmpty()
         && currentSchema != unattributedPrivateClickMeasurementSchemaV1()
         && currentSchema != unattributedPrivateClickMeasurementSchemaV1Alternate()) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to