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

Issue 796453003: Introduce DeclarativeUserScriptManager. (Closed)

Created:
6 years ago by Xi Han
Modified:
6 years ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, extensions-reviews_chromium.org, chromium-apps-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

This CL introduce DeclarativeUserScriptManager to manager a set of DeclarativeUserScriptMaster objects which were stored in the ExtensionSystemImpl. With this refactor, it allows the DeclarativeUserScriptManager to take care of the creations of DeclarativeUserScriptMaster objects: 1) It enable the DeclarativeUserScriptManager accept all kinds of input keys and convert them as a uniform format; 2) The manager will assign a unique ID to the consumer who requests a DeclarativeUserScriptMaster object.The consumer can use this ID to do script injection. (The above two steps will be implemented in another CLs) This refactor is a part of issue "support DeclarativeContent script injection on <webview>", please refer to a design doc(https://goto.google.com/introduceidforscriptinjection). BUG=437566 Committed: https://crrev.com/6d9b43a5c431b04947bdc135b179166e55199efa Cr-Commit-Position: refs/heads/master@{#308171}

Patch Set 1 : #

Total comments: 1

Patch Set 2 : #

Patch Set 3 : Use map to store the DeclarativeUserScriptMaster objects. #

Total comments: 24

Patch Set 4 : Updated based on Devlin@'s comments. #

Total comments: 11

Patch Set 5 : Move back to extensions namespace. #

Total comments: 1

Patch Set 6 : nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+139 lines, -101 lines) Patch
M chrome/browser/extensions/api/declarative_content/content_action.cc View 1 2 chunks +4 lines, -3 lines 0 comments Download
A chrome/browser/extensions/declarative_user_script_manager.h View 1 2 3 4 5 1 chunk +44 lines, -0 lines 0 comments Download
A chrome/browser/extensions/declarative_user_script_manager.cc View 1 2 3 4 1 chunk +32 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_system_impl.h View 1 2 3 6 chunks +8 lines, -13 lines 0 comments Download
M chrome/browser/extensions/extension_system_impl.cc View 6 chunks +13 lines, -28 lines 0 comments Download
M chrome/browser/extensions/test_extension_system.h View 4 4 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/extensions/test_extension_system.cc View 4 chunks +8 lines, -22 lines 0 comments Download
M chrome/chrome_browser_extensions.gypi View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/browser/extension_system.h View 4 3 chunks +4 lines, -6 lines 0 comments Download
M extensions/browser/mock_extension_system.h View 2 chunks +1 line, -2 lines 0 comments Download
M extensions/browser/mock_extension_system.cc View 2 chunks +5 lines, -6 lines 0 comments Download
M extensions/shell/browser/shell_extension_system.h View 4 3 chunks +2 lines, -3 lines 0 comments Download
M extensions/shell/browser/shell_extension_system.cc View 1 2 3 5 chunks +13 lines, -14 lines 0 comments Download

Messages

