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

Unified Diff: chrome/browser/media_galleries/fileapi/native_media_file_util.cc

Issue 16041004: Cleanup: Remove ScopedGenericObj usage in chrome/. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media_galleries/fileapi/native_media_file_util.cc
===================================================================
--- chrome/browser/media_galleries/fileapi/native_media_file_util.cc (revision 202209)
+++ chrome/browser/media_galleries/fileapi/native_media_file_util.cc (working copy)
@@ -5,7 +5,6 @@
#include "chrome/browser/media_galleries/fileapi/native_media_file_util.h"
#include "base/file_util.h"
-#include "base/memory/scoped_generic_obj.h"
#include "base/string_util.h"
#include "chrome/browser/media_galleries/fileapi/filtering_file_enumerator.h"
#include "chrome/browser/media_galleries/fileapi/media_file_system_mount_point_provider.h"
@@ -29,16 +28,15 @@
namespace {
// Modelled after ScopedFILEClose.
-class ScopedPlatformFileClose {
- public:
- void operator()(base::PlatformFile file) const {
- if (file != base::kInvalidPlatformFileValue)
- base::ClosePlatformFile(file);
+struct ScopedPlatformFileClose {
+ void operator()(base::PlatformFile* file) {
+ if (file && *file != base::kInvalidPlatformFileValue)
+ base::ClosePlatformFile(*file);
}
};
-typedef ScopedGenericObj<base::PlatformFile,
- ScopedPlatformFileClose> ScopedPlatformFile;
+typedef scoped_ptr<base::PlatformFile, ScopedPlatformFileClose>
+ ScopedPlatformFile;
// Returns true if the current thread is capable of doing IO.
bool IsOnTaskRunnerThread(fileapi::FileSystemOperationContext* context) {
@@ -279,7 +277,7 @@
if (error != base::PLATFORM_FILE_OK)
return error;
- ScopedPlatformFile scoped_platform_file(file_handle);
+ ScopedPlatformFile scoped_platform_file(&file_handle);
char buffer[net::kMaxBytesToSniff];
// Read as much as net::SniffMimeTypeFromLocalData() will bother looking at.

Powered by Google App Engine
This is Rietveld 408576698