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

Side by Side Diff: content/child/blink_platform_impl.h

Issue 1589463002: compositor worker: Use a WebThread for the compositor thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self-nits Created 4 years, 11 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ 5 #ifndef CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_
6 #define CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ 6 #define CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 blink::WebString domCodeStringFromEnum(int dom_code) override; 185 blink::WebString domCodeStringFromEnum(int dom_code) override;
186 int domEnumFromCodeString(const blink::WebString& codeString) override; 186 int domEnumFromCodeString(const blink::WebString& codeString) override;
187 blink::WebString domKeyStringFromEnum(int dom_key) override; 187 blink::WebString domKeyStringFromEnum(int dom_key) override;
188 int domKeyEnumFromString(const blink::WebString& key_string) override; 188 int domKeyEnumFromString(const blink::WebString& key_string) override;
189 189
190 scoped_ptr<scheduler::WebThreadBase> createThreadWithOptions( 190 scoped_ptr<scheduler::WebThreadBase> createThreadWithOptions(
191 const char* name, 191 const char* name,
192 base::Thread::Options); 192 base::Thread::Options);
193 193
194 // This class does *not* own |compositor_thread|. It is the responsibility of 194 // This class does *not* own the compositor thread. It is the responsibility
195 // the caller to ensure that the compositor thread is cleared before it is 195 // of the caller to ensure that the compositor thread is cleared before it is
196 // destructed. 196 // destructed.
197 void set_compositor_thread(scheduler::WebThreadBase* compositor_thread) { 197 scoped_ptr<scheduler::WebThreadBase> createCompositorThread();
198 compositor_thread_ = compositor_thread; 198 void reset_compositor_thread() { compositor_thread_ = nullptr; }
199 }
200 199
201 private: 200 private:
202 void InternalInit(); 201 void InternalInit();
202 void WaitUntilWebThreadTLSUpdate(scheduler::WebThreadBase* thread);
203 void UpdateWebThreadTLS(blink::WebThread* thread, base::WaitableEvent* event); 203 void UpdateWebThreadTLS(blink::WebThread* thread, base::WaitableEvent* event);
204 204
205 bool IsMainThread() const; 205 bool IsMainThread() const;
206 206
207 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; 207 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
208 WebThemeEngineImpl native_theme_engine_; 208 WebThemeEngineImpl native_theme_engine_;
209 WebFallbackThemeEngineImpl fallback_theme_engine_; 209 WebFallbackThemeEngineImpl fallback_theme_engine_;
210 base::ThreadLocalStorage::Slot current_thread_slot_; 210 base::ThreadLocalStorage::Slot current_thread_slot_;
211 webcrypto::WebCryptoImpl web_crypto_; 211 webcrypto::WebCryptoImpl web_crypto_;
212 scoped_ptr<WebGeofencingProviderImpl> geofencing_provider_; 212 scoped_ptr<WebGeofencingProviderImpl> geofencing_provider_;
213 base::ScopedPtrHashMap<blink::WebMemoryDumpProvider*, 213 base::ScopedPtrHashMap<blink::WebMemoryDumpProvider*,
214 scoped_ptr<WebMemoryDumpProviderAdapter>> 214 scoped_ptr<WebMemoryDumpProviderAdapter>>
215 memory_dump_providers_; 215 memory_dump_providers_;
216 base::ScopedPtrHashMap<blink::Platform::TraceLogEnabledStateObserver*, 216 base::ScopedPtrHashMap<blink::Platform::TraceLogEnabledStateObserver*,
217 scoped_ptr<TraceLogObserverAdapter>> 217 scoped_ptr<TraceLogObserverAdapter>>
218 trace_log_observers_; 218 trace_log_observers_;
219 219
220 scoped_refptr<ThreadSafeSender> thread_safe_sender_; 220 scoped_refptr<ThreadSafeSender> thread_safe_sender_;
221 scoped_refptr<NotificationDispatcher> notification_dispatcher_; 221 scoped_refptr<NotificationDispatcher> notification_dispatcher_;
222 scoped_refptr<PushDispatcher> push_dispatcher_; 222 scoped_refptr<PushDispatcher> push_dispatcher_;
223 scoped_ptr<PermissionDispatcher> permission_client_; 223 scoped_ptr<PermissionDispatcher> permission_client_;
224 scoped_ptr<BackgroundSyncProvider> main_thread_sync_provider_; 224 scoped_ptr<BackgroundSyncProvider> main_thread_sync_provider_;
225 225
226 scheduler::WebThreadBase* compositor_thread_; 226 scheduler::WebThreadBase* compositor_thread_;
227 }; 227 };
228 228
229 } // namespace content 229 } // namespace content
230 230
231 #endif // CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_ 231 #endif // CONTENT_CHILD_BLINK_PLATFORM_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698