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

Issue 334028: From FilePath::AppendAndResolveRelative() to file_util::AbsolutePath(). (Closed)

Created:
11 years, 1 month ago by mad-corp
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, brettw+cc_chromium.org, Aaron Boodman, pam+watch_chromium.org, Erik does not do reviews, Paweł Hajdan Jr.
Visibility:
Public.

Description

The existing file_util::AbsolutePath() function was already doing what we needed to do in the ExtensionResource class. BUG= http://crbug.com/25681 & http://crbug.com/25131 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=30149

Patch Set 1 #

Total comments: 2

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -180 lines) Patch
M base/file_path.h View 1 2 3 1 chunk +0 lines, -12 lines 0 comments Download
M base/file_path.cc View 1 2 3 1 chunk +0 lines, -69 lines 0 comments Download
M base/file_path_unittest.cc View 1 2 3 1 chunk +0 lines, -92 lines 0 comments Download
M chrome/common/extensions/extension_resource.cc View 1 2 3 1 chunk +11 lines, -7 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
MAD
This also fixes http://code.google.com/p/chromium/issues/detail?id=25131 Thanks! BYE MAD
11 years, 1 month ago (2009-10-26 20:21:24 UTC) #1
Mark Mentovai
http://codereview.chromium.org/334028/diff/1/3 File base/file_path.h (right): http://codereview.chromium.org/334028/diff/1/3#newcode181 Line 181: // Returns a copy of this file path ...
11 years, 1 month ago (2009-10-26 20:46:42 UTC) #2
MAD
http://codereview.chromium.org/334028/diff/1/3 File base/file_path.h (right): http://codereview.chromium.org/334028/diff/1/3#newcode181 Line 181: // Returns a copy of this file path ...
11 years, 1 month ago (2009-10-26 20:53:20 UTC) #3
Mark Mentovai
I'm saying that we can't resolve .. without asking the filesystem. Symbolic links. mad@chromium.org wrote: ...
11 years, 1 month ago (2009-10-26 21:09:06 UTC) #4
MAD
OK, how about this then? Thanks! BYE MAD
11 years, 1 month ago (2009-10-26 23:40:52 UTC) #5
mad-corp
Wait, I went too quickly... Still working on it... A simpler solution is on the ...
11 years, 1 month ago (2009-10-26 23:50:18 UTC) #6
Mark Mentovai
If you really need to resolve . and .. and have it do the right ...
11 years, 1 month ago (2009-10-27 00:01:15 UTC) #7
mad-corp
I know, I saw that this is what is used in file_util::AbsolutePath(), but unfortunately, I ...
11 years, 1 month ago (2009-10-27 00:25:47 UTC) #8
MAD
So here is the simple solution... I didn't finish a full rebuild and running the ...
11 years, 1 month ago (2009-10-27 00:42:57 UTC) #9
Mark Mentovai
LGTM, although it didn't have a clean try run - looks like that wasn't your ...
11 years, 1 month ago (2009-10-27 01:26:06 UTC) #10
mad-corp
Thanks, I had updated the description, but noticed that the title didn't update... You were ...
11 years, 1 month ago (2009-10-27 01:37:06 UTC) #11
Aaron Boodman
Ok, I think I have sorted this out with Marc offline. I agree with Mark ...
11 years, 1 month ago (2009-10-27 19:05:44 UTC) #12
Mark Mentovai
11 years, 1 month ago (2009-10-27 19:37:39 UTC) #13
Sounds workable.  Sounds right.  Thanks for taking a look.

Mark

Aaron Boodman wrote:
> Ok, I think I have sorted this out with Marc offline.
>
> I agree with Mark that we should not be trying to do path parsing or
> comparison ourselves, but instead use the filesystem APIs. I would
> like to remove all the file URL shenanigans completely, and instead
> just naively stuff the path component of whatever URL comes into the
> extension system into an ExtensionResource, and then leave it up to
> the filesystem to sort out. At the end we just compare the absolute
> paths and make sure the path being requested is a child of the
> extension root.
>
> This change looks like it implements this idea:
> http://codereview.chromium.org/334028/diff/22/26
>
> The only hiccup is the issue with missing resources. The desire here
> is to have an experience similar to web development. If you specify an
> invalid resource the page still loads, it just has broken references
> to those resources. To get this effect, I've asked Marc to try
> returning an empty FilePath in case the platform canonicalization API
> fails. I think that this will result in the right effect.
>
> ===
>
> Separately, we don't really need all the file URL crap anymore. This
> was just trying to do compare the paths safely before we had a place
> to do it on the file thread.

Powered by Google App Engine
This is Rietveld 408576698