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

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot] 2024-08-12 09:55:56 +02:00 committed by GitHub
parent 8dc4d3c040
commit 07668c11d3
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,