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

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

Issue 2340273002: Fix FontFaceSet state getting stuck at loading (Closed)
Patch Set: Separate test case Created 4 years, 3 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 374
375 ScriptPromise FontFace::load(ScriptState* scriptState) 375 ScriptPromise FontFace::load(ScriptState* scriptState)
376 { 376 {
377 loadInternal(scriptState->getExecutionContext()); 377 loadInternal(scriptState->getExecutionContext());
378 return fontStatusPromise(scriptState); 378 return fontStatusPromise(scriptState);
379 } 379 }
380 380
381 void FontFace::loadWithCallback(LoadFontCallback* callback, ExecutionContext* co ntext) 381 void FontFace::loadWithCallback(LoadFontCallback* callback, ExecutionContext* co ntext)
382 { 382 {
383 loadInternal(context); 383 loadInternal(context);
384 addCallback(callback);
385 }
386
387 void FontFace::addCallback(LoadFontCallback* callback)
388 {
384 if (m_status == Loaded) 389 if (m_status == Loaded)
385 callback->notifyLoaded(this); 390 callback->notifyLoaded(this);
386 else if (m_status == Error) 391 else if (m_status == Error)
387 callback->notifyError(this); 392 callback->notifyError(this);
388 else 393 else
389 m_callbacks.append(callback); 394 m_callbacks.append(callback);
390 } 395 }
391 396
392 void FontFace::loadInternal(ExecutionContext* context) 397 void FontFace::loadInternal(ExecutionContext* context)
393 { 398 {
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 { 626 {
622 return m_cssFontFace->hadBlankText(); 627 return m_cssFontFace->hadBlankText();
623 } 628 }
624 629
625 bool FontFace::hasPendingActivity() const 630 bool FontFace::hasPendingActivity() const
626 { 631 {
627 return m_status == Loading && getExecutionContext() && !getExecutionContext( )->activeDOMObjectsAreStopped(); 632 return m_status == Loading && getExecutionContext() && !getExecutionContext( )->activeDOMObjectsAreStopped();
628 } 633 }
629 634
630 } // namespace blink 635 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/FontFace.h ('k') | third_party/WebKit/Source/core/css/FontFaceSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698