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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 22 matching lines...) Expand all
33 #include "wtf/Noncopyable.h" 33 #include "wtf/Noncopyable.h"
34 #include "wtf/PassOwnPtr.h" 34 #include "wtf/PassOwnPtr.h"
35 35
36 namespace blink { 36 namespace blink {
37 37
38 class CancellableTaskFactory; 38 class CancellableTaskFactory;
39 class Document; 39 class Document;
40 class ScriptLoader; 40 class ScriptLoader;
41 class WebTaskRunner; 41 class WebTaskRunner;
42 42
43 class CORE_EXPORT ScriptRunner final : public NoBaseWillBeGarbageCollectedFinali zed<ScriptRunner> { 43 class CORE_EXPORT ScriptRunner final : public GarbageCollectedFinalized<ScriptRu nner> {
44 WTF_MAKE_NONCOPYABLE(ScriptRunner); USING_FAST_MALLOC_WILL_BE_REMOVED(Script Runner); 44 WTF_MAKE_NONCOPYABLE(ScriptRunner);
45 public: 45 public:
46 static PassOwnPtrWillBeRawPtr<ScriptRunner> create(Document* document) 46 static RawPtr<ScriptRunner> create(Document* document)
47 { 47 {
48 return adoptPtrWillBeNoop(new ScriptRunner(document)); 48 return (new ScriptRunner(document));
49 } 49 }
50 ~ScriptRunner(); 50 ~ScriptRunner();
51 #if !ENABLE(OILPAN) 51 #if !ENABLE(OILPAN)
52 void dispose(); 52 void dispose();
53 #endif 53 #endif
54 54
55 enum ExecutionType { ASYNC_EXECUTION, IN_ORDER_EXECUTION }; 55 enum ExecutionType { ASYNC_EXECUTION, IN_ORDER_EXECUTION };
56 void queueScriptForExecution(ScriptLoader*, ExecutionType); 56 void queueScriptForExecution(ScriptLoader*, ExecutionType);
57 bool hasPendingScripts() const { return !m_pendingInOrderScripts.isEmpty() | | !m_pendingAsyncScripts.isEmpty(); } 57 bool hasPendingScripts() const { return !m_pendingInOrderScripts.isEmpty() | | !m_pendingAsyncScripts.isEmpty(); }
58 void suspend(); 58 void suspend();
59 void resume(); 59 void resume();
60 void notifyScriptReady(ScriptLoader*, ExecutionType); 60 void notifyScriptReady(ScriptLoader*, ExecutionType);
61 void notifyScriptLoadError(ScriptLoader*, ExecutionType); 61 void notifyScriptLoadError(ScriptLoader*, ExecutionType);
62 62
63 static void movePendingScript(Document&, Document&, ScriptLoader*); 63 static void movePendingScript(Document&, Document&, ScriptLoader*);
64 64
65 DECLARE_TRACE(); 65 DECLARE_TRACE();
66 66
67 private: 67 private:
68 class Task; 68 class Task;
69 69
70 explicit ScriptRunner(Document*); 70 explicit ScriptRunner(Document*);
71 71
72 void movePendingScript(ScriptRunner*, ScriptLoader*); 72 void movePendingScript(ScriptRunner*, ScriptLoader*);
73 bool removePendingInOrderScript(ScriptLoader*); 73 bool removePendingInOrderScript(ScriptLoader*);
74 74
75 void postTask(const WebTraceLocation&); 75 void postTask(const WebTraceLocation&);
76 76
77 bool executeTaskFromQueue(WillBeHeapDeque<RawPtrWillBeMember<ScriptLoader>>* ); 77 bool executeTaskFromQueue(HeapDeque<Member<ScriptLoader>>*);
78 78
79 void executeTask(); 79 void executeTask();
80 80
81 RawPtrWillBeMember<Document> m_document; 81 Member<Document> m_document;
82 82
83 WillBeHeapDeque<RawPtrWillBeMember<ScriptLoader>> m_pendingInOrderScripts; 83 HeapDeque<Member<ScriptLoader>> m_pendingInOrderScripts;
84 WillBeHeapHashSet<RawPtrWillBeMember<ScriptLoader>> m_pendingAsyncScripts; 84 HeapHashSet<Member<ScriptLoader>> m_pendingAsyncScripts;
85 85
86 // http://www.whatwg.org/specs/web-apps/current-work/#set-of-scripts-that-wi ll-execute-as-soon-as-possible 86 // http://www.whatwg.org/specs/web-apps/current-work/#set-of-scripts-that-wi ll-execute-as-soon-as-possible
87 WillBeHeapDeque<RawPtrWillBeMember<ScriptLoader>> m_asyncScriptsToExecuteSoo n; 87 HeapDeque<Member<ScriptLoader>> m_asyncScriptsToExecuteSoon;
88 WillBeHeapDeque<RawPtrWillBeMember<ScriptLoader>> m_inOrderScriptsToExecuteS oon; 88 HeapDeque<Member<ScriptLoader>> m_inOrderScriptsToExecuteSoon;
89 89
90 WebTaskRunner* m_taskRunner; 90 WebTaskRunner* m_taskRunner;
91 91
92 int m_numberOfInOrderScriptsWithPendingNotification; 92 int m_numberOfInOrderScriptsWithPendingNotification;
93 93
94 bool m_isSuspended; 94 bool m_isSuspended;
95 #ifndef NDEBUG 95 #ifndef NDEBUG
96 bool m_hasEverBeenSuspended; 96 bool m_hasEverBeenSuspended;
97 #endif 97 #endif
98 98
99 #if !ENABLE(OILPAN) 99 #if !ENABLE(OILPAN)
100 bool m_isDisposed; 100 bool m_isDisposed;
101 WeakPtrFactory<ScriptRunner> m_weakPointerFactoryForTasks; 101 WeakPtrFactory<ScriptRunner> m_weakPointerFactoryForTasks;
102 #endif 102 #endif
103 }; 103 };
104 104
105 } // namespace blink 105 } // namespace blink
106 106
107 #endif // ScriptRunner_h 107 #endif // ScriptRunner_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698