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

Issue 1220683008: Move AppRestriction to Policy code out of //chrome (Closed)

Created:
5 years, 5 months ago by dgn
Modified:
5 years, 5 months ago
CC:
chromium-reviews, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move AppRestriction to Policy code out of //chrome This patch extracts the code related to transforming the Java objects coming from the AppRestrictionProvider to a PolicyBundle in the native code. It now lives in a new class in the policy components. BUG=506809 Committed: https://crrev.com/733516186f56ce8c3c315a1c5480951a21301e29 Cr-Commit-Position: refs/heads/master@{#338859}

Patch Set 1 #

Patch Set 2 : Fix imports & compilation #

Total comments: 61

Patch Set 3 : Added JNI Bindings in the component itself #

Patch Set 4 : Addressing bartfaf's comments, fix some errors from botrun #

Patch Set 5 : rebase #

Patch Set 6 : Fix more build errors #

Total comments: 28

Patch Set 7 : Removed the Delegate, reworked the relationship between classes #

Total comments: 12

Patch Set 8 : Address bauerb@'s comments #

Total comments: 16

Patch Set 9 : Address mnissler@'s comments #

Patch Set 10 : Removed a redundant comment #

Total comments: 4

Patch Set 11 : Return null instead of empty list #

Total comments: 4

Patch Set 12 : Return null instead of empty when input is not an array #

Total comments: 1

Patch Set 13 : Add DCHECKS to fail loudly in debug builds #

Total comments: 2

Patch Set 14 : DCHECK #

