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

Side by Side Diff: third_party/WebKit/Source/core/css/FontFace.cpp

Issue 1667843003: Make Resource RefCountedWillBeGarbageCollectedFinalized, attempt #2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix known issues Created 4 years, 10 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 581
582 for (int i = 0; i < srcLength; i++) { 582 for (int i = 0; i < srcLength; i++) {
583 // An item in the list either specifies a string (local font name) or a URL (remote font to download). 583 // An item in the list either specifies a string (local font name) or a URL (remote font to download).
584 CSSFontFaceSrcValue* item = toCSSFontFaceSrcValue(srcList->item(i)); 584 CSSFontFaceSrcValue* item = toCSSFontFaceSrcValue(srcList->item(i));
585 OwnPtrWillBeRawPtr<CSSFontFaceSource> source = nullptr; 585 OwnPtrWillBeRawPtr<CSSFontFaceSource> source = nullptr;
586 586
587 if (!item->isLocal()) { 587 if (!item->isLocal()) {
588 const Settings* settings = document ? document->settings() : nullptr ; 588 const Settings* settings = document ? document->settings() : nullptr ;
589 bool allowDownloading = settings && settings->downloadableBinaryFont sEnabled(); 589 bool allowDownloading = settings && settings->downloadableBinaryFont sEnabled();
590 if (allowDownloading && item->isSupportedFormat() && document) { 590 if (allowDownloading && item->isSupportedFormat() && document) {
591 FontResource* fetched = item->fetch(document); 591 RefPtrWillBeRawPtr<FontResource> fetched = item->fetch(document) ;
592 if (fetched) { 592 if (fetched) {
593 FontLoader* fontLoader = document->styleEngine().fontSelecto r()->fontLoader(); 593 FontLoader* fontLoader = document->styleEngine().fontSelecto r()->fontLoader();
594 source = adoptPtrWillBeNoop(new RemoteFontFaceSource(fetched , fontLoader, CSSValueToFontDisplay(m_display.get()))); 594 source = adoptPtrWillBeNoop(new RemoteFontFaceSource(fetched .release(), fontLoader, CSSValueToFontDisplay(m_display.get())));
595 } 595 }
596 } 596 }
597 } else { 597 } else {
598 source = adoptPtrWillBeNoop(new LocalFontFaceSource(item->resource() )); 598 source = adoptPtrWillBeNoop(new LocalFontFaceSource(item->resource() ));
599 } 599 }
600 600
601 if (source) 601 if (source)
602 m_cssFontFace->addSource(source.release()); 602 m_cssFontFace->addSource(source.release());
603 } 603 }
604 604
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 { 641 {
642 return m_cssFontFace->hadBlankText(); 642 return m_cssFontFace->hadBlankText();
643 } 643 }
644 644
645 bool FontFace::hasPendingActivity() const 645 bool FontFace::hasPendingActivity() const
646 { 646 {
647 return m_status == Loading && executionContext() && !executionContext()->act iveDOMObjectsAreStopped(); 647 return m_status == Loading && executionContext() && !executionContext()->act iveDOMObjectsAreStopped();
648 } 648 }
649 649
650 } // namespace blink 650 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698