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

Side by Side Diff: content/renderer/render_thread_impl.h

Issue 583043005: Pending tasks in a message loop should be deleted before shutting down Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_RENDERER_RENDER_THREAD_IMPL_H_ 5 #ifndef CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ 6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 // The routing IDs correspond to RenderView instances. 114 // The routing IDs correspond to RenderView instances.
115 class CONTENT_EXPORT RenderThreadImpl : public RenderThread, 115 class CONTENT_EXPORT RenderThreadImpl : public RenderThread,
116 public ChildThread, 116 public ChildThread,
117 public GpuChannelHostFactory { 117 public GpuChannelHostFactory {
118 public: 118 public:
119 static RenderThreadImpl* current(); 119 static RenderThreadImpl* current();
120 120
121 RenderThreadImpl(); 121 RenderThreadImpl();
122 // Constructor that's used when running in single process mode. 122 // Constructor that's used when running in single process mode.
123 explicit RenderThreadImpl(const std::string& channel_name); 123 explicit RenderThreadImpl(const std::string& channel_name);
124 // Constructor that's used in RendererMain.
125 explicit RenderThreadImpl(scoped_ptr<base::MessageLoop> main_message_loop);
124 ~RenderThreadImpl() override; 126 ~RenderThreadImpl() override;
125 void Shutdown() override; 127 void Shutdown() override;
126 128
127 // When initializing WebKit, ensure that any schemes needed for the content 129 // When initializing WebKit, ensure that any schemes needed for the content
128 // module are registered properly. Static to allow sharing with tests. 130 // module are registered properly. Static to allow sharing with tests.
129 static void RegisterSchemes(); 131 static void RegisterSchemes();
130 132
131 // Notify V8 that the date/time configuration of the system might have 133 // Notify V8 that the date/time configuration of the system might have
132 // changed. 134 // changed.
133 static void NotifyTimezoneChange(); 135 static void NotifyTimezoneChange();
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 // Timer that periodically calls IdleHandler. 520 // Timer that periodically calls IdleHandler.
519 base::RepeatingTimer<RenderThreadImpl> idle_timer_; 521 base::RepeatingTimer<RenderThreadImpl> idle_timer_;
520 522
521 // The channel from the renderer process to the GPU process. 523 // The channel from the renderer process to the GPU process.
522 scoped_refptr<GpuChannelHost> gpu_channel_; 524 scoped_refptr<GpuChannelHost> gpu_channel_;
523 525
524 // Cache of variables that are needed on the compositor thread by 526 // Cache of variables that are needed on the compositor thread by
525 // GpuChannelHostFactory methods. 527 // GpuChannelHostFactory methods.
526 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; 528 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_;
527 529
530 // The message loop of the renderer main thread.
531 // This message loop should be destructed before the RenderThreadImpl
532 // shuts down Blink.
533 scoped_ptr<base::MessageLoop> main_message_loop_;
534
528 // A lazily initiated thread on which file operations are run. 535 // A lazily initiated thread on which file operations are run.
529 scoped_ptr<base::Thread> file_thread_; 536 scoped_ptr<base::Thread> file_thread_;
530 537
531 // May be null if overridden by ContentRendererClient. 538 // May be null if overridden by ContentRendererClient.
532 scoped_ptr<base::Thread> compositor_thread_; 539 scoped_ptr<base::Thread> compositor_thread_;
533 540
534 // Thread for running multimedia operations (e.g., video decoding). 541 // Thread for running multimedia operations (e.g., video decoding).
535 scoped_ptr<base::Thread> media_thread_; 542 scoped_ptr<base::Thread> media_thread_;
536 543
537 // Will point to appropriate MessageLoopProxy after initialization, 544 // Will point to appropriate MessageLoopProxy after initialization,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 bool is_one_copy_enabled_; 583 bool is_one_copy_enabled_;
577 584
578 std::map<int, mojo::MessagePipeHandle> pending_render_frame_connects_; 585 std::map<int, mojo::MessagePipeHandle> pending_render_frame_connects_;
579 586
580 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); 587 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl);
581 }; 588 };
582 589
583 } // namespace content 590 } // namespace content
584 591
585 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ 592 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
OLDNEW
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698