OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/android/in_process/synchronous_compositor_impl.h" | 5 #include "content/browser/android/in_process/synchronous_compositor_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 } | 327 } |
328 | 328 |
329 void SynchronousCompositorImpl::DidBecomeCurrent() { | 329 void SynchronousCompositorImpl::DidBecomeCurrent() { |
330 // This is single process synchronous compositor. There is only one | 330 // This is single process synchronous compositor. There is only one |
331 // RenderViewHost. DidBecomeCurrent could be called before the renderer | 331 // RenderViewHost. DidBecomeCurrent could be called before the renderer |
332 // objects are initialized. So hold off calling DidBecomeCurrent until | 332 // objects are initialized. So hold off calling DidBecomeCurrent until |
333 // RegisterWithClient. Intentional no-op here. | 333 // RegisterWithClient. Intentional no-op here. |
334 } | 334 } |
335 | 335 |
336 void SynchronousCompositorImpl::DeliverMessages() { | 336 void SynchronousCompositorImpl::DeliverMessages() { |
337 std::vector<scoped_ptr<IPC::Message>> messages; | 337 std::vector<std::unique_ptr<IPC::Message>> messages; |
338 output_surface_->GetMessagesToDeliver(&messages); | 338 output_surface_->GetMessagesToDeliver(&messages); |
339 RenderProcessHost* rph = rwhva_->GetRenderWidgetHost()->GetProcess(); | 339 RenderProcessHost* rph = rwhva_->GetRenderWidgetHost()->GetProcess(); |
340 for (const auto& msg : messages) { | 340 for (const auto& msg : messages) { |
341 rph->OnMessageReceived(*msg); | 341 rph->OnMessageReceived(*msg); |
342 } | 342 } |
343 } | 343 } |
344 | 344 |
345 void SynchronousCompositorImpl::DidActivatePendingTree() { | 345 void SynchronousCompositorImpl::DidActivatePendingTree() { |
346 if (registered_with_client_) | 346 if (registered_with_client_) |
347 compositor_client_->DidUpdateContent(); | 347 compositor_client_->DidUpdateContent(); |
(...skipping 29 matching lines...) Expand all Loading... |
377 } | 377 } |
378 } | 378 } |
379 | 379 |
380 // Not using base::NonThreadSafe as we want to enforce a more exacting threading | 380 // Not using base::NonThreadSafe as we want to enforce a more exacting threading |
381 // requirement: SynchronousCompositorImpl() must only be used on the UI thread. | 381 // requirement: SynchronousCompositorImpl() must only be used on the UI thread. |
382 bool SynchronousCompositorImpl::CalledOnValidThread() const { | 382 bool SynchronousCompositorImpl::CalledOnValidThread() const { |
383 return BrowserThread::CurrentlyOn(BrowserThread::UI); | 383 return BrowserThread::CurrentlyOn(BrowserThread::UI); |
384 } | 384 } |
385 | 385 |
386 } // namespace content | 386 } // namespace content |
OLD | NEW |