OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
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 29 matching lines...) Expand all Loading... |
40 class ScriptSourceCode; | 40 class ScriptSourceCode; |
41 | 41 |
42 // A container for an external script which may be loaded and executed. | 42 // A container for an external script which may be loaded and executed. |
43 // | 43 // |
44 // TODO(kochi): The comment below is from pre-oilpan age and may not be correct
now. | 44 // TODO(kochi): The comment below is from pre-oilpan age and may not be correct
now. |
45 // A RefPtr alone does not prevent the underlying Resource | 45 // A RefPtr alone does not prevent the underlying Resource |
46 // from purging its data buffer. This class holds a dummy client open for its | 46 // from purging its data buffer. This class holds a dummy client open for its |
47 // lifetime in order to guarantee that the data buffer will not be purged. | 47 // lifetime in order to guarantee that the data buffer will not be purged. |
48 class CORE_EXPORT PendingScript final : public GarbageCollectedFinalized<Pending
Script>, public ResourceOwner<ScriptResource> { | 48 class CORE_EXPORT PendingScript final : public GarbageCollectedFinalized<Pending
Script>, public ResourceOwner<ScriptResource> { |
49 USING_GARBAGE_COLLECTED_MIXIN(PendingScript); | 49 USING_GARBAGE_COLLECTED_MIXIN(PendingScript); |
| 50 USING_PRE_FINALIZER(PendingScript, dispose); |
50 WTF_MAKE_NONCOPYABLE(PendingScript); | 51 WTF_MAKE_NONCOPYABLE(PendingScript); |
51 public: | 52 public: |
52 static PendingScript* create(Element*, ScriptResource*); | 53 static PendingScript* create(Element*, ScriptResource*); |
53 ~PendingScript() override; | 54 ~PendingScript() override; |
54 | 55 |
55 TextPosition startingPosition() const { return m_startingPosition; } | 56 TextPosition startingPosition() const { return m_startingPosition; } |
56 void setStartingPosition(const TextPosition& position) { m_startingPosition
= position; } | 57 void setStartingPosition(const TextPosition& position) { m_startingPosition
= position; } |
57 void markParserBlockingLoadStartTime(); | 58 void markParserBlockingLoadStartTime(); |
58 // Returns the time the load of this script started blocking the parser, or | 59 // Returns the time the load of this script started blocking the parser, or |
59 // zero if this script hasn't yet blocked the parser, in | 60 // zero if this script hasn't yet blocked the parser, in |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 bool m_integrityFailure; | 95 bool m_integrityFailure; |
95 double m_parserBlockingLoadStartTime; | 96 double m_parserBlockingLoadStartTime; |
96 | 97 |
97 Member<ScriptStreamer> m_streamer; | 98 Member<ScriptStreamer> m_streamer; |
98 Member<ScriptResourceClient> m_client; | 99 Member<ScriptResourceClient> m_client; |
99 }; | 100 }; |
100 | 101 |
101 } // namespace blink | 102 } // namespace blink |
102 | 103 |
103 #endif // PendingScript_h | 104 #endif // PendingScript_h |
OLD | NEW |