Chromium Code Reviews| Index: third_party/WebKit/Source/modules/plugins/DOMMimeTypeArray.cpp |
| diff --git a/third_party/WebKit/Source/modules/plugins/DOMMimeTypeArray.cpp b/third_party/WebKit/Source/modules/plugins/DOMMimeTypeArray.cpp |
| index 86f6be51253945299dffe89a67b6c8ef298b8b9e..3f63a193b05356e37d956d9a43fc918b919f9cf3 100644 |
| --- a/third_party/WebKit/Source/modules/plugins/DOMMimeTypeArray.cpp |
| +++ b/third_party/WebKit/Source/modules/plugins/DOMMimeTypeArray.cpp |
| @@ -45,20 +45,20 @@ DOMMimeType* DOMMimeTypeArray::item(unsigned index) { |
| PluginData* data = GetPluginData(); |
| if (!data) |
| return nullptr; |
| - const Vector<MimeClassInfo>& mimes = data->Mimes(); |
| + const HeapVector<Member<MimeClassInfo>>& mimes = data->Mimes(); |
| if (index >= mimes.size()) |
| return nullptr; |
| - return DOMMimeType::Create(data, GetFrame(), index); |
| + return DOMMimeType::Create(GetFrame(), mimes[index]); |
| } |
| DOMMimeType* DOMMimeTypeArray::namedItem(const AtomicString& property_name) { |
| PluginData* data = GetPluginData(); |
| if (!data) |
| return nullptr; |
| - const Vector<MimeClassInfo>& mimes = data->Mimes(); |
| - for (unsigned i = 0; i < mimes.size(); ++i) { |
| - if (mimes[i].type == property_name) |
| - return DOMMimeType::Create(data, GetFrame(), i); |
| + const HeapVector<Member<MimeClassInfo>>& mimes = data->Mimes(); |
|
tkent
2017/05/25 00:10:32
The local variable |mimes| isn't necessary.
for (
lfg
2017/05/25 01:42:40
Done.
|
| + for (const MimeClassInfo* mime : mimes) { |
| + if (mime->type() == property_name) |
| + return DOMMimeType::Create(GetFrame(), mime); |
| } |
| return nullptr; |
| } |