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

Side by Side Diff: third_party/WebKit/Source/core/dom/PendingScript.h

Issue 2023683002: Tidy PendingScript (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove prefinalizer Created 4 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
OLDNEW
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 13 matching lines...) Expand all
24 */ 24 */
25 25
26 #ifndef PendingScript_h 26 #ifndef PendingScript_h
27 #define PendingScript_h 27 #define PendingScript_h
28 28
29 #include "bindings/core/v8/ScriptStreamer.h" 29 #include "bindings/core/v8/ScriptStreamer.h"
30 #include "core/CoreExport.h" 30 #include "core/CoreExport.h"
31 #include "core/fetch/ResourceOwner.h" 31 #include "core/fetch/ResourceOwner.h"
32 #include "core/fetch/ScriptResource.h" 32 #include "core/fetch/ScriptResource.h"
33 #include "platform/heap/Handle.h" 33 #include "platform/heap/Handle.h"
34 #include "wtf/Noncopyable.h"
34 #include "wtf/text/TextPosition.h" 35 #include "wtf/text/TextPosition.h"
35 36
36 namespace blink { 37 namespace blink {
37 38
38 class Element; 39 class Element;
39 class ScriptSourceCode; 40 class ScriptSourceCode;
40 41
41 // 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.
42 // 43 //
43 // 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.
44 // A RefPtr alone does not prevent the underlying Resource 45 // A RefPtr alone does not prevent the underlying Resource
45 // 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
46 // 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.
47 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> {
48 USING_GARBAGE_COLLECTED_MIXIN(PendingScript); 49 USING_GARBAGE_COLLECTED_MIXIN(PendingScript);
49 USING_PRE_FINALIZER(PendingScript, dispose); 50 WTF_MAKE_NONCOPYABLE(PendingScript);
50 public: 51 public:
51 static PendingScript* create(Element*, ScriptResource*); 52 static PendingScript* create(Element*, ScriptResource*);
52 ~PendingScript() override; 53 ~PendingScript() override;
53 54
54 PendingScript& operator=(const PendingScript&);
55
56 TextPosition startingPosition() const { return m_startingPosition; } 55 TextPosition startingPosition() const { return m_startingPosition; }
57 void setStartingPosition(const TextPosition& position) { m_startingPosition = position; } 56 void setStartingPosition(const TextPosition& position) { m_startingPosition = position; }
58 void markParserBlockingLoadStartTime(); 57 void markParserBlockingLoadStartTime();
59 // Returns the time the load of this script started blocking the parser, or 58 // Returns the time the load of this script started blocking the parser, or
60 // zero if this script hasn't yet blocked the parser, in 59 // zero if this script hasn't yet blocked the parser, in
61 // monotonicallyIncreasingTime. 60 // monotonicallyIncreasingTime.
62 double parserBlockingLoadStartTime() const { return m_parserBlockingLoadStar tTime; } 61 double parserBlockingLoadStartTime() const { return m_parserBlockingLoadStar tTime; }
63 62
64 void watchForLoad(ScriptResourceClient*); 63 void watchForLoad(ScriptResourceClient*);
65 void stopWatchingForLoad(); 64 void stopWatchingForLoad();
(...skipping 29 matching lines...) Expand all
95 bool m_integrityFailure; 94 bool m_integrityFailure;
96 double m_parserBlockingLoadStartTime; 95 double m_parserBlockingLoadStartTime;
97 96
98 Member<ScriptStreamer> m_streamer; 97 Member<ScriptStreamer> m_streamer;
99 ScriptResourceClient* m_client; 98 ScriptResourceClient* m_client;
100 }; 99 };
101 100
102 } // namespace blink 101 } // namespace blink
103 102
104 #endif // PendingScript_h 103 #endif // PendingScript_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698