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

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

Issue 2616093003: Make CSSParserContext be garbage collected. (Closed)
Patch Set: comments 1 Created 3 years, 11 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 #include "core/frame/UseCounter.h" 59 #include "core/frame/UseCounter.h"
60 #include "platform/FontFamilyNames.h" 60 #include "platform/FontFamilyNames.h"
61 #include "platform/Histogram.h" 61 #include "platform/Histogram.h"
62 #include "platform/SharedBuffer.h" 62 #include "platform/SharedBuffer.h"
63 63
64 namespace blink { 64 namespace blink {
65 65
66 static const CSSValue* parseCSSValue(const Document* document, 66 static const CSSValue* parseCSSValue(const Document* document,
67 const String& value, 67 const String& value,
68 CSSPropertyID propertyID) { 68 CSSPropertyID propertyID) {
69 CSSParserContext context(*document, UseCounter::getFrom(document)); 69 CSSParserContext* context = new CSSParserContext(*document);
70 context->setUseCounter(UseCounter::getFrom(document));
haraken 2017/01/12 04:51:13 It looks not really nice that we have to create CS
Bret 2017/01/13 02:15:28 Yes, I'm wasn't entirely happy with this. I change
70 return CSSParser::parseFontFaceDescriptor(propertyID, value, context); 71 return CSSParser::parseFontFaceDescriptor(propertyID, value, context);
71 } 72 }
72 73
73 FontFace* FontFace::create(ExecutionContext* context, 74 FontFace* FontFace::create(ExecutionContext* context,
74 const AtomicString& family, 75 const AtomicString& family,
75 StringOrArrayBufferOrArrayBufferView& source, 76 StringOrArrayBufferOrArrayBufferView& source,
76 const FontFaceDescriptors& descriptors) { 77 const FontFaceDescriptors& descriptors) {
77 if (source.isString()) 78 if (source.isString())
78 return create(context, family, source.getAsString(), descriptors); 79 return create(context, family, source.getAsString(), descriptors);
79 if (source.isArrayBuffer()) 80 if (source.isArrayBuffer())
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 641
641 bool FontFace::hadBlankText() const { 642 bool FontFace::hadBlankText() const {
642 return m_cssFontFace->hadBlankText(); 643 return m_cssFontFace->hadBlankText();
643 } 644 }
644 645
645 bool FontFace::hasPendingActivity() const { 646 bool FontFace::hasPendingActivity() const {
646 return m_status == Loading && getExecutionContext(); 647 return m_status == Loading && getExecutionContext();
647 } 648 }
648 649
649 } // namespace blink 650 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698