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

Side by Side Diff: content/renderer/render_thread_impl.h

Issue 2391423004: Add UMA for PurgeAndSuspend. (Closed)
Patch Set: Fixed. Created 4 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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <set> 11 #include <set>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/cancelable_callback.h" 15 #include "base/cancelable_callback.h"
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "base/memory/memory_pressure_listener.h" 17 #include "base/memory/memory_pressure_listener.h"
18 #include "base/memory/ref_counted.h" 18 #include "base/memory/ref_counted.h"
19 #include "base/metrics/user_metrics_action.h" 19 #include "base/metrics/user_metrics_action.h"
20 #include "base/observer_list.h" 20 #include "base/observer_list.h"
21 #include "base/strings/string16.h" 21 #include "base/strings/string16.h"
22 #include "base/threading/thread_checker.h" 22 #include "base/threading/thread_checker.h"
23 #include "base/timer/timer.h" 23 #include "base/timer/timer.h"
24 #include "build/build_config.h" 24 #include "build/build_config.h"
25 #include "content/child/child_discardable_shared_memory_manager.h"
25 #include "content/child/child_thread_impl.h" 26 #include "content/child/child_thread_impl.h"
26 #include "content/child/memory/child_memory_coordinator_impl.h" 27 #include "content/child/memory/child_memory_coordinator_impl.h"
27 #include "content/common/associated_interface_registry_impl.h" 28 #include "content/common/associated_interface_registry_impl.h"
28 #include "content/common/content_export.h" 29 #include "content/common/content_export.h"
29 #include "content/common/frame.mojom.h" 30 #include "content/common/frame.mojom.h"
30 #include "content/common/frame_replication_state.h" 31 #include "content/common/frame_replication_state.h"
31 #include "content/common/render_frame_message_filter.mojom.h" 32 #include "content/common/render_frame_message_filter.mojom.h"
32 #include "content/common/render_message_filter.mojom.h" 33 #include "content/common/render_message_filter.mojom.h"
33 #include "content/common/renderer.mojom.h" 34 #include "content/common/renderer.mojom.h"
34 #include "content/common/storage_partition_service.mojom.h" 35 #include "content/common/storage_partition_service.mojom.h"
35 #include "content/public/renderer/render_thread.h" 36 #include "content/public/renderer/render_thread.h"
36 #include "content/renderer/gpu/compositor_dependencies.h" 37 #include "content/renderer/gpu/compositor_dependencies.h"
37 #include "content/renderer/layout_test_dependencies.h" 38 #include "content/renderer/layout_test_dependencies.h"
38 #include "device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom.h" 39 #include "device/time_zone_monitor/public/interfaces/time_zone_monitor.mojom.h"
39 #include "gpu/ipc/client/gpu_channel_host.h" 40 #include "gpu/ipc/client/gpu_channel_host.h"
40 #include "mojo/public/cpp/bindings/associated_binding.h" 41 #include "mojo/public/cpp/bindings/associated_binding.h"
41 #include "mojo/public/cpp/bindings/binding.h" 42 #include "mojo/public/cpp/bindings/binding.h"
42 #include "net/base/network_change_notifier.h" 43 #include "net/base/network_change_notifier.h"
43 #include "third_party/WebKit/public/platform/WebConnectionType.h" 44 #include "third_party/WebKit/public/platform/WebConnectionType.h"
44 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul er.h" 45 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul er.h"
46 #include "third_party/WebKit/public/web/WebMemoryStatistics.h"
45 #include "ui/gfx/native_widget_types.h" 47 #include "ui/gfx/native_widget_types.h"
46 48
47 #if defined(OS_MACOSX) 49 #if defined(OS_MACOSX)
48 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h" 50 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h"
49 #endif 51 #endif
50 52
51 class GrContext; 53 class GrContext;
52 class SkBitmap; 54 class SkBitmap;
53 struct ViewMsg_UpdateScrollbarTheme_Params; 55 struct ViewMsg_UpdateScrollbarTheme_Params;
54 struct WorkerProcessMsg_CreateWorker_Params; 56 struct WorkerProcessMsg_CreateWorker_Params;
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler); 480 std::unique_ptr<blink::scheduler::RendererScheduler> scheduler);
479 481
480 private: 482 private:
481 // IPC::Listener 483 // IPC::Listener
482 void OnChannelError() override; 484 void OnChannelError() override;
483 485
484 // ChildThread 486 // ChildThread
485 bool OnControlMessageReceived(const IPC::Message& msg) override; 487 bool OnControlMessageReceived(const IPC::Message& msg) override;
486 void OnProcessBackgrounded(bool backgrounded) override; 488 void OnProcessBackgrounded(bool backgrounded) override;
487 void OnProcessPurgeAndSuspend() override; 489 void OnProcessPurgeAndSuspend() override;
490
488 void RecordAction(const base::UserMetricsAction& action) override; 491 void RecordAction(const base::UserMetricsAction& action) override;
489 void RecordComputedAction(const std::string& action) override; 492 void RecordComputedAction(const std::string& action) override;
490 493
491 // GpuChannelHostFactory implementation: 494 // GpuChannelHostFactory implementation:
492 bool IsMainThread() override; 495 bool IsMainThread() override;
493 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; 496 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override;
494 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( 497 std::unique_ptr<base::SharedMemory> AllocateSharedMemory(
495 size_t size) override; 498 size_t size) override;
496 499
497 void Init(scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue); 500 void Init(scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 void OnSystemColorsChanged(int aqua_color_variant, 535 void OnSystemColorsChanged(int aqua_color_variant,
533 const std::string& highlight_text_color, 536 const std::string& highlight_text_color,
534 const std::string& highlight_color); 537 const std::string& highlight_color);
535 #endif 538 #endif
536 void OnCreateNewSharedWorker( 539 void OnCreateNewSharedWorker(
537 const WorkerProcessMsg_CreateWorker_Params& params); 540 const WorkerProcessMsg_CreateWorker_Params& params);
538 bool RendererIsHidden() const; 541 bool RendererIsHidden() const;
539 void OnRendererHidden(); 542 void OnRendererHidden();
540 void OnRendererVisible(); 543 void OnRendererVisible();
541 544
545 void RecordPurgeAndSuspendMetrics() const;
546
542 void ReleaseFreeMemory(); 547 void ReleaseFreeMemory();
543 548
544 void OnSyncMemoryPressure( 549 void OnSyncMemoryPressure(
545 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); 550 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
546 551
547 std::unique_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource( 552 std::unique_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource(
548 int routing_id); 553 int routing_id);
549 554
550 void OnRendererInterfaceRequest(mojom::RendererAssociatedRequest request); 555 void OnRendererInterfaceRequest(mojom::RendererAssociatedRequest request);
551 556
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 735
731 mojom::StoragePartitionServicePtr storage_partition_service_; 736 mojom::StoragePartitionServicePtr storage_partition_service_;
732 737
733 AssociatedInterfaceRegistryImpl associated_interfaces_; 738 AssociatedInterfaceRegistryImpl associated_interfaces_;
734 739
735 mojo::AssociatedBinding<mojom::Renderer> renderer_binding_; 740 mojo::AssociatedBinding<mojom::Renderer> renderer_binding_;
736 741
737 mojom::RenderFrameMessageFilterAssociatedPtr render_frame_message_filter_; 742 mojom::RenderFrameMessageFilterAssociatedPtr render_frame_message_filter_;
738 mojom::RenderMessageFilterAssociatedPtr render_message_filter_; 743 mojom::RenderMessageFilterAssociatedPtr render_message_filter_;
739 744
745 base::CancelableClosure record_purge_suspend_metric_closure_;
740 bool is_renderer_suspended_; 746 bool is_renderer_suspended_;
741 747
742 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); 748 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl);
743 }; 749 };
744 750
745 #if defined(COMPILER_MSVC) 751 #if defined(COMPILER_MSVC)
746 #pragma warning(pop) 752 #pragma warning(pop)
747 #endif 753 #endif
748 754
749 } // namespace content 755 } // namespace content
750 756
751 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ 757 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698