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

Issue 6057010: base: Remove deprecated file_util::GetFilenameFromPath function. (Closed)

Created:
9 years, 11 months ago by tfarina
Modified:
9 years, 7 months ago
Reviewers:
Evan Martin
CC:
chromium-reviews, Paweł Hajdan Jr., brettw-cc_chromium.org
Visibility:
Public.

Description

base: Remove deprecated file_util::GetFilenameFromPath function. BUG=24672 TEST=trybots Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=70610

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -21 lines) Patch
M base/file_util.cc View 1 chunk +0 lines, -6 lines 0 comments Download
M base/file_util_deprecated.h View 2 chunks +1 line, -4 lines 0 comments Download
M base/file_util_unittest.cc View 1 chunk +0 lines, -11 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
tfarina
Please, take a look.
9 years, 11 months ago (2011-01-06 02:07:33 UTC) #1
Evan Martin
9 years, 11 months ago (2011-01-06 06:47:16 UTC) #2
Lgtm

brevity due to phone
On Jan 5, 2011 6:07 PM, <tfarina@chromium.org> wrote:
> Reviewers: Evan Martin,
>
> Message:
> Please, take a look.
>
> Description:
> base: Remove deprecated file_util::GetFilenameFromPath function.
>
> BUG=24672
> TEST=trybots
>
> Please review this at http://codereview.chromium.org/6057010/
>
> SVN Base: svn://svn.chromium.org/chrome/trunk/src
>
> Affected files:
> M base/file_util.cc
> M base/file_util_deprecated.h
> M base/file_util_unittest.cc
>
>
> Index: base/file_util.cc
> diff --git a/base/file_util.cc b/base/file_util.cc
> index
>
2b5dc84df24daa5cb1ee246430f808ad2c983d0f..d1a46c92fbca89651dfe244462289c28cc3dc5c8

> 100644
> --- a/base/file_util.cc
> +++ b/base/file_util.cc
> @@ -386,12 +386,6 @@ std::wstring GetFileExtensionFromPath(const
> std::wstring& path) {
> GetFileExtensionFromPath(FilePath::FromWStringHack(path));
> return extension;
> }
> -std::wstring GetFilenameFromPath(const std::wstring& path) {
> - if (path.empty() || EndsWithSeparator(FilePath::FromWStringHack(path)))
> - return std::wstring();
> -
> - return FilePath::FromWStringHack(path).BaseName().ToWStringHack();
> -}
> FILE* OpenFile(const std::wstring& filename, const char* mode) {
> return OpenFile(FilePath::FromWStringHack(filename), mode);
> }
> Index: base/file_util_deprecated.h
> diff --git a/base/file_util_deprecated.h b/base/file_util_deprecated.h
> index
>
9bafb3121d4fe4a25acb9b66be48b0b9560c595e..bb8f7f99532e5ea975f5d79388426f43bec96004

> 100644
> --- a/base/file_util_deprecated.h
> +++ b/base/file_util_deprecated.h
> @@ -1,4 +1,4 @@
> -// Copyright (c) 2010 The Chromium Authors. All rights reserved.
> +// Copyright (c) 2011 The Chromium Authors. All rights reserved.
> // Use of this source code is governed by a BSD-style license that can be
> // found in the LICENSE file.
>
> @@ -27,9 +27,6 @@ namespace file_util {
> FILE* OpenFile(const std::string& filename, const char* mode);
> FILE* OpenFile(const std::wstring& filename, const char* mode);
>
> -// Use FilePath::BaseName instead.
> -std::wstring GetFilenameFromPath(const std::wstring& path);
> -
> // Returns the directory component of a path, without the trailing
> // path separator, or an empty string on error. The function does not
> // check for the existence of the path, so if it is passed a directory
> Index: base/file_util_unittest.cc
> diff --git a/base/file_util_unittest.cc b/base/file_util_unittest.cc
> index
>
4aaed901e80b610a8e178e715c2fc9ac34f7aac1..fa00fcf92c2426c7a409c0172791c486bc05150e

> 100644
> --- a/base/file_util_unittest.cc
> +++ b/base/file_util_unittest.cc
> @@ -251,17 +251,6 @@ static const struct filename_case {
> #endif
> };
>
> -#if defined(OS_WIN)
> -// This function is deprecated on non-Windows.
> -TEST_F(FileUtilTest, GetFilenameFromPath) {
> - for (unsigned int i = 0; i < arraysize(filename_cases); ++i) {
> - const filename_case& value = filename_cases[i];
> - std::wstring result = file_util::GetFilenameFromPath(value.path);
> - EXPECT_EQ(value.filename, result);
> - }
> -}
> -#endif
> -
> // Test finding the file type from a path name
> static const struct extension_case {
> const wchar_t* path;
>
>

Powered by Google App Engine
This is Rietveld 408576698