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

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: Changes per dcheng@'s comment Created 4 years, 4 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 SecurityContext* mainFrameSecurityContext = init.frame()->page()->mainFr ame()->securityContext();
231 pluginData = init.frame()->page()->pluginData(mainFrameSecurityContext ? mainFrameSecurityContext->getSecurityOrigin() : SecurityOrigin::create(init.url ()).get());
dcheng 2016/08/23 05:51:55 Hm, so when we create the document for the main fr
tommycli 2016/08/23 17:31:03 For the purposes of retrieving the plugin data, we
trizzofo 2016/08/23 22:46:20 I changed it to use Frame's IsMainFrame() method.
232 }
231 233
232 // PDF is one image type for which a plugin can override built-in support. 234 // 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. 235 // 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)) 236 if ((type == "application/pdf" || type == "text/pdf") && pluginData && plugi nData->supportsMimeType(type))
235 return PluginDocument::create(init); 237 return PluginDocument::create(init);
236 // multipart/x-mixed-replace is only supported for images. 238 // multipart/x-mixed-replace is only supported for images.
237 if (Image::supportsType(type) || type == "multipart/x-mixed-replace") 239 if (Image::supportsType(type) || type == "multipart/x-mixed-replace")
238 return ImageDocument::create(init); 240 return ImageDocument::create(init);
239 241
240 // Check to see if the type can be played by our media player, if so create a MediaDocument 242 // 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 257
256 return HTMLDocument::create(init); 258 return HTMLDocument::create(init);
257 } 259 }
258 260
259 DEFINE_TRACE(DOMImplementation) 261 DEFINE_TRACE(DOMImplementation)
260 { 262 {
261 visitor->trace(m_document); 263 visitor->trace(m_document);
262 } 264 }
263 265
264 } // namespace blink 266 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698