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

Side by Side Diff: chrome/browser/media_galleries/fileapi/supported_audio_video_checker.cc

Issue 2230203002: chrome: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed accidental components/ change Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h " 5 #include "chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h "
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 22 matching lines...) Expand all
33 std::string mime_type; 33 std::string mime_type;
34 if (net::GetWellKnownMimeTypeFromExtension(extensions[i], &mime_type) && 34 if (net::GetWellKnownMimeTypeFromExtension(extensions[i], &mime_type) &&
35 mime_util::IsSupportedMimeType(mime_type)) { 35 mime_util::IsSupportedMimeType(mime_type)) {
36 audio_video_extensions_.insert( 36 audio_video_extensions_.insert(
37 base::FilePath::kExtensionSeparator + extensions[i]); 37 base::FilePath::kExtensionSeparator + extensions[i]);
38 } 38 }
39 } 39 }
40 }; 40 };
41 41
42 bool HasSupportedAudioVideoExtension(const base::FilePath& file) { 42 bool HasSupportedAudioVideoExtension(const base::FilePath& file) {
43 return ContainsKey(audio_video_extensions_, file.Extension()); 43 return base::ContainsKey(audio_video_extensions_, file.Extension());
44 } 44 }
45 45
46 private: 46 private:
47 std::set<base::FilePath::StringType> audio_video_extensions_; 47 std::set<base::FilePath::StringType> audio_video_extensions_;
48 48
49 DISALLOW_COPY_AND_ASSIGN(SupportedAudioVideoExtensions); 49 DISALLOW_COPY_AND_ASSIGN(SupportedAudioVideoExtensions);
50 }; 50 };
51 51
52 base::LazyInstance<SupportedAudioVideoExtensions> g_audio_video_extensions = 52 base::LazyInstance<SupportedAudioVideoExtensions> g_audio_video_extensions =
53 LAZY_INSTANCE_INITIALIZER; 53 LAZY_INSTANCE_INITIALIZER;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 void SupportedAudioVideoChecker::OnFileOpen(base::File file) { 89 void SupportedAudioVideoChecker::OnFileOpen(base::File file) {
90 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 90 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
91 if (!file.IsValid()) { 91 if (!file.IsValid()) {
92 callback_.Run(base::File::FILE_ERROR_SECURITY); 92 callback_.Run(base::File::FILE_ERROR_SECURITY);
93 return; 93 return;
94 } 94 }
95 95
96 safe_checker_ = new SafeAudioVideoChecker(std::move(file), callback_); 96 safe_checker_ = new SafeAudioVideoChecker(std::move(file), callback_);
97 safe_checker_->Start(); 97 safe_checker_->Start();
98 } 98 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698