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

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

Issue 2901353002: Move blink::PluginData, blink::PluginInfo, blink::MimeTypeInfo to oilpan heap. (Closed)
Patch Set: Created 3 years, 6 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 28 matching lines...) Expand all
39 PluginData* data = GetPluginData(); 39 PluginData* data = GetPluginData();
40 if (!data) 40 if (!data)
41 return 0; 41 return 0;
42 return data->Plugins().size(); 42 return data->Plugins().size();
43 } 43 }
44 44
45 DOMPlugin* DOMPluginArray::item(unsigned index) { 45 DOMPlugin* DOMPluginArray::item(unsigned index) {
46 PluginData* data = GetPluginData(); 46 PluginData* data = GetPluginData();
47 if (!data) 47 if (!data)
48 return nullptr; 48 return nullptr;
49 const Vector<PluginInfo>& plugins = data->Plugins(); 49 const HeapVector<Member<PluginInfo>>& plugins = data->Plugins();
50 if (index >= plugins.size()) 50 if (index >= plugins.size())
51 return nullptr; 51 return nullptr;
52 return DOMPlugin::Create(data, GetFrame(), index); 52 return DOMPlugin::Create(GetFrame(), plugins[index]);
53 } 53 }
54 54
55 DOMPlugin* DOMPluginArray::namedItem(const AtomicString& property_name) { 55 DOMPlugin* DOMPluginArray::namedItem(const AtomicString& property_name) {
56 PluginData* data = GetPluginData(); 56 PluginData* data = GetPluginData();
57 if (!data) 57 if (!data)
58 return nullptr; 58 return nullptr;
59 const Vector<PluginInfo>& plugins = data->Plugins(); 59 const HeapVector<Member<PluginInfo>>& plugins = data->Plugins();
60 for (unsigned i = 0; i < plugins.size(); ++i) { 60 for (const PluginInfo* plugin : plugins) {
tkent 2017/05/25 00:10:32 The local variable |plugins| isn't necessary. for
lfg 2017/05/25 01:42:40 Done.
61 if (plugins[i].name == property_name) 61 if (plugin->name() == property_name)
62 return DOMPlugin::Create(data, GetFrame(), i); 62 return DOMPlugin::Create(GetFrame(), plugin);
63 } 63 }
64 return nullptr; 64 return nullptr;
65 } 65 }
66 66
67 void DOMPluginArray::refresh(bool reload) { 67 void DOMPluginArray::refresh(bool reload) {
68 if (!GetFrame()) 68 if (!GetFrame())
69 return; 69 return;
70 Page::RefreshPlugins(); 70 Page::RefreshPlugins();
71 if (reload) { 71 if (reload) {
72 GetFrame()->Reload(kFrameLoadTypeReload, 72 GetFrame()->Reload(kFrameLoadTypeReload,
73 ClientRedirectPolicy::kClientRedirect); 73 ClientRedirectPolicy::kClientRedirect);
74 } 74 }
75 } 75 }
76 76
77 PluginData* DOMPluginArray::GetPluginData() const { 77 PluginData* DOMPluginArray::GetPluginData() const {
78 if (!GetFrame()) 78 if (!GetFrame())
79 return nullptr; 79 return nullptr;
80 return GetFrame()->GetPluginData(); 80 return GetFrame()->GetPluginData();
81 } 81 }
82 82
83 } // namespace blink 83 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698