Changeset 86516 in webkit
- Timestamp:
- May 15, 2011 5:53:59 PM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r86499 r86516 1 2011-05-15 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Geoffrey Garen. 4 5 Pass the document URL and toplevel document URL when creating a plug-in 6 https://bugs.webkit.org/show_bug.cgi?id=60863 7 8 This is the first of a series of patches intended to reduce the IPC traffic 9 during plug-in instantiation. 10 11 * WebProcess/Plugins/Plugin.cpp: 12 (WebKit::Plugin::Parameters::encode): 13 Encode the URLs. 14 15 (WebKit::Plugin::Parameters::decode): 16 Decode the URLs. 17 18 * WebProcess/Plugins/Plugin.h: 19 Add the document and toplevel document URLs. 20 21 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 22 (WebKit::WebFrameLoaderClient::createPlugin): 23 Initialize the document and toplevel document URLs. 24 1 25 2011-05-13 Oliver Hunt <oliver@apple.com> 2 26 -
trunk/Source/WebKit2/WebProcess/Plugins/Plugin.cpp
r76916 r86516 40 40 encoder->encode(mimeType); 41 41 encoder->encode(loadManually); 42 encoder->encode(documentURL); 43 encoder->encode(toplevelDocumentURL); 42 44 } 43 45 … … 57 59 return false; 58 60 if (!decoder->decode(parameters.loadManually)) 61 return false; 62 if (!decoder->decode(parameters.documentURL)) 63 return false; 64 if (!decoder->decode(parameters.toplevelDocumentURL)) 59 65 return false; 60 66 -
trunk/Source/WebKit2/WebProcess/Plugins/Plugin.h
r86467 r86516 61 61 String mimeType; 62 62 bool loadManually; 63 64 // The URL of the document that the plug-in is in. 65 String documentURL; 66 67 // The URL of the document in the main frame. Will be null if the document the plug-in 68 // doesn't have access to the main frame document. 69 String toplevelDocumentURL; 63 70 64 71 void encode(CoreIPC::ArgumentEncoder*) const; -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r85785 r86516 1199 1199 } 1200 1200 1201 static String documentURL(Frame* frame) 1202 { 1203 const KURL& url = frame->document()->url(); 1204 return url.hasPath() ? url.prettyURL() : url.prettyURL() + "/"; 1205 } 1206 1201 1207 PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugInElement* pluginElement, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually) 1202 1208 { … … 1212 1218 parameters.mimeType = mimeType; 1213 1219 parameters.loadManually = loadManually; 1220 parameters.documentURL = documentURL(m_frame->coreFrame()); 1221 1222 Frame* mainFrame = webPage->mainFrame()->coreFrame(); 1223 if (m_frame->coreFrame() == mainFrame) 1224 parameters.toplevelDocumentURL = parameters.documentURL; 1225 else if (m_frame->coreFrame()->document()->securityOrigin()->canAccess(mainFrame->document()->securityOrigin())) { 1226 // We only want to set the toplevel document URL if the plug-in has access to it. 1227 parameters.toplevelDocumentURL = documentURL(mainFrame); 1228 } 1214 1229 1215 1230 // <rdar://problem/8440903>: AppleConnect has a bug where it does not
Note: See TracChangeset
for help on using the changeset viewer.