OLD | NEW |
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 met: | 5 * modification, are permitted provided that the following conditions are met: |
6 * | 6 * |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 30 matching lines...) Expand all Loading... |
41 #include "core/frame/FrameView.h" | 41 #include "core/frame/FrameView.h" |
42 #include "core/frame/LocalFrame.h" | 42 #include "core/frame/LocalFrame.h" |
43 #include "core/rendering/style/StyleInheritedData.h" | 43 #include "core/rendering/style/StyleInheritedData.h" |
44 #include "public/platform/Platform.h" | 44 #include "public/platform/Platform.h" |
45 | 45 |
46 namespace blink { | 46 namespace blink { |
47 | 47 |
48 static const int defaultFontSize = 10; | 48 static const int defaultFontSize = 10; |
49 static const char defaultFontFamily[] = "sans-serif"; | 49 static const char defaultFontFamily[] = "sans-serif"; |
50 | 50 |
51 class LoadFontPromiseResolver FINAL : public FontFace::LoadFontCallback { | 51 class LoadFontPromiseResolver final : public FontFace::LoadFontCallback { |
52 public: | 52 public: |
53 static PassRefPtrWillBeRawPtr<LoadFontPromiseResolver> create(FontFaceArray
faces, ScriptState* scriptState) | 53 static PassRefPtrWillBeRawPtr<LoadFontPromiseResolver> create(FontFaceArray
faces, ScriptState* scriptState) |
54 { | 54 { |
55 return adoptRefWillBeNoop(new LoadFontPromiseResolver(faces, scriptState
)); | 55 return adoptRefWillBeNoop(new LoadFontPromiseResolver(faces, scriptState
)); |
56 } | 56 } |
57 | 57 |
58 void loadFonts(ExecutionContext*); | 58 void loadFonts(ExecutionContext*); |
59 ScriptPromise promise() { return m_resolver->promise(); } | 59 ScriptPromise promise() { return m_resolver->promise(); } |
60 | 60 |
61 virtual void notifyLoaded(FontFace*) OVERRIDE; | 61 virtual void notifyLoaded(FontFace*) override; |
62 virtual void notifyError(FontFace*) OVERRIDE; | 62 virtual void notifyError(FontFace*) override; |
63 | 63 |
64 virtual void trace(Visitor*) OVERRIDE; | 64 virtual void trace(Visitor*) override; |
65 | 65 |
66 private: | 66 private: |
67 LoadFontPromiseResolver(FontFaceArray faces, ScriptState* scriptState) | 67 LoadFontPromiseResolver(FontFaceArray faces, ScriptState* scriptState) |
68 : m_numLoading(faces.size()) | 68 : m_numLoading(faces.size()) |
69 , m_errorOccured(false) | 69 , m_errorOccured(false) |
70 , m_resolver(ScriptPromiseResolver::create(scriptState)) | 70 , m_resolver(ScriptPromiseResolver::create(scriptState)) |
71 { | 71 { |
72 m_fontFaces.swap(faces); | 72 m_fontFaces.swap(faces); |
73 } | 73 } |
74 | 74 |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 visitor->trace(m_loadingFonts); | 586 visitor->trace(m_loadingFonts); |
587 visitor->trace(m_loadedFonts); | 587 visitor->trace(m_loadedFonts); |
588 visitor->trace(m_failedFonts); | 588 visitor->trace(m_failedFonts); |
589 visitor->trace(m_nonCSSConnectedFaces); | 589 visitor->trace(m_nonCSSConnectedFaces); |
590 DocumentSupplement::trace(visitor); | 590 DocumentSupplement::trace(visitor); |
591 EventTargetWithInlineData::trace(visitor); | 591 EventTargetWithInlineData::trace(visitor); |
592 } | 592 } |
593 #endif | 593 #endif |
594 | 594 |
595 } // namespace blink | 595 } // namespace blink |
OLD | NEW |