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

Issue 1047943002: Cache --whitelisted-extension-id in SimpleFeature. (Closed)

Created:
5 years, 8 months ago by jackhou1
Modified:
5 years, 8 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Cache --whitelisted-extension-id in SimpleFeature. During startup, CommandLine::HasSwitch(kWhitelistedExtensionID) is called ~1000 times by SimpleFeature. It is the most common switch lookup, the second being kAppsGalleryUpdateUrl at ~300 times. Caching this avoids allocating and copying the string each time. BUG=471976, 476061 Committed: https://crrev.com/16ca320592ce7ef6cd36500da6e670cc645781cd Cr-Commit-Position: refs/heads/master@{#324583} Committed: https://crrev.com/c587f309e39c1713a00745f3f73442d93fa4687d Cr-Commit-Position: refs/heads/master@{#324821}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address comments. #

Total comments: 2

Patch Set 3 : Sync and rebase #

Patch Set 4 : Address comments. #

Total comments: 2

Patch Set 5 : Address comments. #

Total comments: 4

Patch Set 6 : Fix test. #

Total comments: 4

Patch Set 7 : Simplify test. #

Patch Set 8 : Fix other test #

Patch Set 9 : Set command line switch in SetUp instead of SetUpTestCase. #

Total comments: 4

Patch Set 10 : Address comments #

Patch Set 11 : Expose SetWhitelistedExtensionId for tests. #

Total comments: 8

Patch Set 12 : Address comments. #

Total comments: 5

Patch Set 13 : Address comments. #

Patch Set 14 : Update tests that fail on memory bots. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -40 lines) Patch
M chrome/browser/extensions/permission_message_combinations_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +10 lines, -5 lines 0 comments Download
M chrome/browser/extensions/test_extension_environment.h View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/extensions/test_extension_environment.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +35 lines, -14 lines 0 comments Download
M chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/common/extensions/manifest_tests/extension_manifests_launcher_page_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -3 lines 0 comments Download
M extensions/common/features/simple_feature.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +12 lines, -0 lines 0 comments Download
M extensions/common/features/simple_feature.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +33 lines, -14 lines 0 comments Download

Messages

