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

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, 2 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 (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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // The routing IDs correspond to RenderView instances. 113 // The routing IDs correspond to RenderView instances.
114 class CONTENT_EXPORT RenderThreadImpl : public RenderThread, 114 class CONTENT_EXPORT RenderThreadImpl : public RenderThread,
115 public ChildThread, 115 public ChildThread,
116 public GpuChannelHostFactory { 116 public GpuChannelHostFactory {
117 public: 117 public:
118 static RenderThreadImpl* current(); 118 static RenderThreadImpl* current();
119 119
120 RenderThreadImpl(); 120 RenderThreadImpl();
121 // Constructor that's used when running in single process mode. 121 // Constructor that's used when running in single process mode.
122 explicit RenderThreadImpl(const std::string& channel_name); 122 explicit RenderThreadImpl(const std::string& channel_name);
123 // Constructor that's used in RendererMain.
124 explicit RenderThreadImpl(scoped_ptr<base::MessageLoop> main_message_loop);
123 virtual ~RenderThreadImpl(); 125 virtual ~RenderThreadImpl();
124 virtual void Shutdown() OVERRIDE; 126 virtual void Shutdown() OVERRIDE;
125 127
126 // When initializing WebKit, ensure that any schemes needed for the content 128 // When initializing WebKit, ensure that any schemes needed for the content
127 // module are registered properly. Static to allow sharing with tests. 129 // module are registered properly. Static to allow sharing with tests.
128 static void RegisterSchemes(); 130 static void RegisterSchemes();
129 131
130 // Notify V8 that the date/time configuration of the system might have 132 // Notify V8 that the date/time configuration of the system might have
131 // changed. 133 // changed.
132 static void NotifyTimezoneChange(); 134 static void NotifyTimezoneChange();
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 // Timer that periodically calls IdleHandler. 518 // Timer that periodically calls IdleHandler.
517 base::RepeatingTimer<RenderThreadImpl> idle_timer_; 519 base::RepeatingTimer<RenderThreadImpl> idle_timer_;
518 520
519 // The channel from the renderer process to the GPU process. 521 // The channel from the renderer process to the GPU process.
520 scoped_refptr<GpuChannelHost> gpu_channel_; 522 scoped_refptr<GpuChannelHost> gpu_channel_;
521 523
522 // Cache of variables that are needed on the compositor thread by 524 // Cache of variables that are needed on the compositor thread by
523 // GpuChannelHostFactory methods. 525 // GpuChannelHostFactory methods.
524 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; 526 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_;
525 527
528 // The message loop of the renderer main thread.
529 // This message loop should be destructed before the RenderThreadImpl
530 // shuts down Blink.
531 scoped_ptr<base::MessageLoop> main_message_loop_;
532
526 // A lazily initiated thread on which file operations are run. 533 // A lazily initiated thread on which file operations are run.
527 scoped_ptr<base::Thread> file_thread_; 534 scoped_ptr<base::Thread> file_thread_;
528 535
529 // May be null if overridden by ContentRendererClient. 536 // May be null if overridden by ContentRendererClient.
530 scoped_ptr<base::Thread> compositor_thread_; 537 scoped_ptr<base::Thread> compositor_thread_;
531 538
532 // Thread for running multimedia operations (e.g., video decoding). 539 // Thread for running multimedia operations (e.g., video decoding).
533 scoped_ptr<base::Thread> media_thread_; 540 scoped_ptr<base::Thread> media_thread_;
534 541
535 // Will point to appropriate MessageLoopProxy after initialization, 542 // Will point to appropriate MessageLoopProxy after initialization,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 bool is_one_copy_enabled_; 586 bool is_one_copy_enabled_;
580 587
581 std::map<int, mojo::MessagePipeHandle> pending_render_frame_connects_; 588 std::map<int, mojo::MessagePipeHandle> pending_render_frame_connects_;
582 589
583 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); 590 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl);
584 }; 591 };
585 592
586 } // namespace content 593 } // namespace content
587 594
588 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ 595 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698