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

Side by Side Diff: Source/core/html/HTMLAppletElement.cpp

Issue 1079953002: Better handling of broken applet codebase (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « LayoutTests/plugins/applet-codebase-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) 2000 Stefan Schimanski (1Stein@gmx.de) 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de)
5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2012 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2012 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 const AtomicString& code = getAttribute(codeAttr); 144 const AtomicString& code = getAttribute(codeAttr);
145 paramNames.append("code"); 145 paramNames.append("code");
146 paramValues.append(code.string()); 146 paramValues.append(code.string());
147 147
148 // If the 'codebase' attribute is set, it serves as a relative root for the file that the Java 148 // If the 'codebase' attribute is set, it serves as a relative root for the file that the Java
149 // plugin will load. If the 'code' attribute is set, and the 'archive' is no t set, then we need 149 // plugin will load. If the 'code' attribute is set, and the 'archive' is no t set, then we need
150 // to check the url generated by resolving 'code' against 'codebase'. If the 'archive' 150 // to check the url generated by resolving 'code' against 'codebase'. If the 'archive'
151 // attribute is set, then 'code' points to a class inside the archive, so we need to check the 151 // attribute is set, then 'code' points to a class inside the archive, so we need to check the
152 // url generated by resolving 'archive' against 'codebase'. 152 // url generated by resolving 'archive' against 'codebase'.
153 KURL urlToCheck; 153 KURL urlToCheck;
154 KURL rootURL = codeBase.isNull() ? document().url() : document().completeURL (codeBase); 154 KURL rootURL;
155 if (!codeBase.isNull())
156 rootURL = document().completeURL(codeBase);
157 if (rootURL.isNull() || !rootURL.isValid())
158 rootURL = document().url();
159
155 if (!archive.isNull()) 160 if (!archive.isNull())
156 urlToCheck = KURL(rootURL, archive); 161 urlToCheck = KURL(rootURL, archive);
157 else if (!code.isNull()) 162 else if (!code.isNull())
158 urlToCheck = KURL(rootURL, code); 163 urlToCheck = KURL(rootURL, code);
159 if (!canEmbedURL(urlToCheck)) 164 if (!canEmbedURL(urlToCheck))
160 return; 165 return;
161 166
162 const AtomicString& name = document().isHTMLDocument() ? getNameAttribute() : getIdAttribute(); 167 const AtomicString& name = document().isHTMLDocument() ? getNameAttribute() : getIdAttribute();
163 if (!name.isNull()) { 168 if (!name.isNull()) {
164 paramNames.append("name"); 169 paramNames.append("name");
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 233
229 if (!document().contentSecurityPolicy()->allowObjectFromSource(url) 234 if (!document().contentSecurityPolicy()->allowObjectFromSource(url)
230 || !document().contentSecurityPolicy()->allowPluginTypeForDocument(docum ent(), m_serviceType, m_serviceType, url)) { 235 || !document().contentSecurityPolicy()->allowPluginTypeForDocument(docum ent(), m_serviceType, m_serviceType, url)) {
231 layoutEmbeddedObject()->setPluginUnavailabilityReason(LayoutEmbeddedObje ct::PluginBlockedByContentSecurityPolicy); 236 layoutEmbeddedObject()->setPluginUnavailabilityReason(LayoutEmbeddedObje ct::PluginBlockedByContentSecurityPolicy);
232 return false; 237 return false;
233 } 238 }
234 return true; 239 return true;
235 } 240 }
236 241
237 } 242 }
OLDNEW
« no previous file with comments | « LayoutTests/plugins/applet-codebase-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698