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

Issue 31273002: Generate the Chrome policy schema at compile time. (Closed)

Created:
7 years, 2 months ago by Joao da Silva
Modified:
7 years, 1 month ago
CC:
chromium-reviews
Visibility:
Public.

Description

Generate the Chrome policy schema at compile time. The schema describes the expected types of the known Chrome policies, so that they can be properly loaded at runtime from the platform policy services. The Chrome schema is represented by static structures that are generated at compile time, so that no parsing is required at runtime. This is important because the schema is always created to load the initial policy during startup. Also updated the policy::internal:: schema structures to avoid unnecessary relocations at load time. BUG=270667 R=dconnelly@chromium.org, pastarmovj@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=233595

Patch Set 1 #

Total comments: 4

Patch Set 2 : added comments #

Total comments: 23

Patch Set 3 : rebase, address comments #

Total comments: 1

Patch Set 4 : fixed use-after-free #

Patch Set 5 : rebase #

Patch Set 6 : rebased, fixed generator #

Patch Set 7 : rebase #

Patch Set 8 : rebase #

Patch Set 9 : rebase #

Patch Set 10 : rebase #

Patch Set 11 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+551 lines, -178 lines) Patch
M chrome/browser/policy/DEPS View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/policy/browser_policy_connector.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
A chrome/browser/policy/generate_policy_source_unittest.cc View 1 2 3 4 1 chunk +81 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/tools/build/generate_policy_source.py View 1 2 3 4 5 6 chunks +171 lines, -9 lines 0 comments Download
M components/policy/core/common/schema.h View 1 2 7 chunks +21 lines, -36 lines 0 comments Download
M components/policy/core/common/schema.cc View 1 2 3 7 chunks +173 lines, -89 lines 0 comments Download
M components/policy/core/common/schema_internal.h View 1 1 chunk +46 lines, -11 lines 0 comments Download
M components/policy/core/common/schema_unittest.cc View 2 chunks +55 lines, -33 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Joao da Silva
Adding 2 reviewers because this one is a bit tricky :-) - increases the binary ...
7 years, 2 months ago (2013-10-20 21:43:04 UTC) #1
dconnelly
Preliminary Python comments. C++ review still in progress. https://codereview.chromium.org/31273002/diff/1/chrome/tools/build/generate_policy_source.py File chrome/tools/build/generate_policy_source.py (right): https://codereview.chromium.org/31273002/diff/1/chrome/tools/build/generate_policy_source.py#newcode308 chrome/tools/build/generate_policy_source.py:308: if ...
7 years, 2 months ago (2013-10-21 10:25:08 UTC) #2
Joao da Silva
+bartfab, feel free to have a look & comment
7 years, 2 months ago (2013-10-21 16:40:14 UTC) #3
pastarmovj
Some comments from me as well. https://codereview.chromium.org/31273002/diff/140001/components/policy/core/common/schema.cc File components/policy/core/common/schema.cc (right): https://codereview.chromium.org/31273002/diff/140001/components/policy/core/common/schema.cc#newcode184 components/policy/core/common/schema.cc:184: return Schema(data_, data_->schema_nodes ...
7 years, 2 months ago (2013-10-22 09:30:46 UTC) #4
dconnelly
Sorry, not much more to add. This appears to be correct based on our conversation ...
7 years, 2 months ago (2013-10-22 11:55:52 UTC) #5
Joao da Silva
Thanks for the comments, PTAL. https://codereview.chromium.org/31273002/diff/1/chrome/tools/build/generate_policy_source.py File chrome/tools/build/generate_policy_source.py (right): https://codereview.chromium.org/31273002/diff/1/chrome/tools/build/generate_policy_source.py#newcode308 chrome/tools/build/generate_policy_source.py:308: if s in self.shared_strings: ...
7 years, 2 months ago (2013-10-22 12:53:26 UTC) #6
dconnelly
lgtm https://codereview.chromium.org/31273002/diff/240001/chrome/tools/build/generate_policy_source.py File chrome/tools/build/generate_policy_source.py (right): https://codereview.chromium.org/31273002/diff/240001/chrome/tools/build/generate_policy_source.py#newcode312 chrome/tools/build/generate_policy_source.py:312: if self.simple_types[name] == None: It's doesn't really matter, ...
7 years, 2 months ago (2013-10-22 13:37:35 UTC) #7
pastarmovj
LGTM but keep in mind that neither of us has Python readability so I can't ...
7 years, 2 months ago (2013-10-22 13:42:53 UTC) #8
Joao da Silva
Note that delta from 2->3. I think it's an interesting category of errors, and only ...
7 years, 2 months ago (2013-10-23 12:18:16 UTC) #9
Joao da Silva
Daniel, see the inline comment for an interesting bug caused by the generator expression. https://codereview.chromium.org/31273002/diff/140001/chrome/tools/build/generate_policy_source.py ...
7 years, 1 month ago (2013-11-03 20:54:59 UTC) #10
dconnelly
https://codereview.chromium.org/31273002/diff/140001/chrome/tools/build/generate_policy_source.py File chrome/tools/build/generate_policy_source.py (right): https://codereview.chromium.org/31273002/diff/140001/chrome/tools/build/generate_policy_source.py#newcode367 chrome/tools/build/generate_policy_source.py:367: properties = [ (self.GetString(key), self.Generate(schema, key)) yuck, good catch ...
7 years, 1 month ago (2013-11-04 09:18:51 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/joaodasilva@chromium.org/31273002/710001
7 years, 1 month ago (2013-11-06 09:54:42 UTC) #12
commit-bot: I haz the power
Retried try job too often on linux_aura for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_aura&number=94796
7 years, 1 month ago (2013-11-06 14:00:06 UTC) #13
Joao da Silva
7 years, 1 month ago (2013-11-07 12:41:08 UTC) #14
Message was sent while issue was closed.
Committed patchset #11 manually as r233595 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698