Skip to content

feat(libSceWebBrowserDialog): implement sceWebBrowserDialogSetCookie, ResetCookie, OpenForPredeterminedContent - #1583

Closed
Deses wants to merge 1 commit into
boykopovar:mainfrom
Deses:feat/webbrowserdialog-cookie-calls
Closed

Deses wants to merge 1 commit into
boykopovar:mainfrom
Deses:feat/webbrowserdialog-cookie-calls

Conversation

@Deses

@Deses Deses commented Oct 8, 2026 •

Copy link
Copy Markdown

What

Implements three libSceWebBrowserDialog calls (core/libs/prx/libSceWebBrowserDialog/Export.cpp).

int sceWebBrowserDialogSetCookie(const SceWebBrowserDialogSetCookieParam* param) (NID TZnDVkP91Rg). The param is 280 bytes: size, url, cookie, 256 reserved bytes. Returns NOT_INITIALIZED (0x80B80003) before sceWebBrowserDialogInitialize and ARG_NULL (0x80B8000D) for a null param. Throws for a size other than 280, a null url or cookie, or a url/cookie that does not end within its 2048-/4096-byte buffer. Otherwise copies the url and cookie into an in-memory store (mutex-guarded) and returns 0. Allowed in any initialized state, including finished.

int sceWebBrowserDialogResetCookie(const SceWebBrowserDialogResetCookieParam* param) (NID Cya+jvTtPqg). The param is 264 bytes: size, 256 reserved bytes. Same NOT_INITIALIZED/ARG_NULL checks, throws for a size other than 264, otherwise empties the store and returns 0.

int sceWebBrowserDialogOpenForPredeterminedContent(const SceWebBrowserDialogParam* param, const SceWebBrowserDialogPredeterminedContentParam* contentParam) (NID O7dIZQrwVFY). Same state machine as sceWebBrowserDialogOpen: NOT_INITIALIZED when not initialized, BUSY while running, ARG_NULL when either pointer is null, otherwise the dialog finishes at once and sceWebBrowserDialogGetResult reports USER_CANCELED. The domain allow-list in the second param is not read.

Cookies are kept until sceWebBrowserDialogResetCookie (Terminate does not clear them). No page is ever loaded, so they are never sent. Nothing in the library reads the store yet; it is the state a future dialog implementation would send. #1002 (closed by its author) accepted and discarded the cookie; this keeps it in a store that ResetCookie empties.

TechnicalDebt: WebBrowserDialog is removed from the two "added without an implementation" entries (PPSA12544 Unity plugins: SetCookie; PPSA14632: ResetCookie, OpenForPredeterminedContent). One new "Unknown function info" entry (signature sources, unconfirmed error codes, what throws) and one new "Functional" entry (the dialog shows nothing, domains not read, cookies kept but never sent).

Test guest_web_browser_dialog (core/libs/tests/GuestWebBrowserDialog.cpp) is extended: the three calls before Initialize, null params, valid cookie set/reset, wrong sizes, null url, unterminated url and cookie throw, the 2047-/4095-character boundary is accepted, OpenForPredeterminedContent after Open with null first/second param and valid params, status FINISHED, result USER_CANCELED, cookie calls in the finished state. The test now links libc and calls configure_windows_unwind, as the other tests that catch library exceptions do (catching needs the guest libc's __gxx_personality_v0).

Not settled: no source gives error codes for these three calls or says whether the cookie calls need an initialized library; NOT_INITIALIZED/ARG_NULL follow the library's other calls. SCE_WEB_BROWSER_DIALOG_COOKIE_COUNT (the sample's loop bound) has no known value, so the store has no limit. Recorded in TechnicalDebt.

Sources:

Side note, not part of this PR: the library's existing COMMON_DIALOG_ERROR_BUSY is 0x80B80007, which shadPS4's commondialog.h lists as RESULT_NONE (BUSY there is 0x80B80008); the same value is used by LoginDialog, MsgDialog and CdlgPlayerReview. OpenForPredeterminedContent reuses the library's constant to match Open; the state is never RUNNING here, so the path is not reached. Left for a separate PR.

Tested

Windows 11, MinGW-w64 GCC 15.2.0, built in this branch's own tree: full build, the libs target and ctest -R "web_browser|dialog" (8 tests, guest_web_browser_dialog included) pass, last on 4d03ecf4 after an incremental rebuild; check_conventions.py and check_test_registration.py pass. No title run.

CI: the upstream runs for this head are waiting for approval (#1631). The same Build workflow ran on the fork for head 582e5984: https://github.com/Deses/AnyPS5/actions/runs/37804534368, Linux and Windows (full build, libs, ctest) and the relinker jobs (Linux, Windows, macOS) green.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

@Deses

Deses commented Oct 8, 2026

Copy link
Copy Markdown
Author

All three are text overlaps in docs/dev/TechnicalDebt.md, not shared exports or a dependency:

None of them implements these three calls and this PR does not build on any of them, so Depends on stays none. Whichever merges first, this branch is rebased on main and the line is resolved.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing: these three calls come from import lists, no title is shown stopping at them on main, and nothing reads the cookie store yet. Reopen when one is a title's next stop on main, with the log line.

ycbuzi pushed a commit to ycbuzi/AnyPS5 that referenced this pull request Oct 10, 2026
…WebBrowserDialogSetCookie, ResetCookie, OpenForPredeterminedContent

Harvested from upstream (closed unmerged); library completion 2925/3298 -> 2928/3298. Additive conflicts resolved by keeping both sides: docs/dev/TechnicalDebt.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011krDVCnnMQPaEFEqCDnKmA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build docs needs rebase Conflicts with main, rebase needed prx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants