OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 virtual void detachDevTools() OVERRIDE; | 105 virtual void detachDevTools() OVERRIDE; |
106 virtual void dispatchDevToolsMessage(const WebString&) OVERRIDE; | 106 virtual void dispatchDevToolsMessage(const WebString&) OVERRIDE; |
107 | 107 |
108 private: | 108 private: |
109 class Loader; | 109 class Loader; |
110 | 110 |
111 virtual ~WebSharedWorkerImpl(); | 111 virtual ~WebSharedWorkerImpl(); |
112 | 112 |
113 WebSharedWorkerClient* client() { return m_client->get(); } | 113 WebSharedWorkerClient* client() { return m_client->get(); } |
114 | 114 |
115 void setWorkerThread(PassRefPtr<WebCore::WorkerThread> thread) { m_workerThr
ead = thread; } | 115 void setWorkerThread(PassRefPtrWillBeRawPtr<WebCore::WorkerThread> thread) {
m_workerThread = thread; } |
116 WebCore::WorkerThread* workerThread() { return m_workerThread.get(); } | 116 WebCore::WorkerThread* workerThread() { return m_workerThread.get(); } |
117 | 117 |
118 // Shuts down the worker thread. | 118 // Shuts down the worker thread. |
119 void stopWorkerThread(); | 119 void stopWorkerThread(); |
120 | 120 |
121 // Creates the shadow loader used for worker network requests. | 121 // Creates the shadow loader used for worker network requests. |
122 void initializeLoader(const WebURL&); | 122 void initializeLoader(const WebURL&); |
123 | 123 |
124 void didReceiveScriptLoaderResponse(); | 124 void didReceiveScriptLoaderResponse(); |
125 void onScriptLoaderFinished(); | 125 void onScriptLoaderFinished(); |
126 | 126 |
127 static void connectTask(WebCore::ExecutionContext*, PassOwnPtr<WebMessagePor
tChannel>); | 127 static void connectTask(WebCore::ExecutionContext*, PassOwnPtr<WebMessagePor
tChannel>); |
128 // Tasks that are run on the main thread. | 128 // Tasks that are run on the main thread. |
129 void workerGlobalScopeClosedOnMainThread(); | 129 void workerGlobalScopeClosedOnMainThread(); |
130 void workerGlobalScopeDestroyedOnMainThread(); | 130 void workerGlobalScopeDestroyedOnMainThread(); |
131 | 131 |
132 // 'shadow page' - created to proxy loading requests from the worker. | 132 // 'shadow page' - created to proxy loading requests from the worker. |
133 RefPtr<WebCore::ExecutionContext> m_loadingDocument; | 133 RefPtr<WebCore::ExecutionContext> m_loadingDocument; |
134 WebView* m_webView; | 134 WebView* m_webView; |
135 WebFrame* m_mainFrame; | 135 WebFrame* m_mainFrame; |
136 bool m_askedToTerminate; | 136 bool m_askedToTerminate; |
137 | 137 |
138 RefPtr<WebCore::WorkerThread> m_workerThread; | 138 RefPtrWillBePersistent<WebCore::WorkerThread> m_workerThread; |
139 | 139 |
140 // This one's initialized and bound to the main thread. | 140 // This one's initialized and bound to the main thread. |
141 RefPtr<WeakReference<WebSharedWorkerClient> > m_client; | 141 RefPtr<WeakReference<WebSharedWorkerClient> > m_client; |
142 | 142 |
143 // Usually WeakPtr is created by WeakPtrFactory exposed by Client | 143 // Usually WeakPtr is created by WeakPtrFactory exposed by Client |
144 // class itself, but here it's implemented by Chrome so we create | 144 // class itself, but here it's implemented by Chrome so we create |
145 // our own WeakPtr. | 145 // our own WeakPtr. |
146 WeakPtr<WebSharedWorkerClient> m_clientWeakPtr; | 146 WeakPtr<WebSharedWorkerClient> m_clientWeakPtr; |
147 | 147 |
148 bool m_pauseWorkerContextOnStart; | 148 bool m_pauseWorkerContextOnStart; |
149 bool m_attachDevToolsOnStart; | 149 bool m_attachDevToolsOnStart; |
150 | 150 |
151 // Kept around only while main script loading is ongoing. | 151 // Kept around only while main script loading is ongoing. |
152 OwnPtr<Loader> m_mainScriptLoader; | 152 OwnPtr<Loader> m_mainScriptLoader; |
153 WebURL m_url; | 153 WebURL m_url; |
154 WebString m_name; | 154 WebString m_name; |
155 WebString m_contentSecurityPolicy; | 155 WebString m_contentSecurityPolicy; |
156 WebContentSecurityPolicyType m_policyType; | 156 WebContentSecurityPolicyType m_policyType; |
157 }; | 157 }; |
158 | 158 |
159 } // namespace blink | 159 } // namespace blink |
160 | 160 |
161 #endif | 161 #endif |
OLD | NEW |