|
|
Created:
4 years, 3 months ago by dougt Modified:
4 years, 2 months ago CC:
chromium-apps-reviews_chromium.org, chromium-reviews, extensions-reviews_chromium.org, markusheintz_, msramek+watch_chromium.org, raymes+watch_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionSwitching IsStorageDurable() to use DurableStoragePermissionContext.
ExtensionSpecialStoragePolicy was using cookies_settings to figure out if the
given origin was allowed to use durable storage. In order to make this work, the
cookies_settings had to use a lower level api (HostContentSettingsMap) to avoid
layer violations.
We found that we could remove the cookies_settings::IsStorageDurable() and,
instead, just have the ExtensionSpecialStoragePolicy access the
PermissionManager.
BUG=539538
R=raymes, jochen, pfeldman
Committed: https://crrev.com/4a19a66d254415f7afb67d6f3c6e6354f280109d
Cr-Commit-Position: refs/heads/master@{#424165}
Patch Set 1 #Patch Set 2 #Patch Set 3 : Fixed unit test #Patch Set 4 : more unit test fixes. #Patch Set 5 : Make sure the profile is set in the constructor to avoid threadsafety concerns. #Patch Set 6 : Update test to reflect that durable storage is only available on secure origins. #
Total comments: 1
Patch Set 7 : Test for null in policy constructor for test #Patch Set 8 : Using PermissionManager::Get(). #
Total comments: 4
Patch Set 9 : Fix up for pfeldman's comments #
Total comments: 2
Patch Set 10 : git cl try #Patch Set 11 : Switching IsStorageDurable() to use DurableStoragePermissionContext. #
Messages
Total messages: 70 (55 generated)
The CQ bit was checked by dougt@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by dougt@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
dgrogan@chromium.org changed reviewers: + dgrogan@chromium.org
Seems reasonable, as long as you can get the unit tests to make sense, but you'll definitely want to get raymes to review, he's the content_settings person.
The CQ bit was checked by dougt@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...)
The CQ bit was checked by dougt@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by dougt@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by dougt@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
raymes@chromium.org changed reviewers: + raymes@chromium.org
Sorry for being slow. Thanks for doing this, overall seems good. https://codereview.chromium.org/2351803002/diff/100001/chrome/browser/extensi... File chrome/browser/extensions/extension_special_storage_policy.cc (right): https://codereview.chromium.org/2351803002/diff/100001/chrome/browser/extensi... chrome/browser/extensions/extension_special_storage_policy.cc:150: new DurableStoragePermissionContext(profile)); We should go through the PermissionManager, something like: PermissionManager::Get(profile)->GetPermissionStatus(origin, origin)
The CQ bit was checked by dougt@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by dougt@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm
The CQ bit was checked by dougt@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
pfeldman@chromium.org changed reviewers: + pfeldman@chromium.org
some friendly style nits for you. https://codereview.chromium.org/2351803002/diff/140001/chrome/browser/extensi... File chrome/browser/extensions/extension_special_storage_policy.cc (right): https://codereview.chromium.org/2351803002/diff/140001/chrome/browser/extensi... chrome/browser/extensions/extension_special_storage_policy.cc:119: if (cookie_settings_ == NULL) Since you touch those lines, you could migrate them to nullptr. https://codereview.chromium.org/2351803002/diff/140001/chrome/browser/extensi... chrome/browser/extensions/extension_special_storage_policy.cc:150: Profile* profile = Profile::FromBrowserContext(browser_context_); Just store a pointer to the profile, no need to convert all the time. https://codereview.chromium.org/2351803002/diff/140001/chrome/browser/extensi... File chrome/browser/extensions/extension_special_storage_policy.h (right): https://codereview.chromium.org/2351803002/diff/140001/chrome/browser/extensi... chrome/browser/extensions/extension_special_storage_policy.h:34: content::BrowserContext* browser_context); As a part of the chrome internal API, you should prefer using Profile over the context. https://codereview.chromium.org/2351803002/diff/140001/chrome/browser/extensi... chrome/browser/extensions/extension_special_storage_policy.h:99: content::BrowserContext* browser_context_; // weak reference. It is either WeakPtr or a raw pointer. In this case it is raw, no need to say weak - it is clear from the code that you use raw.
The CQ bit was checked by dougt@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Switching ExtensionSpecialStoragePolicy::IsStorageDurable to use DurableStoragePermissionContext. ExtensionSpecialStoragePolicy was using cookies_settings to figure out if the given origin was allowed to use durable storage. In order to make this work, the cookies_settings had to use a lower level api (HostContentSettingsMap) to avoid layer violations. We found that we could remove the cookies_settings::IsStorageDurable() and, instead, just have the ExtensionSpecialStoragePolicy access the DurableStoragePermissionContext. BUG=539538 ========== to ========== Switching ExtensionSpecialStoragePolicy::IsStorageDurable to use DurableStoragePermissionContext. ExtensionSpecialStoragePolicy was using cookies_settings to figure out if the given origin was allowed to use durable storage. In order to make this work, the cookies_settings had to use a lower level api (HostContentSettingsMap) to avoid layer violations. We found that we could remove the cookies_settings::IsStorageDurable() and, instead, just have the ExtensionSpecialStoragePolicy access the DurableStoragePermissionContext. BUG=539538 ==========
dougt@chromium.org changed reviewers: + thakis@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
dougt@chromium.org changed reviewers: + jochen@chromium.org
jochen, please take a look.
msramek@chromium.org changed reviewers: + msramek@chromium.org
Drive by comment! (otherwise browsing_data/ LGTM) https://codereview.chromium.org/2351803002/diff/160001/chrome/browser/browsin... File chrome/browser/browsing_data/cookies_tree_model_unittest.cc (right): https://codereview.chromium.org/2351803002/diff/160001/chrome/browser/browsin... chrome/browser/browsing_data/cookies_tree_model_unittest.cc:85: const char kExtensionScheme[] = "extensionscheme"; |kExtensionScheme| and |cookie_settings| are now unused
The CQ bit was checked by dougt@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2351803002/diff/160001/chrome/browser/browsin... File chrome/browser/browsing_data/cookies_tree_model_unittest.cc (right): https://codereview.chromium.org/2351803002/diff/160001/chrome/browser/browsin... chrome/browser/browsing_data/cookies_tree_model_unittest.cc:85: const char kExtensionScheme[] = "extensionscheme"; On 2016/10/07 16:17:21, msramek wrote: > |kExtensionScheme| and |cookie_settings| are now unused Acknowledged.
lgtm please reformat the CL description according to https://www.chromium.org/developers/contributing-code#TOC-Writing-change-list...
The CQ bit was checked by dougt@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from raymes@chromium.org, msramek@chromium.org, jochen@chromium.org Link to the patchset: https://codereview.chromium.org/2351803002/#ps200001 (title: "Switching IsStorageDurable() to use DurableStoragePermissionContext.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Switching ExtensionSpecialStoragePolicy::IsStorageDurable to use DurableStoragePermissionContext. ExtensionSpecialStoragePolicy was using cookies_settings to figure out if the given origin was allowed to use durable storage. In order to make this work, the cookies_settings had to use a lower level api (HostContentSettingsMap) to avoid layer violations. We found that we could remove the cookies_settings::IsStorageDurable() and, instead, just have the ExtensionSpecialStoragePolicy access the DurableStoragePermissionContext. BUG=539538 ========== to ========== Switching IsStorageDurable() to use DurableStoragePermissionContext. ExtensionSpecialStoragePolicy was using cookies_settings to figure out if the given origin was allowed to use durable storage. In order to make this work, the cookies_settings had to use a lower level api (HostContentSettingsMap) to avoid layer violations. We found that we could remove the cookies_settings::IsStorageDurable() and, instead, just have the ExtensionSpecialStoragePolicy access the PermissionManager. BUG=539538 R=raymes, jochen, pfeldman ==========
dougt@chromium.org changed reviewers: - thakis@chromium.org
Message was sent while issue was closed.
Description was changed from ========== Switching IsStorageDurable() to use DurableStoragePermissionContext. ExtensionSpecialStoragePolicy was using cookies_settings to figure out if the given origin was allowed to use durable storage. In order to make this work, the cookies_settings had to use a lower level api (HostContentSettingsMap) to avoid layer violations. We found that we could remove the cookies_settings::IsStorageDurable() and, instead, just have the ExtensionSpecialStoragePolicy access the PermissionManager. BUG=539538 R=raymes, jochen, pfeldman ========== to ========== Switching IsStorageDurable() to use DurableStoragePermissionContext. ExtensionSpecialStoragePolicy was using cookies_settings to figure out if the given origin was allowed to use durable storage. In order to make this work, the cookies_settings had to use a lower level api (HostContentSettingsMap) to avoid layer violations. We found that we could remove the cookies_settings::IsStorageDurable() and, instead, just have the ExtensionSpecialStoragePolicy access the PermissionManager. BUG=539538 R=raymes, jochen, pfeldman ==========
Message was sent while issue was closed.
Committed patchset #11 (id:200001)
Message was sent while issue was closed.
Description was changed from ========== Switching IsStorageDurable() to use DurableStoragePermissionContext. ExtensionSpecialStoragePolicy was using cookies_settings to figure out if the given origin was allowed to use durable storage. In order to make this work, the cookies_settings had to use a lower level api (HostContentSettingsMap) to avoid layer violations. We found that we could remove the cookies_settings::IsStorageDurable() and, instead, just have the ExtensionSpecialStoragePolicy access the PermissionManager. BUG=539538 R=raymes, jochen, pfeldman ========== to ========== Switching IsStorageDurable() to use DurableStoragePermissionContext. ExtensionSpecialStoragePolicy was using cookies_settings to figure out if the given origin was allowed to use durable storage. In order to make this work, the cookies_settings had to use a lower level api (HostContentSettingsMap) to avoid layer violations. We found that we could remove the cookies_settings::IsStorageDurable() and, instead, just have the ExtensionSpecialStoragePolicy access the PermissionManager. BUG=539538 R=raymes, jochen, pfeldman Committed: https://crrev.com/4a19a66d254415f7afb67d6f3c6e6354f280109d Cr-Commit-Position: refs/heads/master@{#424165} ==========
Message was sent while issue was closed.
Patchset 11 (id:??) landed as https://crrev.com/4a19a66d254415f7afb67d6f3c6e6354f280109d Cr-Commit-Position: refs/heads/master@{#424165}
Message was sent while issue was closed.
A revert of this CL (patchset #11 id:200001) has been created in https://codereview.chromium.org/2426133002/ by dougt@chromium.org. The reason for reverting is: Caused issue 656495.. |