refactor: update chrome.scripting extensions api impls (#43205)

This commit is contained in:
Shelley Vohr 2024-08-11 21:31:37 +02:00 committed by GitHub
parent 7721fdf886
commit 6d13c503c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 200 additions and 229 deletions

View file

@ -191,6 +191,15 @@ class ScriptingUpdateContentScriptsFunction : public ExtensionFunction {
private:
~ScriptingUpdateContentScriptsFunction() override;
// Returns a UserScript object by updating the `original_script` with the
// `new_script` given delta. If the updated script cannot be parsed, populates
// `parse_error` and returns nullptr.
std::unique_ptr<UserScript> ApplyUpdate(
std::set<std::string>* script_ids_to_persist,
api::scripting::RegisteredContentScript& new_script,
api::scripting::RegisteredContentScript& original_script,
std::u16string* parse_error);
// Called when script files have been checked.
void OnContentScriptFilesValidated(
std::set<std::string> persistent_script_ids,