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

Side by Side Diff: Source/core/svg/graphics/SVGImage.cpp

Issue 1306793003: Oilpan: Move FrameLoaderClient class hierarchy into Oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/page/PrintContextTest.cpp ('k') | Source/core/testing/DummyPageHolder.h » ('j') | 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 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 if (!data()->size()) 417 if (!data()->size())
418 return true; 418 return true;
419 419
420 if (allDataReceived) { 420 if (allDataReceived) {
421 // SVGImage will fire events (and the default C++ handlers run) but does n't 421 // SVGImage will fire events (and the default C++ handlers run) but does n't
422 // actually allow script to run so it's fine to call into it. We allow t his 422 // actually allow script to run so it's fine to call into it. We allow t his
423 // since it means an SVG data url can synchronously load like other imag e 423 // since it means an SVG data url can synchronously load like other imag e
424 // types. 424 // types.
425 EventDispatchForbiddenScope::AllowUserAgentEvents allowUserAgentEvents; 425 EventDispatchForbiddenScope::AllowUserAgentEvents allowUserAgentEvents;
426 426
427 static FrameLoaderClient* dummyFrameLoaderClient = new EmptyFrameLoaderC lient; 427 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<FrameLoaderClient>, dummyFram eLoaderClient, (EmptyFrameLoaderClient::create()));
428 428
429 Page::PageClients pageClients; 429 Page::PageClients pageClients;
430 fillWithEmptyClients(pageClients); 430 fillWithEmptyClients(pageClients);
431 m_chromeClient = SVGImageChromeClient::create(this); 431 m_chromeClient = SVGImageChromeClient::create(this);
432 pageClients.chromeClient = m_chromeClient.get(); 432 pageClients.chromeClient = m_chromeClient.get();
433 433
434 // FIXME: If this SVG ends up loading itself, we might leak the world. 434 // FIXME: If this SVG ends up loading itself, we might leak the world.
435 // The Cache code does not know about ImageResources holding Frames and 435 // The Cache code does not know about ImageResources holding Frames and
436 // won't know to break the cycle. 436 // won't know to break the cycle.
437 // This will become an issue when SVGImage will be able to load other 437 // This will become an issue when SVGImage will be able to load other
(...skipping 16 matching lines...) Expand all
454 page->settings().setMinimumFontSize(defaultSettings.minimumFontS ize()); 454 page->settings().setMinimumFontSize(defaultSettings.minimumFontS ize());
455 page->settings().setMinimumLogicalFontSize(defaultSettings.minim umLogicalFontSize()); 455 page->settings().setMinimumLogicalFontSize(defaultSettings.minim umLogicalFontSize());
456 page->settings().setDefaultFontSize(defaultSettings.defaultFontS ize()); 456 page->settings().setDefaultFontSize(defaultSettings.defaultFontS ize());
457 page->settings().setDefaultFixedFontSize(defaultSettings.default FixedFontSize()); 457 page->settings().setDefaultFixedFontSize(defaultSettings.default FixedFontSize());
458 } 458 }
459 } 459 }
460 460
461 RefPtrWillBeRawPtr<LocalFrame> frame = nullptr; 461 RefPtrWillBeRawPtr<LocalFrame> frame = nullptr;
462 { 462 {
463 TRACE_EVENT0("blink", "SVGImage::dataChanged::createFrame"); 463 TRACE_EVENT0("blink", "SVGImage::dataChanged::createFrame");
464 frame = LocalFrame::create(dummyFrameLoaderClient, &page->frameHost( ), 0); 464 frame = LocalFrame::create(dummyFrameLoaderClient.get(), &page->fram eHost(), 0);
465 frame->setView(FrameView::create(frame.get())); 465 frame->setView(FrameView::create(frame.get()));
466 frame->init(); 466 frame->init();
467 } 467 }
468 468
469 FrameLoader& loader = frame->loader(); 469 FrameLoader& loader = frame->loader();
470 loader.forceSandboxFlags(SandboxAll); 470 loader.forceSandboxFlags(SandboxAll);
471 471
472 frame->view()->setScrollbarsSuppressed(true); 472 frame->view()->setScrollbarsSuppressed(true);
473 frame->view()->setCanHaveScrollbars(false); // SVG Images will always sy nthesize a viewBox, if it's not available, and thus never see scrollbars. 473 frame->view()->setCanHaveScrollbars(false); // SVG Images will always sy nthesize a viewBox, if it's not available, and thus never see scrollbars.
474 frame->view()->setTransparent(true); // SVG Images are transparent. 474 frame->view()->setTransparent(true); // SVG Images are transparent.
(...skipping 10 matching lines...) Expand all
485 485
486 return m_page; 486 return m_page;
487 } 487 }
488 488
489 String SVGImage::filenameExtension() const 489 String SVGImage::filenameExtension() const
490 { 490 {
491 return "svg"; 491 return "svg";
492 } 492 }
493 493
494 } 494 }
OLDNEW
« no previous file with comments | « Source/core/page/PrintContextTest.cpp ('k') | Source/core/testing/DummyPageHolder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698