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

Side by Side Diff: content/public/renderer/render_thread.h

Issue 2566043004: Add renderer memory metrics (Closed)
Patch Set: Created 4 years 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_PUBLIC_RENDERER_RENDER_THREAD_H_ 5 #ifndef CONTENT_PUBLIC_RENDERER_RENDER_THREAD_H_
6 #define CONTENT_PUBLIC_RENDERER_RENDER_THREAD_H_ 6 #define CONTENT_PUBLIC_RENDERER_RENDER_THREAD_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 22 matching lines...) Expand all
33 33
34 namespace v8 { 34 namespace v8 {
35 class Extension; 35 class Extension;
36 } 36 }
37 37
38 namespace content { 38 namespace content {
39 39
40 class RenderThreadObserver; 40 class RenderThreadObserver;
41 class ResourceDispatcherDelegate; 41 class ResourceDispatcherDelegate;
42 42
43 struct RendererMemoryMetrics {
44 size_t partition_alloc_kb;
45 size_t blink_gc_kb;
46 size_t malloc_mb;
47 size_t discardable_kb;
48 size_t v8_main_thread_isolate_mb;
49 size_t total_allocated_mb;
50 size_t non_discardable_total_allocated_mb;
51 };
52
43 class CONTENT_EXPORT RenderThread : virtual public ChildThread { 53 class CONTENT_EXPORT RenderThread : virtual public ChildThread {
44 public: 54 public:
45 // Returns the one render thread for this process. Note that this can only 55 // Returns the one render thread for this process. Note that this can only
46 // be accessed when running on the render thread itself. 56 // be accessed when running on the render thread itself.
47 static RenderThread* Get(); 57 static RenderThread* Get();
48 58
49 RenderThread(); 59 RenderThread();
50 ~RenderThread() override; 60 ~RenderThread() override;
51 61
52 virtual IPC::SyncChannel* GetChannel() = 0; 62 virtual IPC::SyncChannel* GetChannel() = 0;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 virtual int PostTaskToAllWebWorkers(const base::Closure& closure) = 0; 107 virtual int PostTaskToAllWebWorkers(const base::Closure& closure) = 0;
98 108
99 // Resolve the proxy servers to use for a given url. On success true is 109 // Resolve the proxy servers to use for a given url. On success true is
100 // returned and |proxy_list| is set to a PAC string containing a list of 110 // returned and |proxy_list| is set to a PAC string containing a list of
101 // proxy servers. 111 // proxy servers.
102 virtual bool ResolveProxy(const GURL& url, std::string* proxy_list) = 0; 112 virtual bool ResolveProxy(const GURL& url, std::string* proxy_list) = 0;
103 113
104 // Gets the shutdown event for the process. 114 // Gets the shutdown event for the process.
105 virtual base::WaitableEvent* GetShutdownEvent() = 0; 115 virtual base::WaitableEvent* GetShutdownEvent() = 0;
106 116
117 virtual void GetRendererMemoryMetrics(
118 RendererMemoryMetrics* memory_metrics) const = 0;
119
107 // Retrieve the process ID of the browser process. 120 // Retrieve the process ID of the browser process.
108 virtual int32_t GetClientId() = 0; 121 virtual int32_t GetClientId() = 0;
109 }; 122 };
110 123
111 } // namespace content 124 } // namespace content
112 125
113 #endif // CONTENT_PUBLIC_RENDERER_RENDER_THREAD_H_ 126 #endif // CONTENT_PUBLIC_RENDERER_RENDER_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698