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

Unified Diff: chrome/browser/extensions/api/file_handlers/mime_util.cc

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header Created 4 years, 8 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/extensions/api/file_handlers/mime_util.cc
diff --git a/chrome/browser/extensions/api/file_handlers/mime_util.cc b/chrome/browser/extensions/api/file_handlers/mime_util.cc
index 862eabaf0750868c80c1f116a5e778160263f5ca..6cb4ebfc156f68c3e719ca53a81c0bd30a35ee28 100644
--- a/chrome/browser/extensions/api/file_handlers/mime_util.cc
+++ b/chrome/browser/extensions/api/file_handlers/mime_util.cc
@@ -52,7 +52,7 @@ void SniffMimeType(const base::FilePath& local_path, std::string* result) {
// Converts a result passed as a scoped pointer to a dereferenced value passed
// to |callback|.
void OnGetMimeTypeFromFileForNonNativeLocalPathCompleted(
- scoped_ptr<std::string> mime_type,
+ std::unique_ptr<std::string> mime_type,
const base::Callback<void(const std::string&)>& callback) {
callback.Run(*mime_type);
}
@@ -72,7 +72,7 @@ void OnGetMimeTypeFromMetadataForNonNativeLocalPathCompleted(
// MIME type not available with metadata, hence try to guess it from the
// file's extension.
- scoped_ptr<std::string> mime_type_from_extension(new std::string);
+ std::unique_ptr<std::string> mime_type_from_extension(new std::string);
std::string* const mime_type_from_extension_ptr =
mime_type_from_extension.get();
BrowserThread::PostBlockingPoolTaskAndReply(
@@ -88,7 +88,7 @@ void OnGetMimeTypeFromMetadataForNonNativeLocalPathCompleted(
// Called when sniffing for MIME type in the native local file is completed.
void OnSniffMimeTypeForNativeLocalPathCompleted(
- scoped_ptr<std::string> mime_type,
+ std::unique_ptr<std::string> mime_type,
const base::Callback<void(const std::string&)>& callback) {
// Do not return application/zip as sniffed result. If the file has .zip
// extension, it should be already returned as application/zip. If the file
@@ -109,14 +109,14 @@ void OnSniffMimeTypeForNativeLocalPathCompleted(
// to sniffing.
void OnGetMimeTypeFromFileForNativeLocalPathCompleted(
const base::FilePath& local_path,
- scoped_ptr<std::string> mime_type,
+ std::unique_ptr<std::string> mime_type,
const base::Callback<void(const std::string&)>& callback) {
if (!mime_type->empty()) {
callback.Run(*mime_type);
return;
}
- scoped_ptr<std::string> sniffed_mime_type(
+ std::unique_ptr<std::string> sniffed_mime_type(
new std::string(kMimeTypeApplicationOctetStream));
std::string* const sniffed_mime_type_ptr = sniffed_mime_type.get();
BrowserThread::PostBlockingPoolTaskAndReply(
@@ -149,7 +149,7 @@ void GetMimeTypeForLocalPath(
// For native local files, try to guess the mime from the extension. If
// not available, then try to sniff if.
- scoped_ptr<std::string> mime_type_from_extension(new std::string);
+ std::unique_ptr<std::string> mime_type_from_extension(new std::string);
std::string* const mime_type_from_extension_ptr =
mime_type_from_extension.get();
BrowserThread::PostBlockingPoolTaskAndReply(

Powered by Google App Engine
This is Rietveld 408576698