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

Side by Side Diff: Source/core/workers/WorkerMessagingProxy.h

Issue 1257653007: Oilpan: Remove raw pointer to InProcessWorkerBase from WorkerMessagingProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 class ExecutionContext; 45 class ExecutionContext;
46 class InProcessWorkerBase; 46 class InProcessWorkerBase;
47 class WorkerClients; 47 class WorkerClients;
48 class WorkerInspectorProxy; 48 class WorkerInspectorProxy;
49 49
50 class CORE_EXPORT WorkerMessagingProxy 50 class CORE_EXPORT WorkerMessagingProxy
51 : public WorkerGlobalScopeProxy 51 : public WorkerGlobalScopeProxy
52 , private WorkerLoaderProxyProvider { 52 , private WorkerLoaderProxyProvider {
53 WTF_MAKE_NONCOPYABLE(WorkerMessagingProxy); 53 WTF_MAKE_NONCOPYABLE(WorkerMessagingProxy);
54 public: 54 public:
55 DECLARE_VIRTUAL_TRACE();
56
55 // Implementations of WorkerGlobalScopeProxy. 57 // Implementations of WorkerGlobalScopeProxy.
56 // (Only use these methods in the worker object thread.) 58 // (Only use these methods in the worker object thread.)
57 void startWorkerGlobalScope(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode) override; 59 void startWorkerGlobalScope(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode) override;
58 void terminateWorkerGlobalScope() override; 60 void terminateWorkerGlobalScope() override;
59 void postMessageToWorkerGlobalScope(PassRefPtr<SerializedScriptValue>, PassO wnPtr<MessagePortChannelArray>) override; 61 void postMessageToWorkerGlobalScope(PassRefPtr<SerializedScriptValue>, PassO wnPtr<MessagePortChannelArray>) override;
60 bool hasPendingActivity() const override; 62 bool hasPendingActivity() const override;
61 void workerObjectDestroyed() override; 63 void workerObjectDestroyed() override;
62 64
63 // These methods come from worker context thread via WorkerObjectProxy 65 // These methods come from worker context thread via WorkerObjectProxy
64 // and are called on the worker object thread (e.g. main thread). 66 // and are called on the worker object thread (e.g. main thread).
65 void postMessageToWorkerObject(PassRefPtr<SerializedScriptValue>, PassOwnPtr <MessagePortChannelArray>); 67 void postMessageToWorkerObject(PassRefPtr<SerializedScriptValue>, PassOwnPtr <MessagePortChannelArray>);
66 void reportException(const String& errorMessage, int lineNumber, int columnN umber, const String& sourceURL, int exceptionId); 68 void reportException(const String& errorMessage, int lineNumber, int columnN umber, const String& sourceURL, int exceptionId);
67 void reportConsoleMessage(MessageSource, MessageLevel, const String& message , int lineNumber, const String& sourceURL); 69 void reportConsoleMessage(MessageSource, MessageLevel, const String& message , int lineNumber, const String& sourceURL);
68 void postMessageToPageInspector(const String&); 70 void postMessageToPageInspector(const String&);
69 void postWorkerConsoleAgentEnabled(); 71 void postWorkerConsoleAgentEnabled();
70 WorkerInspectorProxy* workerInspectorProxy(); 72 WorkerInspectorProxy* workerInspectorProxy();
71 void confirmMessageFromWorkerObject(bool hasPendingActivity); 73 void confirmMessageFromWorkerObject(bool hasPendingActivity);
72 void reportPendingActivity(bool hasPendingActivity); 74 void reportPendingActivity(bool hasPendingActivity);
73 void workerGlobalScopeClosed(); 75 void workerGlobalScopeClosed();
74 void workerThreadTerminated(); 76 void workerThreadTerminated();
75 77
76 void workerThreadCreated(PassRefPtr<WorkerThread>); 78 void workerThreadCreated(PassRefPtr<WorkerThread>);
77 79
80 void clearWeakMembers(Visitor*);
81
78 protected: 82 protected:
79 WorkerMessagingProxy(InProcessWorkerBase*, PassOwnPtrWillBeRawPtr<WorkerClie nts>); 83 WorkerMessagingProxy(InProcessWorkerBase*, PassOwnPtrWillBeRawPtr<WorkerClie nts>);
80 ~WorkerMessagingProxy() override; 84 ~WorkerMessagingProxy() override;
81 85
82 virtual PassRefPtr<WorkerThread> createWorkerThread(double originTime) = 0; 86 virtual PassRefPtr<WorkerThread> createWorkerThread(double originTime) = 0;
83 87
84 PassRefPtr<WorkerLoaderProxy> loaderProxy() { return m_loaderProxy; } 88 PassRefPtr<WorkerLoaderProxy> loaderProxy() { return m_loaderProxy; }
85 WorkerObjectProxy& workerObjectProxy() { return *m_workerObjectProxy.get(); } 89 WorkerObjectProxy& workerObjectProxy() { return *m_workerObjectProxy.get(); }
86 90
87 private: 91 private:
88 void workerObjectDestroyedInternal(); 92 void workerObjectDestroyedInternal();
89 void terminateInternally(); 93 void terminateInternally();
90 94
91 // WorkerLoaderProxyProvider 95 // WorkerLoaderProxyProvider
92 // These methods are called on different threads to schedule loading 96 // These methods are called on different threads to schedule loading
93 // requests and to send callbacks back to WorkerGlobalScope. 97 // requests and to send callbacks back to WorkerGlobalScope.
94 void postTaskToLoader(PassOwnPtr<ExecutionContextTask>) override; 98 void postTaskToLoader(PassOwnPtr<ExecutionContextTask>) override;
95 bool postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionContextTask>) override; 99 bool postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionContextTask>) override;
96 100
97 RefPtrWillBePersistent<ExecutionContext> m_executionContext; 101 RefPtrWillBeMember<ExecutionContext> m_executionContext;
98 OwnPtr<WorkerObjectProxy> m_workerObjectProxy; 102 OwnPtr<WorkerObjectProxy> m_workerObjectProxy;
99 InProcessWorkerBase* m_workerObject; 103 RawPtrWillBeWeakMember<InProcessWorkerBase> m_workerObject;
100 bool m_mayBeDestroyed; 104 bool m_mayBeDestroyed;
101 RefPtr<WorkerThread> m_workerThread; 105 RefPtr<WorkerThread> m_workerThread;
102 106
103 unsigned m_unconfirmedMessageCount; // Unconfirmed messages from worker obje ct to worker thread. 107 unsigned m_unconfirmedMessageCount; // Unconfirmed messages from worker obje ct to worker thread.
104 bool m_workerThreadHadPendingActivity; // The latest confirmation from worke r thread reported that it was still active. 108 bool m_workerThreadHadPendingActivity; // The latest confirmation from worke r thread reported that it was still active.
105 109
106 bool m_askedToTerminate; 110 bool m_askedToTerminate;
107 111
108 Vector<OwnPtr<ExecutionContextTask>> m_queuedEarlyTasks; // Tasks are queued here until there's a thread object created. 112 Vector<OwnPtr<ExecutionContextTask>> m_queuedEarlyTasks; // Tasks are queued here until there's a thread object created.
109 OwnPtr<WorkerInspectorProxy> m_workerInspectorProxy; 113 OwnPtr<WorkerInspectorProxy> m_workerInspectorProxy;
110 114
111 OwnPtrWillBePersistent<WorkerClients> m_workerClients; 115 OwnPtrWillBeMember<WorkerClients> m_workerClients;
112 116
113 RefPtr<WorkerLoaderProxy> m_loaderProxy; 117 RefPtr<WorkerLoaderProxy> m_loaderProxy;
118
119 #if ENABLE(OILPAN)
120 GC_PLUGIN_IGNORE("366546")
121 OwnPtr<Persistent<WorkerMessagingProxy>> m_keepAlive;
haraken 2015/07/30 11:46:31 Once https://codereview.chromium.org/1233173002/ i
122 #endif
114 }; 123 };
115 124
116 } // namespace blink 125 } // namespace blink
117 126
118 #endif // WorkerMessagingProxy_h 127 #endif // WorkerMessagingProxy_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698