| 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 #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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 void OnChannelError() override; | 510 void OnChannelError() override; |
| 511 | 511 |
| 512 // ChildThread | 512 // ChildThread |
| 513 bool OnControlMessageReceived(const IPC::Message& msg) override; | 513 bool OnControlMessageReceived(const IPC::Message& msg) override; |
| 514 void OnProcessBackgrounded(bool backgrounded) override; | 514 void OnProcessBackgrounded(bool backgrounded) override; |
| 515 void OnProcessResume() override; | 515 void OnProcessResume() override; |
| 516 void OnProcessPurgeAndSuspend() override; | 516 void OnProcessPurgeAndSuspend() override; |
| 517 void RecordAction(const base::UserMetricsAction& action) override; | 517 void RecordAction(const base::UserMetricsAction& action) override; |
| 518 void RecordComputedAction(const std::string& action) override; | 518 void RecordComputedAction(const std::string& action) override; |
| 519 | 519 |
| 520 void PurgeBeforeSuspendTimerQueueWhenBackgrounded(); |
| 521 void SuspendTimerQueueWhenBackgrounded(); |
| 522 |
| 520 bool IsMainThread(); | 523 bool IsMainThread(); |
| 521 | 524 |
| 522 // base::MemoryCoordinatorClient implementation: | 525 // base::MemoryCoordinatorClient implementation: |
| 523 void OnMemoryStateChange(base::MemoryState state) override; | 526 void OnMemoryStateChange(base::MemoryState state) override; |
| 524 | 527 |
| 525 void ClearMemory(); | 528 void ClearMemory(); |
| 526 | 529 |
| 527 void Init( | 530 void Init( |
| 528 const scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue); | 531 const scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue); |
| 529 | 532 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 | 759 |
| 757 AssociatedInterfaceRegistryImpl associated_interfaces_; | 760 AssociatedInterfaceRegistryImpl associated_interfaces_; |
| 758 | 761 |
| 759 mojo::AssociatedBinding<mojom::Renderer> renderer_binding_; | 762 mojo::AssociatedBinding<mojom::Renderer> renderer_binding_; |
| 760 | 763 |
| 761 mojom::RenderFrameMessageFilterAssociatedPtr render_frame_message_filter_; | 764 mojom::RenderFrameMessageFilterAssociatedPtr render_frame_message_filter_; |
| 762 mojom::RenderMessageFilterAssociatedPtr render_message_filter_; | 765 mojom::RenderMessageFilterAssociatedPtr render_message_filter_; |
| 763 scoped_refptr<mojom::ThreadSafeRenderMessageFilterAssociatedPtr> | 766 scoped_refptr<mojom::ThreadSafeRenderMessageFilterAssociatedPtr> |
| 764 thread_safe_render_message_filter_; | 767 thread_safe_render_message_filter_; |
| 765 | 768 |
| 769 // The amount of time to wait before suspending shared timers after the |
| 770 // renderer has been backgrounded. This is used only if background suspension |
| 771 // of shared timers is enabled. |
| 772 static const int kSuspendTimersWhenBackgroundedDelayMillis = 5 * 60 * 1000; |
| 773 |
| 774 base::CancelableClosure purge_before_suspend_timers_closure_; |
| 775 base::CancelableClosure suspend_timers_when_backgrounded_closure_; |
| 776 |
| 766 base::CancelableClosure record_purge_suspend_metric_closure_; | 777 base::CancelableClosure record_purge_suspend_metric_closure_; |
| 767 RendererMemoryMetrics purge_and_suspend_memory_metrics_; | 778 RendererMemoryMetrics purge_and_suspend_memory_metrics_; |
| 768 base::CancelableClosure record_purge_suspend_growth_metric_closure_; | 779 base::CancelableClosure record_purge_suspend_growth_metric_closure_; |
| 769 | 780 |
| 770 int32_t client_id_; | 781 int32_t client_id_; |
| 771 | 782 |
| 772 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); | 783 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
| 773 }; | 784 }; |
| 774 | 785 |
| 775 #if defined(COMPILER_MSVC) | 786 #if defined(COMPILER_MSVC) |
| 776 #pragma warning(pop) | 787 #pragma warning(pop) |
| 777 #endif | 788 #endif |
| 778 | 789 |
| 779 } // namespace content | 790 } // namespace content |
| 780 | 791 |
| 781 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ | 792 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| OLD | NEW |