OLD | NEW |
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 #include "content/renderer/gpu/compositor_output_surface.h" | 5 #include "content/renderer/gpu/compositor_output_surface.h" |
6 | 6 |
7 #include "base/message_loop_proxy.h" | 7 #include "base/message_loop_proxy.h" |
8 #include "content/common/view_messages.h" | 8 #include "content/common/view_messages.h" |
9 #include "content/renderer/render_thread_impl.h" | 9 #include "content/renderer/render_thread_impl.h" |
10 #include "ipc/ipc_forwarding_message_filter.h" | 10 #include "ipc/ipc_forwarding_message_filter.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 } | 75 } |
76 | 76 |
77 void CompositorOutputSurface::sendFrameToParentCompositor( | 77 void CompositorOutputSurface::sendFrameToParentCompositor( |
78 const WebKit::WebCompositorFrame&) { | 78 const WebKit::WebCompositorFrame&) { |
79 DCHECK(CalledOnValidThread()); | 79 DCHECK(CalledOnValidThread()); |
80 NOTREACHED(); | 80 NOTREACHED(); |
81 } | 81 } |
82 | 82 |
83 void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) { | 83 void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) { |
84 DCHECK(CalledOnValidThread()); | 84 DCHECK(CalledOnValidThread()); |
| 85 if (!client_) |
| 86 return; |
85 IPC_BEGIN_MESSAGE_MAP(CompositorOutputSurface, message) | 87 IPC_BEGIN_MESSAGE_MAP(CompositorOutputSurface, message) |
86 IPC_MESSAGE_HANDLER(ViewMsg_UpdateVSyncParameters, OnUpdateVSyncParameters); | 88 IPC_MESSAGE_HANDLER(ViewMsg_UpdateVSyncParameters, OnUpdateVSyncParameters); |
87 IPC_END_MESSAGE_MAP() | 89 IPC_END_MESSAGE_MAP() |
88 } | 90 } |
89 | 91 |
90 void CompositorOutputSurface::OnUpdateVSyncParameters( | 92 void CompositorOutputSurface::OnUpdateVSyncParameters( |
91 base::TimeTicks timebase, | 93 base::TimeTicks timebase, |
92 base::TimeDelta interval) { | 94 base::TimeDelta interval) { |
93 DCHECK(CalledOnValidThread()); | 95 DCHECK(CalledOnValidThread()); |
94 DCHECK(client_); | 96 DCHECK(client_); |
95 double monotonicTimebase = timebase.ToInternalValue() / | 97 double monotonicTimebase = timebase.ToInternalValue() / |
96 static_cast<double>(base::Time::kMicrosecondsPerSecond); | 98 static_cast<double>(base::Time::kMicrosecondsPerSecond); |
97 double intervalInSeconds = interval.ToInternalValue() / | 99 double intervalInSeconds = interval.ToInternalValue() / |
98 static_cast<double>(base::Time::kMicrosecondsPerSecond); | 100 static_cast<double>(base::Time::kMicrosecondsPerSecond); |
99 client_->onVSyncParametersChanged(monotonicTimebase, intervalInSeconds); | 101 client_->onVSyncParametersChanged(monotonicTimebase, intervalInSeconds); |
100 } | 102 } |
OLD | NEW |