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

Side by Side Diff: content/renderer/gpu/compositor_external_begin_frame_source.cc

Issue 2918083003: Replace deprecated base::NonThreadSafe in /content/renderer/gpu in favor of ThreadChecker. (Closed)
Patch Set: ThreadChecker Created 3 years, 6 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
« no previous file with comments | « content/renderer/gpu/compositor_external_begin_frame_source.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "content/renderer/gpu/compositor_external_begin_frame_source.h" 5 #include "content/renderer/gpu/compositor_external_begin_frame_source.h"
6 6
7 #include "content/common/view_messages.h" 7 #include "content/common/view_messages.h"
8 #include "ipc/ipc_sync_channel.h" 8 #include "ipc/ipc_sync_channel.h"
9 #include "ipc/ipc_sync_message_filter.h" 9 #include "ipc/ipc_sync_message_filter.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 CompositorExternalBeginFrameSource::CompositorExternalBeginFrameSource( 13 CompositorExternalBeginFrameSource::CompositorExternalBeginFrameSource(
14 CompositorForwardingMessageFilter* filter, 14 CompositorForwardingMessageFilter* filter,
15 IPC::SyncMessageFilter* sync_message_filter, 15 IPC::SyncMessageFilter* sync_message_filter,
16 int routing_id) 16 int routing_id)
17 : external_begin_frame_source_(this), 17 : external_begin_frame_source_(this),
18 begin_frame_source_filter_(filter), 18 begin_frame_source_filter_(filter),
19 message_sender_(sync_message_filter), 19 message_sender_(sync_message_filter),
20 routing_id_(routing_id) { 20 routing_id_(routing_id) {
21 DCHECK(begin_frame_source_filter_); 21 DCHECK(begin_frame_source_filter_);
22 DCHECK(message_sender_); 22 DCHECK(message_sender_);
23 DetachFromThread(); 23 DETACH_FROM_THREAD(thread_checker_);
24 } 24 }
25 25
26 CompositorExternalBeginFrameSource::~CompositorExternalBeginFrameSource() { 26 CompositorExternalBeginFrameSource::~CompositorExternalBeginFrameSource() {
27 DCHECK(CalledOnValidThread()); 27 DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
28 if (begin_frame_source_proxy_) { 28 if (begin_frame_source_proxy_) {
29 begin_frame_source_proxy_->ClearBeginFrameSource(); 29 begin_frame_source_proxy_->ClearBeginFrameSource();
30 begin_frame_source_filter_->RemoveHandlerOnCompositorThread( 30 begin_frame_source_filter_->RemoveHandlerOnCompositorThread(
31 routing_id_, 31 routing_id_,
32 begin_frame_source_filter_handler_); 32 begin_frame_source_filter_handler_);
33 } 33 }
34 } 34 }
35 35
36 void CompositorExternalBeginFrameSource::AddObserver( 36 void CompositorExternalBeginFrameSource::AddObserver(
37 cc::BeginFrameObserver* obs) { 37 cc::BeginFrameObserver* obs) {
38 DCHECK(CalledOnValidThread()); 38 DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
39 39
40 if (!begin_frame_source_proxy_) { 40 if (!begin_frame_source_proxy_) {
41 begin_frame_source_proxy_ = 41 begin_frame_source_proxy_ =
42 new CompositorExternalBeginFrameSourceProxy(this); 42 new CompositorExternalBeginFrameSourceProxy(this);
43 begin_frame_source_filter_handler_ = 43 begin_frame_source_filter_handler_ =
44 base::Bind(&CompositorExternalBeginFrameSourceProxy::OnMessageReceived, 44 base::Bind(&CompositorExternalBeginFrameSourceProxy::OnMessageReceived,
45 begin_frame_source_proxy_); 45 begin_frame_source_proxy_);
46 begin_frame_source_filter_->AddHandlerOnCompositorThread( 46 begin_frame_source_filter_->AddHandlerOnCompositorThread(
47 routing_id_, begin_frame_source_filter_handler_); 47 routing_id_, begin_frame_source_filter_handler_);
48 } 48 }
(...skipping 15 matching lines...) Expand all
64 return true; 64 return true;
65 } 65 }
66 66
67 void CompositorExternalBeginFrameSource::OnNeedsBeginFrames( 67 void CompositorExternalBeginFrameSource::OnNeedsBeginFrames(
68 bool needs_begin_frames) { 68 bool needs_begin_frames) {
69 Send(new ViewHostMsg_SetNeedsBeginFrames(routing_id_, needs_begin_frames)); 69 Send(new ViewHostMsg_SetNeedsBeginFrames(routing_id_, needs_begin_frames));
70 } 70 }
71 71
72 void CompositorExternalBeginFrameSource::OnMessageReceived( 72 void CompositorExternalBeginFrameSource::OnMessageReceived(
73 const IPC::Message& message) { 73 const IPC::Message& message) {
74 DCHECK(CalledOnValidThread()); 74 DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
75 DCHECK(begin_frame_source_proxy_); 75 DCHECK(begin_frame_source_proxy_);
76 IPC_BEGIN_MESSAGE_MAP(CompositorExternalBeginFrameSource, message) 76 IPC_BEGIN_MESSAGE_MAP(CompositorExternalBeginFrameSource, message)
77 IPC_MESSAGE_HANDLER(ViewMsg_SetBeginFramePaused, 77 IPC_MESSAGE_HANDLER(ViewMsg_SetBeginFramePaused,
78 OnSetBeginFrameSourcePaused) 78 OnSetBeginFrameSourcePaused)
79 IPC_MESSAGE_HANDLER(ViewMsg_BeginFrame, OnBeginFrame) 79 IPC_MESSAGE_HANDLER(ViewMsg_BeginFrame, OnBeginFrame)
80 IPC_END_MESSAGE_MAP() 80 IPC_END_MESSAGE_MAP()
81 } 81 }
82 82
83 void CompositorExternalBeginFrameSource::OnSetBeginFrameSourcePaused( 83 void CompositorExternalBeginFrameSource::OnSetBeginFrameSourcePaused(
84 bool paused) { 84 bool paused) {
85 external_begin_frame_source_.OnSetBeginFrameSourcePaused(paused); 85 external_begin_frame_source_.OnSetBeginFrameSourcePaused(paused);
86 } 86 }
87 87
88 void CompositorExternalBeginFrameSource::OnBeginFrame( 88 void CompositorExternalBeginFrameSource::OnBeginFrame(
89 const cc::BeginFrameArgs& args) { 89 const cc::BeginFrameArgs& args) {
90 external_begin_frame_source_.OnBeginFrame(args); 90 external_begin_frame_source_.OnBeginFrame(args);
91 } 91 }
92 92
93 bool CompositorExternalBeginFrameSource::Send(IPC::Message* message) { 93 bool CompositorExternalBeginFrameSource::Send(IPC::Message* message) {
94 return message_sender_->Send(message); 94 return message_sender_->Send(message);
95 } 95 }
96 96
97 } // namespace content 97 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/gpu/compositor_external_begin_frame_source.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698