Patch Set 15 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+554 lines, -364 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/policy/PolicyManager.java View 1 2 3 4 5 6 6 chunks +6 lines, -27 lines 0 comments Download
M chrome/browser/android/chrome_jni_registrar.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/android/policy/policy_manager.h View 1 2 3 4 5 6 7 2 chunks +12 lines, -33 lines 0 comments Download
M chrome/browser/android/policy/policy_manager.cc View 1 2 3 4 5 6 7 3 chunks +15 lines, -145 lines 0 comments Download
D chrome/browser/android/policy/policy_manager_unittest.cc View 1 chunk +0 lines, -137 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -1 line 0 comments Download
M components/components_tests.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M components/policy.gypi View 1 2 3 4 5 6 1 chunk +12 lines, -0 lines 0 comments Download
M components/policy/android/BUILD.gn View 1 2 3 4 5 6 1 chunk +11 lines, -1 line 0 comments Download
A components/policy/android/java/src/org/chromium/policy/PolicyConverter.java View 1 2 3 4 5 6 7 1 chunk +69 lines, -0 lines 0 comments Download
M components/policy/core/browser/BUILD.gn View 1 2 3 4 5 6 1 chunk +10 lines, -0 lines 0 comments Download
A + components/policy/core/browser/android/DEPS View 1 2 3 4 5 6 7 8 0 chunks +-1 lines, --1 lines 0 comments Download
A components/policy/core/browser/android/component_jni_registrar.h View 1 2 3 4 5 6 1 chunk +21 lines, -0 lines 0 comments Download
A components/policy/core/browser/android/component_jni_registrar.cc View 1 2 3 4 5 6 7 1 chunk +25 lines, -0 lines 0 comments Download
A components/policy/core/browser/android/policy_converter.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +96 lines, -0 lines 0 comments Download
A components/policy/core/browser/android/policy_converter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +197 lines, -0 lines 0 comments Download
A + components/policy/core/browser/android/policy_converter_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 9 chunks +67 lines, -21 lines 0 comments Download
M components/policy/policy_browser.gypi View 1 2 3 4 5 6 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 38 (4 generated)
dgn
5 years, 5 months ago (2015-07-03 15:37:53 UTC) #2
Bernhard Bauer
Why does the JNI code have to live in the embedder?
5 years, 5 months ago (2015-07-03 16:00:33 UTC) #3
bartfab (slow)
I reviewed everything except the unit tests. This is as far as I got today. ...
5 years, 5 months ago (2015-07-03 16:55:49 UTC) #4
dgn
On 2015/07/03 at 16:00:33, bauerb wrote: > Why does the JNI code have to live ...
5 years, 5 months ago (2015-07-06 08:54:05 UTC) #5
Bernhard Bauer
On 2015/07/06 08:54:05, dgn wrote: > On 2015/07/03 at 16:00:33, bauerb wrote: > > Why ...
5 years, 5 months ago (2015-07-06 08:55:45 UTC) #6
dgn
https://codereview.chromium.org/1220683008/diff/20001/chrome/browser/android/policy/policy_manager.cc File chrome/browser/android/policy/policy_manager.cc (right): https://codereview.chromium.org/1220683008/diff/20001/chrome/browser/android/policy/policy_manager.cc#newcode17 chrome/browser/android/policy/policy_manager.cc:17: g_browser_process->browser_policy_connector()->GetPlatformProvider()); On 2015/07/03 at 16:55:47, bartfab wrote: > Nit: ...
5 years, 5 months ago (2015-07-06 17:34:04 UTC) #7
dgn
PTAL https://codereview.chromium.org/1220683008/diff/20001/components/policy/core/browser/android/app_restrictions_importer.cc File components/policy/core/browser/android/app_restrictions_importer.cc (right): https://codereview.chromium.org/1220683008/diff/20001/components/policy/core/browser/android/app_restrictions_importer.cc#newcode67 components/policy/core/browser/android/app_restrictions_importer.cc:67: PolicyProviderAndroid* policy_provider = GetPolicyProvider(); On 2015/07/03 at 16:55:47, ...
5 years, 5 months ago (2015-07-07 11:31:17 UTC) #8
Bernhard Bauer
https://codereview.chromium.org/1220683008/diff/100001/chrome/android/java/src/org/chromium/chrome/browser/policy/PolicyManager.java File chrome/android/java/src/org/chromium/chrome/browser/policy/PolicyManager.java (right): https://codereview.chromium.org/1220683008/diff/100001/chrome/android/java/src/org/chromium/chrome/browser/policy/PolicyManager.java#newcode32 chrome/android/java/src/org/chromium/chrome/browser/policy/PolicyManager.java:32: mAppRestrictionsImporter.setNativeDelegate(mNativePolicyManager); Can't you just pass the native pointer into ...
5 years, 5 months ago (2015-07-08 09:54:34 UTC) #9
dgn
https://codereview.chromium.org/1220683008/diff/100001/chrome/android/java/src/org/chromium/chrome/browser/policy/PolicyManager.java File chrome/android/java/src/org/chromium/chrome/browser/policy/PolicyManager.java (right): https://codereview.chromium.org/1220683008/diff/100001/chrome/android/java/src/org/chromium/chrome/browser/policy/PolicyManager.java#newcode32 chrome/android/java/src/org/chromium/chrome/browser/policy/PolicyManager.java:32: mAppRestrictionsImporter.setNativeDelegate(mNativePolicyManager); On 2015/07/08 at 09:54:33, Bernhard Bauer wrote: > ...
5 years, 5 months ago (2015-07-08 11:25:45 UTC) #10
dgn
PTAL https://codereview.chromium.org/1220683008/diff/100001/chrome/android/java/src/org/chromium/chrome/browser/policy/PolicyManager.java File chrome/android/java/src/org/chromium/chrome/browser/policy/PolicyManager.java (right): https://codereview.chromium.org/1220683008/diff/100001/chrome/android/java/src/org/chromium/chrome/browser/policy/PolicyManager.java#newcode32 chrome/android/java/src/org/chromium/chrome/browser/policy/PolicyManager.java:32: mAppRestrictionsImporter.setNativeDelegate(mNativePolicyManager); On 2015/07/08 at 11:25:44, dgn wrote: > ...
5 years, 5 months ago (2015-07-08 18:16:01 UTC) #11
Bernhard Bauer
Nice! https://codereview.chromium.org/1220683008/diff/120001/chrome/browser/android/policy/policy_manager.h File chrome/browser/android/policy/policy_manager.h (right): https://codereview.chromium.org/1220683008/diff/120001/chrome/browser/android/policy/policy_manager.h#newcode18 chrome/browser/android/policy/policy_manager.h:18: class PolicyConverter; Add an empty line after this ...
5 years, 5 months ago (2015-07-09 08:53:58 UTC) #12
dgn
PTAL https://codereview.chromium.org/1220683008/diff/120001/chrome/browser/android/policy/policy_manager.h File chrome/browser/android/policy/policy_manager.h (right): https://codereview.chromium.org/1220683008/diff/120001/chrome/browser/android/policy/policy_manager.h#newcode18 chrome/browser/android/policy/policy_manager.h:18: class PolicyConverter; On 2015/07/09 at 08:53:58, Bernhard Bauer ...
5 years, 5 months ago (2015-07-09 10:53:41 UTC) #13
Bernhard Bauer
lgtm
5 years, 5 months ago (2015-07-09 10:58:15 UTC) #14
bartfab (slow)
I am sorry, I did not manage to review this before my vacation. Mattias, could ...
5 years, 5 months ago (2015-07-10 12:52:51 UTC) #16
Mattias Nissler (ping if slow)
https://codereview.chromium.org/1220683008/diff/140001/components/policy/core/browser/DEPS File components/policy/core/browser/DEPS (right): https://codereview.chromium.org/1220683008/diff/140001/components/policy/core/browser/DEPS#newcode7 components/policy/core/browser/DEPS:7: "+jni", Shouldn't this rather go into a DEPS file ...
5 years, 5 months ago (2015-07-13 09:46:05 UTC) #17
Bernhard Bauer
https://codereview.chromium.org/1220683008/diff/140001/components/policy/core/browser/android/policy_converter.cc File components/policy/core/browser/android/policy_converter.cc (right): https://codereview.chromium.org/1220683008/diff/140001/components/policy/core/browser/android/policy_converter.cc#newcode85 components/policy/core/browser/android/policy_converter.cc:85: list_values->AppendStrings(string_vector); On 2015/07/13 09:46:05, Mattias Nissler wrote: > Double ...
5 years, 5 months ago (2015-07-13 10:46:03 UTC) #18
Mattias Nissler (ping if slow)
https://codereview.chromium.org/1220683008/diff/140001/components/policy/core/browser/android/policy_converter.cc File components/policy/core/browser/android/policy_converter.cc (right): https://codereview.chromium.org/1220683008/diff/140001/components/policy/core/browser/android/policy_converter.cc#newcode85 components/policy/core/browser/android/policy_converter.cc:85: list_values->AppendStrings(string_vector); On 2015/07/13 10:46:03, Bernhard Bauer wrote: > On ...
5 years, 5 months ago (2015-07-13 11:27:13 UTC) #19
dgn
PTAL https://codereview.chromium.org/1220683008/diff/140001/components/policy/core/browser/DEPS File components/policy/core/browser/DEPS (right): https://codereview.chromium.org/1220683008/diff/140001/components/policy/core/browser/DEPS#newcode7 components/policy/core/browser/DEPS:7: "+jni", On 2015/07/13 09:46:05, Mattias Nissler wrote: > ...
5 years, 5 months ago (2015-07-14 12:50:26 UTC) #20
Bernhard Bauer
https://codereview.chromium.org/1220683008/diff/180001/components/policy/core/browser/android/policy_converter.h File components/policy/core/browser/android/policy_converter.h (right): https://codereview.chromium.org/1220683008/diff/180001/components/policy/core/browser/android/policy_converter.h#newcode73 components/policy/core/browser/android/policy_converter.h:73: // Returns an empty ListValue in if there is ...
5 years, 5 months ago (2015-07-14 13:24:14 UTC) #21
dgn
https://codereview.chromium.org/1220683008/diff/180001/components/policy/core/browser/android/policy_converter.h File components/policy/core/browser/android/policy_converter.h (right): https://codereview.chromium.org/1220683008/diff/180001/components/policy/core/browser/android/policy_converter.h#newcode73 components/policy/core/browser/android/policy_converter.h:73: // Returns an empty ListValue in if there is ...
5 years, 5 months ago (2015-07-14 15:56:53 UTC) #22
Bernhard Bauer
https://codereview.chromium.org/1220683008/diff/200001/components/policy/core/browser/android/policy_converter.cc File components/policy/core/browser/android/policy_converter.cc (right): https://codereview.chromium.org/1220683008/diff/200001/components/policy/core/browser/android/policy_converter.cc#newcode97 components/policy/core/browser/android/policy_converter.cc:97: size_t len = static_cast<size_t>(std::max(0, env->GetArrayLength(array))); I would also use ...
5 years, 5 months ago (2015-07-14 16:10:08 UTC) #23
dgn
https://codereview.chromium.org/1220683008/diff/200001/components/policy/core/browser/android/policy_converter.cc File components/policy/core/browser/android/policy_converter.cc (right): https://codereview.chromium.org/1220683008/diff/200001/components/policy/core/browser/android/policy_converter.cc#newcode97 components/policy/core/browser/android/policy_converter.cc:97: size_t len = static_cast<size_t>(std::max(0, env->GetArrayLength(array))); On 2015/07/14 16:10:08, Bernhard ...
5 years, 5 months ago (2015-07-14 17:13:32 UTC) #24
dgn
https://codereview.chromium.org/1220683008/diff/220001/components/policy/core/browser/android/policy_converter.cc File components/policy/core/browser/android/policy_converter.cc (right): https://codereview.chromium.org/1220683008/diff/220001/components/policy/core/browser/android/policy_converter.cc#newcode94 components/policy/core/browser/android/policy_converter.cc:94: // GetArrayLength Could return -1 is array is not ...
5 years, 5 months ago (2015-07-14 17:15:46 UTC) #25
Bernhard Bauer
https://codereview.chromium.org/1220683008/diff/200001/components/policy/core/browser/android/policy_converter.cc File components/policy/core/browser/android/policy_converter.cc (right): https://codereview.chromium.org/1220683008/diff/200001/components/policy/core/browser/android/policy_converter.cc#newcode97 components/policy/core/browser/android/policy_converter.cc:97: size_t len = static_cast<size_t>(std::max(0, env->GetArrayLength(array))); On 2015/07/14 17:13:32, dgn ...
5 years, 5 months ago (2015-07-14 17:22:42 UTC) #26
dgn
https://codereview.chromium.org/1220683008/diff/200001/components/policy/core/browser/android/policy_converter.cc File components/policy/core/browser/android/policy_converter.cc (right): https://codereview.chromium.org/1220683008/diff/200001/components/policy/core/browser/android/policy_converter.cc#newcode97 components/policy/core/browser/android/policy_converter.cc:97: size_t len = static_cast<size_t>(std::max(0, env->GetArrayLength(array))); On 2015/07/14 17:22:42, Bernhard ...
5 years, 5 months ago (2015-07-14 17:50:19 UTC) #27
Bernhard Bauer
https://codereview.chromium.org/1220683008/diff/240001/components/policy/core/browser/android/policy_converter.cc File components/policy/core/browser/android/policy_converter.cc (right): https://codereview.chromium.org/1220683008/diff/240001/components/policy/core/browser/android/policy_converter.cc#newcode96 components/policy/core/browser/android/policy_converter.cc:96: NOTREACHED() << "Invalid array length: " << length; Just ...
5 years, 5 months ago (2015-07-14 17:57:29 UTC) #28
dgn
https://codereview.chromium.org/1220683008/diff/240001/components/policy/core/browser/android/policy_converter.cc File components/policy/core/browser/android/policy_converter.cc (right): https://codereview.chromium.org/1220683008/diff/240001/components/policy/core/browser/android/policy_converter.cc#newcode96 components/policy/core/browser/android/policy_converter.cc:96: NOTREACHED() << "Invalid array length: " << length; On ...
5 years, 5 months ago (2015-07-14 19:15:16 UTC) #29
Bernhard Bauer
Thanks! LGTM still holds.
5 years, 5 months ago (2015-07-15 08:25:27 UTC) #30
dgn
Thank you! mnissler@: PTAL
5 years, 5 months ago (2015-07-15 10:23:46 UTC) #31
Mattias Nissler (ping if slow)
LGTM
5 years, 5 months ago (2015-07-15 13:22:12 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1220683008/280001
5 years, 5 months ago (2015-07-15 13:45:28 UTC) #35
dgn
Thank you very much for the review!
5 years, 5 months ago (2015-07-15 13:45:30 UTC) #36
commit-bot: I haz the power
Committed patchset #15 (id:280001)
5 years, 5 months ago (2015-07-15 14:56:15 UTC) #37
commit-bot: I haz the power
5 years, 5 months ago (2015-07-15 14:58:16 UTC) #38
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/733516186f56ce8c3c315a1c5480951a21301e29
Cr-Commit-Position: refs/heads/master@{#338859}

Powered by Google App Engine
This is Rietveld 408576698