Total messages: 49 (10 generated)
jackhou1
tapted, could you take a look?
5 years, 8 months ago (2015-03-31 02:25:08 UTC) #2
tapted
kalman should take a look If this is an identified hotspot, there's a lot of ...
5 years, 8 months ago (2015-03-31 03:26:49 UTC) #4
jackhou1
https://codereview.chromium.org/1047943002/diff/1/extensions/common/features/simple_feature.cc File extensions/common/features/simple_feature.cc (right): https://codereview.chromium.org/1047943002/diff/1/extensions/common/features/simple_feature.cc#newcode351 extensions/common/features/simple_feature.cc:351: extension_id != whitelisted_extension_id()) { On 2015/03/31 03:26:49, tapted wrote: ...
5 years, 8 months ago (2015-03-31 04:37:45 UTC) #5
tapted
https://codereview.chromium.org/1047943002/diff/20001/extensions/common/features/simple_feature.cc File extensions/common/features/simple_feature.cc (right): https://codereview.chromium.org/1047943002/diff/20001/extensions/common/features/simple_feature.cc#newcode349 extensions/common/features/simple_feature.cc:349: (whitelisted_extension_id().empty() || hm - two function calls isn't quite ...
5 years, 8 months ago (2015-03-31 04:46:07 UTC) #6
jackhou1
https://codereview.chromium.org/1047943002/diff/20001/extensions/common/features/simple_feature.cc File extensions/common/features/simple_feature.cc (right): https://codereview.chromium.org/1047943002/diff/20001/extensions/common/features/simple_feature.cc#newcode349 extensions/common/features/simple_feature.cc:349: (whitelisted_extension_id().empty() || On 2015/03/31 04:46:07, tapted wrote: > hm ...
5 years, 8 months ago (2015-03-31 05:28:22 UTC) #7
tapted
lgtm with one more change.. sorry for my horrible review https://codereview.chromium.org/1047943002/diff/60001/extensions/common/features/simple_feature.h File extensions/common/features/simple_feature.h (right): https://codereview.chromium.org/1047943002/diff/60001/extensions/common/features/simple_feature.h#newcode177 ...
5 years, 8 months ago (2015-03-31 05:43:30 UTC) #8
jackhou1
https://codereview.chromium.org/1047943002/diff/60001/extensions/common/features/simple_feature.h File extensions/common/features/simple_feature.h (right): https://codereview.chromium.org/1047943002/diff/60001/extensions/common/features/simple_feature.h#newcode177 extensions/common/features/simple_feature.h:177: static bool IsWhitelistedByCommandLine(const std::string& extension_id); On 2015/03/31 05:43:30, tapted ...
5 years, 8 months ago (2015-03-31 05:56:12 UTC) #9
jackhou1
kalman, please take a look.
5 years, 8 months ago (2015-03-31 05:56:43 UTC) #10
not at google - send to devlin
lgtm https://codereview.chromium.org/1047943002/diff/80001/extensions/common/features/simple_feature.cc File extensions/common/features/simple_feature.cc (right): https://codereview.chromium.org/1047943002/diff/80001/extensions/common/features/simple_feature.cc#newcode231 extensions/common/features/simple_feature.cc:231: (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( why are the parens around the base::CommandLine... ...
5 years, 8 months ago (2015-03-31 17:16:05 UTC) #11
jackhou1
https://codereview.chromium.org/1047943002/diff/80001/extensions/common/features/simple_feature.cc File extensions/common/features/simple_feature.cc (right): https://codereview.chromium.org/1047943002/diff/80001/extensions/common/features/simple_feature.cc#newcode231 extensions/common/features/simple_feature.cc:231: (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( On 2015/03/31 17:16:05, kalman wrote: > why are ...
5 years, 8 months ago (2015-03-31 21:53:41 UTC) #12
not at google - send to devlin
https://codereview.chromium.org/1047943002/diff/80001/extensions/common/features/simple_feature.cc File extensions/common/features/simple_feature.cc (right): https://codereview.chromium.org/1047943002/diff/80001/extensions/common/features/simple_feature.cc#newcode231 extensions/common/features/simple_feature.cc:231: (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( On 2015/03/31 21:53:41, jackhou1 wrote: > On 2015/03/31 ...
5 years, 8 months ago (2015-03-31 22:10:05 UTC) #13
jackhou1
kalman, PTAL, needed to update a test. https://codereview.chromium.org/1047943002/diff/80001/extensions/common/features/simple_feature.cc File extensions/common/features/simple_feature.cc (right): https://codereview.chromium.org/1047943002/diff/80001/extensions/common/features/simple_feature.cc#newcode231 extensions/common/features/simple_feature.cc:231: (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( On ...
5 years, 8 months ago (2015-03-31 22:19:18 UTC) #14
not at google - send to devlin
https://codereview.chromium.org/1047943002/diff/100001/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc File chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc (right): https://codereview.chromium.org/1047943002/diff/100001/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc#newcode77 chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc:77: switches::kWhitelistedExtensionID, test_id); This is why I wrote ScopedCommandLineSwitch: https://code.google.com/p/chromium/codesearch#chromium/src/extensions/common/features/simple_feature_unittest.cc&q=scopedcommandlineswitch&sq=package:chromium&l=29&type=cs ...
5 years, 8 months ago (2015-03-31 22:21:51 UTC) #15
jackhou1
https://codereview.chromium.org/1047943002/diff/100001/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc File chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc (right): https://codereview.chromium.org/1047943002/diff/100001/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc#newcode77 chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc:77: switches::kWhitelistedExtensionID, test_id); On 2015/03/31 22:21:51, kalman wrote: > This ...
5 years, 8 months ago (2015-03-31 22:55:38 UTC) #16
jackhou1
kalman, PTAL, just want to check you're okay with the test changes before I commit.
5 years, 8 months ago (2015-04-01 03:48:12 UTC) #17
not at google - send to devlin
Sorry about slow response, had to leave office early yesterday. https://codereview.chromium.org/1047943002/diff/100001/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc File chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc (right): https://codereview.chromium.org/1047943002/diff/100001/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc#newcode77 ...
5 years, 8 months ago (2015-04-01 17:08:21 UTC) #18
jackhou1
https://codereview.chromium.org/1047943002/diff/100001/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc File chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc (right): https://codereview.chromium.org/1047943002/diff/100001/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc#newcode77 chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc:77: switches::kWhitelistedExtensionID, test_id); On 2015/04/01 17:08:21, kalman wrote: > On ...
5 years, 8 months ago (2015-04-02 01:28:57 UTC) #19
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1047943002/160001
5 years, 8 months ago (2015-04-02 01:31:18 UTC) #22
commit-bot: I haz the power
This issue passed the CQ dry run.
5 years, 8 months ago (2015-04-02 02:24:47 UTC) #24
not at google - send to devlin
> Looks like this requires a bit of a refactor, maybe something like: > https://codereview.chromium.org/1054813002 ...
5 years, 8 months ago (2015-04-02 14:24:15 UTC) #25
not at google - send to devlin
lgtm, we should get this in by Friday, but I think there is some follow-up ...
5 years, 8 months ago (2015-04-02 14:31:57 UTC) #26
jackhou1
> lgtm, we should get this in by Friday, but I think there is some ...
5 years, 8 months ago (2015-04-07 23:46:21 UTC) #27
not at google - send to devlin
Yes it would be nice to update the TabCapture API to use a BehaviorFeature, rather ...
5 years, 8 months ago (2015-04-07 23:53:55 UTC) #29
mark a. foltz
On 2015/04/07 23:53:55, kalman wrote: > Yes it would be nice to update the TabCapture ...
5 years, 8 months ago (2015-04-08 00:19:54 UTC) #30
jackhou1
Unfortunately, PlatformAppsManifestTest.PlatformAppContentSecurityPolicy is still failing. Since unit tests are run in the same process, caching ...
5 years, 8 months ago (2015-04-08 07:02:49 UTC) #31
not at google - send to devlin
https://codereview.chromium.org/1047943002/diff/200001/extensions/common/features/simple_feature.cc File extensions/common/features/simple_feature.cc (right): https://codereview.chromium.org/1047943002/diff/200001/extensions/common/features/simple_feature.cc#newcode30 extensions/common/features/simple_feature.cc:30: std::string* whitelisted_extension_id = NULL; should be g_whitelisted_extension_id; https://codereview.chromium.org/1047943002/diff/200001/extensions/common/features/simple_feature.cc#newcode381 extensions/common/features/simple_feature.cc:381: ...
5 years, 8 months ago (2015-04-08 17:59:22 UTC) #32
jackhou1
https://codereview.chromium.org/1047943002/diff/200001/extensions/common/features/simple_feature.cc File extensions/common/features/simple_feature.cc (right): https://codereview.chromium.org/1047943002/diff/200001/extensions/common/features/simple_feature.cc#newcode30 extensions/common/features/simple_feature.cc:30: std::string* whitelisted_extension_id = NULL; On 2015/04/08 17:59:22, kalman wrote: ...
5 years, 8 months ago (2015-04-09 07:23:28 UTC) #33
not at google - send to devlin
lgtm https://codereview.chromium.org/1047943002/diff/220001/extensions/common/features/simple_feature.cc File extensions/common/features/simple_feature.cc (right): https://codereview.chromium.org/1047943002/diff/220001/extensions/common/features/simple_feature.cc#newcode231 extensions/common/features/simple_feature.cc:231: if (!g_whitelisted_extension_id) { TODO(jackhou): Delete the commandline whitelisting ...
5 years, 8 months ago (2015-04-09 14:36:53 UTC) #34
tapted
https://codereview.chromium.org/1047943002/diff/220001/extensions/common/features/simple_feature.cc File extensions/common/features/simple_feature.cc (right): https://codereview.chromium.org/1047943002/diff/220001/extensions/common/features/simple_feature.cc#newcode236 extensions/common/features/simple_feature.cc:236: return !g_whitelisted_extension_id->empty() && On 2015/04/09 14:36:52, kalman wrote: > ...
5 years, 8 months ago (2015-04-09 14:56:46 UTC) #35
not at google - send to devlin
https://codereview.chromium.org/1047943002/diff/220001/extensions/common/features/simple_feature.cc File extensions/common/features/simple_feature.cc (right): https://codereview.chromium.org/1047943002/diff/220001/extensions/common/features/simple_feature.cc#newcode236 extensions/common/features/simple_feature.cc:236: return !g_whitelisted_extension_id->empty() && On 2015/04/09 14:56:46, tapted wrote: > ...
5 years, 8 months ago (2015-04-09 15:01:28 UTC) #36
jackhou1
https://codereview.chromium.org/1047943002/diff/220001/extensions/common/features/simple_feature.cc File extensions/common/features/simple_feature.cc (right): https://codereview.chromium.org/1047943002/diff/220001/extensions/common/features/simple_feature.cc#newcode231 extensions/common/features/simple_feature.cc:231: if (!g_whitelisted_extension_id) { On 2015/04/09 14:36:52, kalman wrote: > ...
5 years, 8 months ago (2015-04-10 01:45:31 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1047943002/240001
5 years, 8 months ago (2015-04-10 01:46:00 UTC) #40
commit-bot: I haz the power
Committed patchset #13 (id:240001)
5 years, 8 months ago (2015-04-10 03:45:30 UTC) #41
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/16ca320592ce7ef6cd36500da6e670cc645781cd Cr-Commit-Position: refs/heads/master@{#324583}
5 years, 8 months ago (2015-04-10 03:47:41 UTC) #42
Mike Lerman
A revert of this CL (patchset #13 id:240001) has been created in https://codereview.chromium.org/1076393002/ by mlerman@chromium.org. ...
5 years, 8 months ago (2015-04-10 19:58:24 UTC) #43
jackhou1
On 2015/04/10 19:58:24, Mike Lerman wrote: > A revert of this CL (patchset #13 id:240001) ...
5 years, 8 months ago (2015-04-13 05:15:25 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1047943002/260001
5 years, 8 months ago (2015-04-13 05:15:49 UTC) #47
commit-bot: I haz the power
Committed patchset #14 (id:260001)
5 years, 8 months ago (2015-04-13 08:16:50 UTC) #48
commit-bot: I haz the power
5 years, 8 months ago (2015-04-13 08:18:33 UTC) #49
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/c587f309e39c1713a00745f3f73442d93fa4687d
Cr-Commit-Position: refs/heads/master@{#324821}

Powered by Google App Engine
This is Rietveld 408576698