|
|
Chromium Code Reviews|
Created:
4 years, 3 months ago by Finnur Modified:
4 years, 3 months ago Reviewers:
dschuyler CC:
chromium-reviews, michaelpg+watch-md-settings_chromium.org, michaelpg+watch-md-ui_chromium.org, dbeam+watch-settings_chromium.org, stevenjb+watch-md-settings_chromium.org, arv+watch_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionSite Settings Desktop: Fix crash when deleting storage for a site.
BUG=646801
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
Committed: https://crrev.com/8b38a4bfb8ceae1cd31616c146c699616fa26f94
Cr-Commit-Position: refs/heads/master@{#420133}
Patch Set 1 #
Total comments: 5
Messages
Total messages: 21 (10 generated)
Description was changed from ========== Site Settings Desktop: Fix crash when deleting storage for a site. BUG=646801 ========== to ========== Site Settings Desktop: Fix crash when deleting storage for a site. BUG=646801 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ==========
Patchset #1 (id:1) has been deleted
Patchset #1 (id:20001) has been deleted
finnur@chromium.org changed reviewers: + dschuyler@chromium.org
https://codereview.chromium.org/2358563002/diff/40001/chrome/browser/resource... File chrome/browser/resources/settings/site_settings/site_details.js (right): https://codereview.chromium.org/2358563002/diff/40001/chrome/browser/resource... chrome/browser/resources/settings/site_settings/site_details.js:79: this.toUrl(this.site.origin).href, this.storageType_); I found while testing this, that if patterns are entered we need to convert them to url for the deletion to work. https://codereview.chromium.org/2358563002/diff/40001/chrome/browser/resource... chrome/browser/resources/settings/site_settings/site_details.js:86: if (event.detail.origin == this.toUrl(this.site.origin).href) { And when the delete-complete event comes in, we need to make sure we don't compare the origin against a pattern -- otherwise we ignore the event. https://codereview.chromium.org/2358563002/diff/40001/chrome/browser/ui/webui... File chrome/browser/ui/webui/settings/site_settings_handler.cc (right): https://codereview.chromium.org/2358563002/diff/40001/chrome/browser/ui/webui... chrome/browser/ui/webui/settings/site_settings_handler.cc:324: CHECK(args->GetDouble(1, &storage_type)); This was the source of the crash. When I checked the code in initially, I was reading a double here but in a subsequent CL (that converted the content settings enum to string) I accidentally changed this to GetString (mistakenly thinking this was a content settings type). But this is a storage type -- as should be obvious now.
The CQ bit was checked by finnur@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/2358563002/diff/40001/chrome/browser/ui/webui... File chrome/browser/ui/webui/settings/site_settings_handler.cc (right): https://codereview.chromium.org/2358563002/diff/40001/chrome/browser/ui/webui... chrome/browser/ui/webui/settings/site_settings_handler.cc:324: CHECK(args->GetDouble(1, &storage_type)); On 2016/09/20 11:37:27, Finnur wrote: > This was the source of the crash. When I checked the code in > initially, I was reading a double here but in a subsequent CL > (that converted the content settings enum to string) I accidentally > changed this to GetString (mistakenly thinking this was a > content settings type). But this is a storage type -- as should be > obvious now. Would it be ok to GetInteger here instead of GetDouble?
https://codereview.chromium.org/2358563002/diff/40001/chrome/browser/ui/webui... File chrome/browser/ui/webui/settings/site_settings_handler.cc (right): https://codereview.chromium.org/2358563002/diff/40001/chrome/browser/ui/webui... chrome/browser/ui/webui/settings/site_settings_handler.cc:324: CHECK(args->GetDouble(1, &storage_type)); On 2016/09/20 18:28:51, dschuyler wrote: > On 2016/09/20 11:37:27, Finnur wrote: > > This was the source of the crash. When I checked the code in > > initially, I was reading a double here but in a subsequent CL > > (that converted the content settings enum to string) I accidentally > > changed this to GetString (mistakenly thinking this was a > > content settings type). But this is a storage type -- as should be > > obvious now. > > Would it be ok to GetInteger here instead of GetDouble? I don't think that will work
On 2016/09/20 19:01:59, Dan Beam wrote: > https://codereview.chromium.org/2358563002/diff/40001/chrome/browser/ui/webui... > File chrome/browser/ui/webui/settings/site_settings_handler.cc (right): > > https://codereview.chromium.org/2358563002/diff/40001/chrome/browser/ui/webui... > chrome/browser/ui/webui/settings/site_settings_handler.cc:324: > CHECK(args->GetDouble(1, &storage_type)); > On 2016/09/20 18:28:51, dschuyler wrote: > > On 2016/09/20 11:37:27, Finnur wrote: > > > This was the source of the crash. When I checked the code in > > > initially, I was reading a double here but in a subsequent CL > > > (that converted the content settings enum to string) I accidentally > > > changed this to GetString (mistakenly thinking this was a > > > content settings type). But this is a storage type -- as should be > > > obvious now. > > > > Would it be ok to GetInteger here instead of GetDouble? > > I don't think that will work Ah, and that would be because JS only uses doubles? - rather than there being a limitation on the C++ side?
I may be wrong, but, as I recall, GetInteger also works (and is how it was initially before Dan pointed out that JS uses doubles). GetDouble, however, feels more natural in light of Dan's comment.
On 2016/09/20 19:17:13, dschuyler wrote: > On 2016/09/20 19:01:59, Dan Beam wrote: > > > https://codereview.chromium.org/2358563002/diff/40001/chrome/browser/ui/webui... > > File chrome/browser/ui/webui/settings/site_settings_handler.cc (right): > > > > > https://codereview.chromium.org/2358563002/diff/40001/chrome/browser/ui/webui... > > chrome/browser/ui/webui/settings/site_settings_handler.cc:324: > > CHECK(args->GetDouble(1, &storage_type)); > > On 2016/09/20 18:28:51, dschuyler wrote: > > > On 2016/09/20 11:37:27, Finnur wrote: > > > > This was the source of the crash. When I checked the code in > > > > initially, I was reading a double here but in a subsequent CL > > > > (that converted the content settings enum to string) I accidentally > > > > changed this to GetString (mistakenly thinking this was a > > > > content settings type). But this is a storage type -- as should be > > > > obvious now. > > > > > > Would it be ok to GetInteger here instead of GetDouble? > > > > I don't think that will work > > Ah, and that would be because JS only uses doubles? - rather than > there being a limitation on the C++ side? i don't really remember the exact details, but it's mainly that's it's really a double from JS, yes it may only matter for larger numbers?
Friendly ping...
lgtm
The CQ bit was checked by finnur@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #1 (id:40001)
Message was sent while issue was closed.
Description was changed from ========== Site Settings Desktop: Fix crash when deleting storage for a site. BUG=646801 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== Site Settings Desktop: Fix crash when deleting storage for a site. BUG=646801 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/8b38a4bfb8ceae1cd31616c146c699616fa26f94 Cr-Commit-Position: refs/heads/master@{#420133} ==========
Message was sent while issue was closed.
Patchset 1 (id:??) landed as https://crrev.com/8b38a4bfb8ceae1cd31616c146c699616fa26f94 Cr-Commit-Position: refs/heads/master@{#420133} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
