Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Issue 362343006: Fix dangerous pointer use in UserScriptMaster (Closed)

Created:
6 years, 5 months ago by Devlin
Modified:
6 years, 5 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

UserScriptMaster::ScriptReloader chooses to make a plain pointer to a UserScriptList from UserScriptMaster. This leads to problems: - What if master goes away? - What if the UserScriptList is modified, as in UserScriptMaster::OnExtensionLoaded? Fix this by making the script loading process in UserScriptMaster much simpler: UserScriptMaster calls LoadScriptsOnFile thread, and uses the result, using a weak pointer. Added bonus: Two fewer ref-counted objects! 50 fewer lines of code! Less script loading! BUG=383973 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=282361

Patch Set 1 : #

Total comments: 4

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+320 lines, -374 lines) Patch
M chrome/browser/extensions/convert_user_script.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/extensions/extension_system_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/extension_system_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/user_script_master.h View 1 9 chunks +35 lines, -88 lines 0 comments Download
M chrome/browser/extensions/user_script_master.cc View 1 9 chunks +270 lines, -255 lines 0 comments Download
M chrome/browser/extensions/user_script_master_unittest.cc View 11 chunks +12 lines, -27 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Devlin
Antony, mind taking a look? https://codereview.chromium.org/362343006/diff/20001/chrome/browser/extensions/user_script_master.cc File chrome/browser/extensions/user_script_master.cc (left): https://codereview.chromium.org/362343006/diff/20001/chrome/browser/extensions/user_script_master.cc#oldcode60 chrome/browser/extensions/user_script_master.cc:60: bool UserScriptMaster::ScriptReloader::ParseMetadataHeader( This function ...
6 years, 5 months ago (2014-07-07 16:07:27 UTC) #1
asargent_no_longer_on_chrome
typo in CL description: "chooses to take a make a ..." [kind of sounds like ...
6 years, 5 months ago (2014-07-08 20:59:13 UTC) #2
Devlin
https://codereview.chromium.org/362343006/diff/20001/chrome/browser/extensions/user_script_master.cc File chrome/browser/extensions/user_script_master.cc (right): https://codereview.chromium.org/362343006/diff/20001/chrome/browser/extensions/user_script_master.cc#newcode375 chrome/browser/extensions/user_script_master.cc:375: user_scripts_.reset(user_scripts.release()); On 2014/07/08 20:59:13, Antony Sargent wrote: > In ...
6 years, 5 months ago (2014-07-09 16:03:25 UTC) #3
asargent_no_longer_on_chrome
nice, this seems better lgtm
6 years, 5 months ago (2014-07-09 22:08:20 UTC) #4
Devlin
The CQ bit was checked by rdevlin.cronin@chromium.org
6 years, 5 months ago (2014-07-10 15:19:08 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rdevlin.cronin@chromium.org/362343006/60001
6 years, 5 months ago (2014-07-10 15:19:56 UTC) #6
commit-bot: I haz the power
6 years, 5 months ago (2014-07-10 17:08:05 UTC) #7
Message was sent while issue was closed.
Change committed as 282361

Powered by Google App Engine
This is Rietveld 408576698