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

Unified Diff: third_party/WebKit/Source/modules/plugins/DOMMimeType.cpp

Issue 2901353002: Move blink::PluginData, blink::PluginInfo, blink::MimeTypeInfo to oilpan heap. (Closed)
Patch Set: nits, remove dead code 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/plugins/DOMMimeType.cpp
diff --git a/third_party/WebKit/Source/modules/plugins/DOMMimeType.cpp b/third_party/WebKit/Source/modules/plugins/DOMMimeType.cpp
index d64535b84869fecd010c019093f8a91c27280b3e..0d75a51fb1110d48c9cb6fd8ce20b719e9745000 100644
--- a/third_party/WebKit/Source/modules/plugins/DOMMimeType.cpp
+++ b/third_party/WebKit/Source/modules/plugins/DOMMimeType.cpp
@@ -27,25 +27,23 @@
namespace blink {
-DOMMimeType::DOMMimeType(PassRefPtr<PluginData> plugin_data,
- LocalFrame* frame,
- unsigned index)
- : ContextClient(frame),
- plugin_data_(std::move(plugin_data)),
- index_(index) {}
+DOMMimeType::DOMMimeType(LocalFrame* frame,
+ const MimeClassInfo& mime_class_info)
+ : ContextClient(frame), mime_class_info_(&mime_class_info) {}
DOMMimeType::~DOMMimeType() {}
DEFINE_TRACE(DOMMimeType) {
ContextClient::Trace(visitor);
+ visitor->Trace(mime_class_info_);
}
const String& DOMMimeType::type() const {
- return GetMimeClassInfo().type;
+ return mime_class_info_->Type();
}
String DOMMimeType::suffixes() const {
- const Vector<String>& extensions = GetMimeClassInfo().extensions;
+ const Vector<String>& extensions = mime_class_info_->Extensions();
StringBuilder builder;
for (size_t i = 0; i < extensions.size(); ++i) {
@@ -57,7 +55,7 @@ String DOMMimeType::suffixes() const {
}
const String& DOMMimeType::description() const {
- return GetMimeClassInfo().desc;
+ return mime_class_info_->Description();
}
DOMPlugin* DOMMimeType::enabledPlugin() const {
@@ -68,8 +66,7 @@ DOMPlugin* DOMMimeType::enabledPlugin() const {
!GetFrame()->Loader().AllowPlugins(kNotAboutToInstantiatePlugin))
return nullptr;
- return DOMPlugin::Create(plugin_data_.Get(), GetFrame(),
- plugin_data_->MimePluginIndices()[index_]);
+ return DOMPlugin::Create(GetFrame(), *mime_class_info_->Plugin());
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698