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

Side by Side Diff: WebCore/svg/graphics/SVGImage.cpp

Issue 1696004: Merge 57922 - 20100420 Justin Schuh <jschuh@chromium.org>... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/WebKit/375/
Patch Set: Created 10 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 | Annotate | Revision Log
« no previous file with comments | « WebCore/page/Settings.cpp ('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) 2006 Eric Seidel (eric@webkit.org) 2 * Copyright (C) 2006 Eric Seidel (eric@webkit.org)
3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 static DragClient* dummyDragClient = 0; 240 static DragClient* dummyDragClient = 0;
241 #endif 241 #endif
242 static InspectorClient* dummyInspectorClient = new EmptyInspectorClient; 242 static InspectorClient* dummyInspectorClient = new EmptyInspectorClient;
243 243
244 m_chromeClient.set(new SVGImageChromeClient(this)); 244 m_chromeClient.set(new SVGImageChromeClient(this));
245 245
246 // FIXME: If this SVG ends up loading itself, we might leak the world. 246 // FIXME: If this SVG ends up loading itself, we might leak the world.
247 // The comment said that the Cache code does not know about CachedImages 247 // The comment said that the Cache code does not know about CachedImages
248 // holding Frames and won't know to break the cycle. But 248 // holding Frames and won't know to break the cycle. But
249 m_page.set(new Page(m_chromeClient.get(), dummyContextMenuClient, dummyE ditorClient, dummyDragClient, dummyInspectorClient, 0, 0)); 249 m_page.set(new Page(m_chromeClient.get(), dummyContextMenuClient, dummyE ditorClient, dummyDragClient, dummyInspectorClient, 0, 0));
250 m_page->settings()->setMediaEnabled(false);
250 m_page->settings()->setJavaScriptEnabled(false); 251 m_page->settings()->setJavaScriptEnabled(false);
251 m_page->settings()->setPluginsEnabled(false); 252 m_page->settings()->setPluginsEnabled(false);
252 253
253 RefPtr<Frame> frame = Frame::create(m_page.get(), 0, dummyFrameLoaderCli ent); 254 RefPtr<Frame> frame = Frame::create(m_page.get(), 0, dummyFrameLoaderCli ent);
254 frame->setView(FrameView::create(frame.get())); 255 frame->setView(FrameView::create(frame.get()));
255 frame->init(); 256 frame->init();
256 ResourceRequest fakeRequest(KURL(ParsedURLString, "")); 257 ResourceRequest fakeRequest(KURL(ParsedURLString, ""));
257 FrameLoader* loader = frame->loader(); 258 FrameLoader* loader = frame->loader();
258 loader->load(fakeRequest, false); // Make sure the DocumentLoader is cre ated 259 loader->load(fakeRequest, false); // Make sure the DocumentLoader is cre ated
259 loader->policyChecker()->cancelCheck(); // cancel any policy checks 260 loader->policyChecker()->cancelCheck(); // cancel any policy checks
260 loader->commitProvisionalLoad(0); 261 loader->commitProvisionalLoad(0);
261 loader->setResponseMIMEType("image/svg+xml"); 262 loader->setResponseMIMEType("image/svg+xml");
262 loader->begin(KURL()); // create the empty document 263 loader->begin(KURL()); // create the empty document
263 loader->write(data()->data(), data()->size()); 264 loader->write(data()->data(), data()->size());
264 loader->end(); 265 loader->end();
265 frame->view()->setTransparent(true); // SVG Images are transparent. 266 frame->view()->setTransparent(true); // SVG Images are transparent.
266 } 267 }
267 268
268 return m_page; 269 return m_page;
269 } 270 }
270 271
271 String SVGImage::filenameExtension() const 272 String SVGImage::filenameExtension() const
272 { 273 {
273 return "svg"; 274 return "svg";
274 } 275 }
275 276
276 } 277 }
277 278
278 #endif // ENABLE(SVG) 279 #endif // ENABLE(SVG)
OLDNEW
« no previous file with comments | « WebCore/page/Settings.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698