Total messages: 25 (8 generated)
Xi Han
Please take a look, thanks!
6 years ago (2014-12-11 19:29:50 UTC) #5
Fady Samuel
https://codereview.chromium.org/796453003/diff/60001/chrome/browser/extensions/declarative_user_script_manager.cc File chrome/browser/extensions/declarative_user_script_manager.cc (right): https://codereview.chromium.org/796453003/diff/60001/chrome/browser/extensions/declarative_user_script_manager.cc#newcode23 chrome/browser/extensions/declarative_user_script_manager.cc:23: for (ScopedVector<DeclarativeUserScriptMaster>::iterator it = Why not use a map?
6 years ago (2014-12-11 19:58:27 UTC) #6
Xi Han
PTAL, thanks!
6 years ago (2014-12-12 15:42:13 UTC) #7
Fady Samuel
https://codereview.chromium.org/796453003/diff/100001/extensions/browser/extension_system.h File extensions/browser/extension_system.h (right): https://codereview.chromium.org/796453003/diff/100001/extensions/browser/extension_system.h#newcode81 extensions/browser/extension_system.h:81: virtual DeclarativeUserScriptManager* declarative_user_script_manager() = 0; This is not a ...
6 years ago (2014-12-12 15:44:31 UTC) #8
Fady Samuel
lgtm https://codereview.chromium.org/796453003/diff/100001/extensions/browser/extension_system.h File extensions/browser/extension_system.h (right): https://codereview.chromium.org/796453003/diff/100001/extensions/browser/extension_system.h#newcode81 extensions/browser/extension_system.h:81: virtual DeclarativeUserScriptManager* declarative_user_script_manager() = 0; On 2014/12/12 15:44:31, ...
6 years ago (2014-12-12 16:17:53 UTC) #9
Xi Han
kalman@chromium.org: Please review all changes. Thanks!
6 years ago (2014-12-12 17:05:05 UTC) #11
not at google - send to devlin
I think Devlin knows this code?
6 years ago (2014-12-12 17:25:26 UTC) #13
Xi Han
Devlin: please take a look, thanks!
6 years ago (2014-12-12 17:27:45 UTC) #14
Devlin
High-level question that should maybe go on the doc, but are we planning on keeping ...
6 years ago (2014-12-12 18:08:07 UTC) #15
Xi Han
Devlin: I believe eventually DeclarativeUserScriptManager will be moved out of extensions namespace, but I am ...
6 years ago (2014-12-12 19:47:24 UTC) #17
Devlin
Sorry for the back-and-forth on extensions namespace. https://codereview.chromium.org/796453003/diff/140001/chrome/browser/extensions/declarative_user_script_manager.cc File chrome/browser/extensions/declarative_user_script_manager.cc (right): https://codereview.chromium.org/796453003/diff/140001/chrome/browser/extensions/declarative_user_script_manager.cc#newcode22 chrome/browser/extensions/declarative_user_script_manager.cc:22: return (it->second).get(); ...
6 years ago (2014-12-12 20:02:45 UTC) #18
Xi Han
PTAL, thanks! https://codereview.chromium.org/796453003/diff/140001/chrome/browser/extensions/declarative_user_script_manager.cc File chrome/browser/extensions/declarative_user_script_manager.cc (right): https://codereview.chromium.org/796453003/diff/140001/chrome/browser/extensions/declarative_user_script_manager.cc#newcode22 chrome/browser/extensions/declarative_user_script_manager.cc:22: return (it->second).get(); On 2014/12/12 20:02:45, Devlin wrote: ...
6 years ago (2014-12-12 20:32:31 UTC) #19
Devlin
lgtm https://codereview.chromium.org/796453003/diff/160001/chrome/browser/extensions/declarative_user_script_manager.h File chrome/browser/extensions/declarative_user_script_manager.h (right): https://codereview.chromium.org/796453003/diff/160001/chrome/browser/extensions/declarative_user_script_manager.h#newcode31 chrome/browser/extensions/declarative_user_script_manager.h:31: std::map<std::string, linked_ptr<DeclarativeUserScriptMaster>>; I'm assuming this weird indentation is ...
6 years ago (2014-12-12 20:36:10 UTC) #20
Xi Han
On 2014/12/12 20:36:10, Devlin wrote: > lgtm > > https://codereview.chromium.org/796453003/diff/160001/chrome/browser/extensions/declarative_user_script_manager.h > File chrome/browser/extensions/declarative_user_script_manager.h (right): > ...
6 years ago (2014-12-12 20:41:18 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/796453003/180001
6 years ago (2014-12-12 20:42:02 UTC) #23
commit-bot: I haz the power
Committed patchset #6 (id:180001)
6 years ago (2014-12-12 21:53:54 UTC) #24
commit-bot: I haz the power
6 years ago (2014-12-12 22:01:03 UTC) #25
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/6d9b43a5c431b04947bdc135b179166e55199efa
Cr-Commit-Position: refs/heads/master@{#308171}

Powered by Google App Engine
This is Rietveld 408576698