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

Side by Side Diff: third_party/WebKit/Source/core/dom/DOMImplementation.cpp

Issue 2156803002: [HBD] Remove PluginCache and reload plugin list when origin changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment Created 4 years, 3 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) 6 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org)
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 { 218 {
219 if (inViewSourceMode) 219 if (inViewSourceMode)
220 return HTMLViewSourceDocument::create(init, type); 220 return HTMLViewSourceDocument::create(init, type);
221 221
222 // Plugins cannot take HTML and XHTML from us, and we don't even need to ini tialize the plugin database for those. 222 // Plugins cannot take HTML and XHTML from us, and we don't even need to ini tialize the plugin database for those.
223 if (type == "text/html") 223 if (type == "text/html")
224 return HTMLDocument::create(init); 224 return HTMLDocument::create(init);
225 if (type == "application/xhtml+xml") 225 if (type == "application/xhtml+xml")
226 return XMLDocument::createXHTML(init); 226 return XMLDocument::createXHTML(init);
227 227
228 PluginData* pluginData = 0; 228 PluginData* pluginData = nullptr;
229 if (init.frame() && init.frame()->page() && init.frame()->loader().allowPlug ins(NotAboutToInstantiatePlugin)) 229 if (init.frame() && init.frame()->page() && init.frame()->loader().allowPlug ins(NotAboutToInstantiatePlugin)) {
230 pluginData = init.frame()->pluginData(); 230 // If the document is being created for the main frame, init.frame()->tr ee().top()->securityContext() returns nullptr.
231 // For that reason, the origin must be retrieved directly from init.url( ).
232 if (init.frame()->isMainFrame()) {
233 RefPtr<SecurityOrigin> origin = SecurityOrigin::create(init.url());
234 pluginData = init.frame()->page()->pluginData(origin.get());
235 } else {
236 pluginData = init.frame()->page()->pluginData(init.frame()->tree().t op()->securityContext()->getSecurityOrigin());
237 }
238 }
231 239
232 // PDF is one image type for which a plugin can override built-in support. 240 // PDF is one image type for which a plugin can override built-in support.
233 // We do not want QuickTime to take over all image types, obviously. 241 // We do not want QuickTime to take over all image types, obviously.
234 if ((type == "application/pdf" || type == "text/pdf") && pluginData && plugi nData->supportsMimeType(type)) 242 if ((type == "application/pdf" || type == "text/pdf") && pluginData && plugi nData->supportsMimeType(type))
235 return PluginDocument::create(init); 243 return PluginDocument::create(init);
236 // multipart/x-mixed-replace is only supported for images. 244 // multipart/x-mixed-replace is only supported for images.
237 if (Image::supportsType(type) || type == "multipart/x-mixed-replace") 245 if (Image::supportsType(type) || type == "multipart/x-mixed-replace")
238 return ImageDocument::create(init); 246 return ImageDocument::create(init);
239 247
240 // Check to see if the type can be played by our media player, if so create a MediaDocument 248 // Check to see if the type can be played by our media player, if so create a MediaDocument
(...skipping 14 matching lines...) Expand all
255 263
256 return HTMLDocument::create(init); 264 return HTMLDocument::create(init);
257 } 265 }
258 266
259 DEFINE_TRACE(DOMImplementation) 267 DEFINE_TRACE(DOMImplementation)
260 { 268 {
261 visitor->trace(m_document); 269 visitor->trace(m_document);
262 } 270 }
263 271
264 } // namespace blink 272 } // namespace blink
OLDNEW
« no previous file with comments | « content/test/test_blink_web_unit_test_support.cc ('k') | third_party/WebKit/Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698