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

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

Issue 983973004: Provide user friendly messages for OTS parsing of fonts (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase patch Created 5 years, 6 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 | « Source/core/css/FontFace.h ('k') | Source/core/css/FontLoader.cpp » ('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) 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 } 545 }
546 } 546 }
547 547
548 void FontFace::initCSSFontFace(const unsigned char* data, unsigned size) 548 void FontFace::initCSSFontFace(const unsigned char* data, unsigned size)
549 { 549 {
550 m_cssFontFace = createCSSFontFace(this, m_unicodeRange.get()); 550 m_cssFontFace = createCSSFontFace(this, m_unicodeRange.get());
551 if (m_error) 551 if (m_error)
552 return; 552 return;
553 553
554 RefPtr<SharedBuffer> buffer = SharedBuffer::create(data, size); 554 RefPtr<SharedBuffer> buffer = SharedBuffer::create(data, size);
555 OwnPtrWillBeRawPtr<BinaryDataFontFaceSource> source = adoptPtrWillBeNoop(new BinaryDataFontFaceSource(buffer.get())); 555 OwnPtrWillBeRawPtr<BinaryDataFontFaceSource> source = adoptPtrWillBeNoop(new BinaryDataFontFaceSource(buffer.get(), m_otsParseMessage));
556 if (source->isValid()) 556 if (source->isValid())
557 setLoadStatus(Loaded); 557 setLoadStatus(Loaded);
558 else 558 else
559 setError(DOMException::create(SyntaxError, "Invalid font data in ArrayBu ffer.")); 559 setError(DOMException::create(SyntaxError, "Invalid font data in ArrayBu ffer."));
560 m_cssFontFace->addSource(source.release()); 560 m_cssFontFace->addSource(source.release());
561 } 561 }
562 562
563 DEFINE_TRACE(FontFace) 563 DEFINE_TRACE(FontFace)
564 { 564 {
565 visitor->trace(m_src); 565 visitor->trace(m_src);
(...skipping 14 matching lines...) Expand all
580 { 580 {
581 return m_cssFontFace->hadBlankText(); 581 return m_cssFontFace->hadBlankText();
582 } 582 }
583 583
584 bool FontFace::hasPendingActivity() const 584 bool FontFace::hasPendingActivity() const
585 { 585 {
586 return m_status == Loading && executionContext() && !executionContext()->act iveDOMObjectsAreStopped(); 586 return m_status == Loading && executionContext() && !executionContext()->act iveDOMObjectsAreStopped();
587 } 587 }
588 588
589 } // namespace blink 589 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/FontFace.h ('k') | Source/core/css/FontLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698