Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SQLiteTransaction notify SQLiteDatabaseTracker on macOS #15700

Conversation

bnham
Copy link
Contributor

@bnham bnham commented Jul 10, 2023

722cf99

Make SQLiteTransaction notify SQLiteDatabaseTracker on macOS
https://bugs.webkit.org/show_bug.cgi?id=259062
rdar://112027513

Reviewed by Chris Dumez and Brent Fulgham.

In 265791@main we enabled SQLiteDatabaseTracker on macOS, but it still does nothing because
SQLiteTransaction doesn't notify it. Change SQLiteTransaction to notify the tracker about ongoing
transactions on macOS as well.

* Source/WebCore/platform/sql/SQLiteTransaction.cpp:
(WebCore::SQLiteTransaction::begin):
(WebCore::SQLiteTransaction::commit):
(WebCore::SQLiteTransaction::rollback):
(WebCore::SQLiteTransaction::stop):

Canonical link: https://commits.webkit.org/265918@main

63729d5

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv ⏳ πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  tv-sim
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@bnham bnham self-assigned this Jul 10, 2023
@bnham bnham added the Website Storage Bugs related to storage APIs, including IndexedDB and localStorage label Jul 10, 2023
@bnham bnham requested review from cdumez, beidson and szewai July 10, 2023 18:01
@bnham
Copy link
Contributor Author

bnham commented Jul 10, 2023

I did not change the #if PLATFORM(IOS_FAMILY) for truncateDatabaseFile because it's only relevant to users of WebDatabase, and you can't use WebDatabase on builds that enable SDKAlignedBehavior::FullySuspendsBackgroundContent on macOS.

@bnham bnham force-pushed the eng/Make-SQLiteTransaction-notify-SQLiteDatabaseTracker-on-macOS branch from 8dc15e1 to 63729d5 Compare July 10, 2023 18:07
@@ -27,10 +27,7 @@
#include "SQLiteTransaction.h"

#include "SQLiteDatabase.h"

#if PLATFORM(IOS_FAMILY)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be #if PLATFORM(COCOA)? Or does this stuff exist/work on GTK/Windows?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the tracker code, it seems cross-platform, so this seems right.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SQLiteDatabaseTracker builds fine on all platforms but is a no-op on some platforms. It doesn't hurt to run this code everywhere and dropping the #if checks makes the code nicer.

Copy link
Contributor

@cdumez cdumez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -27,10 +27,7 @@
#include "SQLiteTransaction.h"

#include "SQLiteDatabase.h"

#if PLATFORM(IOS_FAMILY)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the tracker code, it seems cross-platform, so this seems right.

@bnham bnham added the merge-queue Applied to send a pull request to merge-queue label Jul 10, 2023
https://bugs.webkit.org/show_bug.cgi?id=259062
rdar://112027513

Reviewed by Chris Dumez and Brent Fulgham.

In 265791@main we enabled SQLiteDatabaseTracker on macOS, but it still does nothing because
SQLiteTransaction doesn't notify it. Change SQLiteTransaction to notify the tracker about ongoing
transactions on macOS as well.

* Source/WebCore/platform/sql/SQLiteTransaction.cpp:
(WebCore::SQLiteTransaction::begin):
(WebCore::SQLiteTransaction::commit):
(WebCore::SQLiteTransaction::rollback):
(WebCore::SQLiteTransaction::stop):

Canonical link: https://commits.webkit.org/265918@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Make-SQLiteTransaction-notify-SQLiteDatabaseTracker-on-macOS branch from 63729d5 to 722cf99 Compare July 10, 2023 21:35
@webkit-commit-queue
Copy link
Collaborator

Committed 265918@main (722cf99): https://commits.webkit.org/265918@main

Reviewed commits have been landed. Closing PR #15700 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 722cf99 into WebKit:main Jul 10, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Website Storage Bugs related to storage APIs, including IndexedDB and localStorage
Projects
None yet
5 participants