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

Side by Side Diff: third_party/WebKit/Source/modules/plugins/DOMMimeTypeArray.cpp

Issue 2901353002: Move blink::PluginData, blink::PluginInfo, blink::MimeTypeInfo to oilpan heap. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 2 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
3 * Copyright (C) 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2008 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public 6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 27 matching lines...) Expand all
38 PluginData* data = GetPluginData(); 38 PluginData* data = GetPluginData();
39 if (!data) 39 if (!data)
40 return 0; 40 return 0;
41 return data->Mimes().size(); 41 return data->Mimes().size();
42 } 42 }
43 43
44 DOMMimeType* DOMMimeTypeArray::item(unsigned index) { 44 DOMMimeType* DOMMimeTypeArray::item(unsigned index) {
45 PluginData* data = GetPluginData(); 45 PluginData* data = GetPluginData();
46 if (!data) 46 if (!data)
47 return nullptr; 47 return nullptr;
48 const Vector<MimeClassInfo>& mimes = data->Mimes(); 48 const HeapVector<Member<MimeClassInfo>>& mimes = data->Mimes();
49 if (index >= mimes.size()) 49 if (index >= mimes.size())
50 return nullptr; 50 return nullptr;
51 return DOMMimeType::Create(data, GetFrame(), index); 51 return DOMMimeType::Create(GetFrame(), mimes[index]);
52 } 52 }
53 53
54 DOMMimeType* DOMMimeTypeArray::namedItem(const AtomicString& property_name) { 54 DOMMimeType* DOMMimeTypeArray::namedItem(const AtomicString& property_name) {
55 PluginData* data = GetPluginData(); 55 PluginData* data = GetPluginData();
56 if (!data) 56 if (!data)
57 return nullptr; 57 return nullptr;
58 const Vector<MimeClassInfo>& mimes = data->Mimes(); 58 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.
59 for (unsigned i = 0; i < mimes.size(); ++i) { 59 for (const MimeClassInfo* mime : mimes) {
60 if (mimes[i].type == property_name) 60 if (mime->type() == property_name)
61 return DOMMimeType::Create(data, GetFrame(), i); 61 return DOMMimeType::Create(GetFrame(), mime);
62 } 62 }
63 return nullptr; 63 return nullptr;
64 } 64 }
65 65
66 PluginData* DOMMimeTypeArray::GetPluginData() const { 66 PluginData* DOMMimeTypeArray::GetPluginData() const {
67 if (!GetFrame()) 67 if (!GetFrame())
68 return nullptr; 68 return nullptr;
69 return GetFrame()->GetPluginData(); 69 return GetFrame()->GetPluginData();
70 } 70 }
71 71
72 } // namespace blink 72 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698