|
|
Created:
8 years, 7 months ago by Jesse Greenwald Modified:
8 years, 6 months ago CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org, wtc, rkn Base URL:
http://git.chromium.org/chromium/src.git@master Visibility:
Public. |
DescriptionAdd CookieMonster::SetEnableFileScheme and CookieMonster::IsCookieableScheme
These two methods are used by Chrome on Android.
BUG=115372
TEST=
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=141591
Patch Set 1 #
Total comments: 6
Patch Set 2 : Removed ifdefs, updated docs #
Total comments: 1
Patch Set 3 : Remove ifdef's from cookie_manager.cc #
Messages
Total messages: 15 (0 generated)
erikwright - can you review this change? thanks,
On 2012/05/16 22:59:14, jgreenwald1 wrote: > erikwright - can you review this change? > > thanks, Can you please provide some explanation for the rationale behind this? In general, I'm anti the #IFDEFs. I'd probably just copy the default list and filter out the file one, if that's the objective. I don't mind exposing the list of cookieable schemes for all configurations, if that's actually needed.
On 2012/05/23 17:14:28, erikwright wrote: > On 2012/05/16 22:59:14, jgreenwald1 wrote: > > erikwright - can you review this change? > > > > thanks, > > Can you please provide some explanation for the rationale behind this? > > In general, I'm anti the #IFDEFs. > > I'd probably just copy the default list and filter out the file one, if that's > the objective. > > I don't mind exposing the list of cookieable schemes for all configurations, if > that's actually needed. Hi Erik, Jesse may know better than me, But if I understood correctly that method, The goal is to be able to enable or disable the "file" cookie scheme per CookieMonster object instance, independently if the global default_enable_file_scheme_ is set to true or not. This is necessary because of the usage in CookieManager java class: http://codereview.chromium.org/10446051/patch/2001/3001 I agree with you that I prefer not having ifdefs, and I think in this case the ifdef is not necessary. This feature is currently only used by android but is not tied to any android specific code, so it doesn't need to go into an ifdef. Also, If I may say so, I would change the way the SetEnableFileScheme is implemented, since it is relying in fact that the "file" is the last element of array kDefaultCookieableSchemes. What you guys think ?
On 2012/05/29 10:01:44, felipeg wrote: > On 2012/05/23 17:14:28, erikwright wrote: > > On 2012/05/16 22:59:14, jgreenwald1 wrote: > > > erikwright - can you review this change? > > > > > > thanks, > > > > Can you please provide some explanation for the rationale behind this? As Felipe described below, this change is basically just upstreaming changes needed for Chrome on Android. This particular change doesn't include the Java or JNI code that depends on this change. I was trying to keep the CL small, but perhaps I should just roll it all in together? > > In general, I'm anti the #IFDEFs. > > > > I'd probably just copy the default list and filter out the file one, if that's > > the objective. > > > > I don't mind exposing the list of cookieable schemes for all configurations, > if > > that's actually needed. I can make the changes you're recommending. > Hi Erik, > Jesse may know better than me, > But if I understood correctly that method, > The goal is to be able to enable or disable the "file" cookie scheme per > CookieMonster object instance, independently if the global > default_enable_file_scheme_ is set to true or not. > This is necessary because of the usage in CookieManager java class: > http://codereview.chromium.org/10446051/patch/2001/3001 > > I agree with you that I prefer not having ifdefs, and I think in this case the > ifdef is not necessary. This feature is currently only used by android but is > not tied to any android specific code, so it doesn't need to go into an ifdef. > > Also, > If I may say so, I would change the way the SetEnableFileScheme is implemented, > since it is relying in fact that the "file" is the last element of array > kDefaultCookieableSchemes. > > What you guys think ? Erik's recommendation of filtering out the "file" schema above seems reasonable. Thanks, Jesse
On Tue, May 29, 2012 at 11:02 PM, <[email protected]> wrote: > On 2012/05/29 10:01:44, felipeg wrote: > >> On 2012/05/23 17:14:28, erikwright wrote: >> > On 2012/05/16 22:59:14, jgreenwald1 wrote: >> > > erikwright - can you review this change? >> > > >> > > thanks, >> > >> > Can you please provide some explanation for the rationale behind this? >> > > As Felipe described below, this change is basically just upstreaming > changes > needed for Chrome on Android. This particular change doesn't include the > Java > or JNI code that depends on this change. I was trying to keep the CL > small, but > perhaps I should just roll it all in together? You can either roll together or send this first and the java later. You are right in preferring smaller changes. > > > In general, I'm anti the #IFDEFs. >> > >> > I'd probably just copy the default list and filter out the file one, if >> > that's > >> > the objective. >> > >> > I don't mind exposing the list of cookieable schemes for all >> configurations, >> if >> > that's actually needed. >> > > I can make the changes you're recommending. > > > Hi Erik, >> Jesse may know better than me, >> But if I understood correctly that method, >> The goal is to be able to enable or disable the "file" cookie scheme per >> CookieMonster object instance, independently if the global >> default_enable_file_scheme_ is set to true or not. >> This is necessary because of the usage in CookieManager java class: >> http://codereview.chromium.**org/10446051/patch/2001/3001<http://codereview.c... >> > > I agree with you that I prefer not having ifdefs, and I think in this >> case the >> ifdef is not necessary. This feature is currently only used by android >> but is >> not tied to any android specific code, so it doesn't need to go into an >> ifdef. >> > > Also, >> If I may say so, I would change the way the SetEnableFileScheme is >> > implemented, > >> since it is relying in fact that the "file" is the last element of array >> kDefaultCookieableSchemes. >> > > What you guys think ? >> > > Erik's recommendation of filtering out the "file" schema above seems > reasonable. > Sounds good. go for it > > Thanks, > Jesse > > > https://chromiumcodereview.**appspot.com/10382209/<https://chromiumcodereview... >
On 2012/05/23 17:14:28, erikwright wrote: > I'd probably just copy the default list and filter out the file one, if that's > the objective. Quick clarification - do you mean programatically copy the default list, or just hardcode another list without the file schema? For reference, I was just following the pattern set in CookieMonster::SetDefaultCookieableSchemes() thanks,
I've reconsidered this a bit. I think it's reasonable given the current code to have a specific method for the 'file' scheme, given that it's already treated quite distinctly. I think the implementation is also OK, given that the list and the implementation are contained within the same class. Just remove the '#if defined' conditionals and update the comments appropriately. I am happy to have this separate from the Java/JNI changes. http://codereview.chromium.org/10382209/diff/1/net/cookies/cookie_monster.h File net/cookies/cookie_monster.h (right): http://codereview.chromium.org/10382209/diff/1/net/cookies/cookie_monster.h#n... net/cookies/cookie_monster.h:183: // Override the default list of schemes that are allowed to be set in // Resets the list of cookeiable schemes to the supplied schemes. http://codereview.chromium.org/10382209/diff/1/net/cookies/cookie_monster.h#n... net/cookies/cookie_monster.h:191: // Helper method to enable or disable acceptance of file scheme cookies on Remove #if defined // Resets the list of cookieable schemes to kDefaultCookieableSchemes with or without 'file' being included. http://codereview.chromium.org/10382209/diff/1/net/cookies/cookie_monster.h#n... net/cookies/cookie_monster.h:275: // Determine if the scheme of the URL is a scheme that cookies will be stored Remove '#if defined' 'Determine' -> 'Determines'
Addressed comments. PTAL http://codereview.chromium.org/10382209/diff/1/net/cookies/cookie_monster.h File net/cookies/cookie_monster.h (right): http://codereview.chromium.org/10382209/diff/1/net/cookies/cookie_monster.h#n... net/cookies/cookie_monster.h:183: // Override the default list of schemes that are allowed to be set in On 2012/06/06 18:38:54, erikwright wrote: > // Resets the list of cookeiable schemes to the supplied schemes. Done. http://codereview.chromium.org/10382209/diff/1/net/cookies/cookie_monster.h#n... net/cookies/cookie_monster.h:191: // Helper method to enable or disable acceptance of file scheme cookies on On 2012/06/06 18:38:54, erikwright wrote: > Remove #if defined > > // Resets the list of cookieable schemes to kDefaultCookieableSchemes with or > without 'file' being included. Done. http://codereview.chromium.org/10382209/diff/1/net/cookies/cookie_monster.h#n... net/cookies/cookie_monster.h:275: // Determine if the scheme of the URL is a scheme that cookies will be stored On 2012/06/06 18:38:54, erikwright wrote: > Remove '#if defined' > > 'Determine' -> 'Determines' Done.
LGTM, I have one comment that you can address if you wish, otherwise LGTM. http://codereview.chromium.org/10382209/diff/9001/net/cookies/cookie_monster.cc File net/cookies/cookie_monster.cc (right): http://codereview.chromium.org/10382209/diff/9001/net/cookies/cookie_monster.... net/cookies/cookie_monster.cc:1754: { "http", "https", "file" }; FYI: this is just a comment, address if you wish. Your call. I would make "file" as a new const char* . In line 240 of file cookie_manager.cc you could use that const instead of the plain string "file", like it is currently done: *accept = monster->IsCookieableScheme("file"); Also, with a separate const for the "file", it will not need to have a special comment saying that the file must be the last scheme, which, seems flaky. When calling SetCookiableSchemes() you can build the array accordingly (it could be a vector<>). The size of the array is so small that it will not incur in performance issues.
felipeg, For upstreaming, I'd like to make as minimal changes as possible. I think it would be better to make fixes like that in a separate CL.
No LGTM from a valid reviewer yet. Only full committers are accepted. Even if an LGTM may have been provided, it was from a non-committer or a lowly provisional committer, _not_ a full super star committer. See http://www.chromium.org/getting-involved/become-a-committer Note that this has nothing to do with OWNERS files.
erikwright, comments are addressed. PTAL.
LGTM.
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/10382209/13001
Change committed as 141591 |