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

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

Issue 11361219: Add a histogram for renderer memory usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 13 matching lines...) Expand all
24 24
25 class SkBitmap; 25 class SkBitmap;
26 struct ViewMsg_New_Params; 26 struct ViewMsg_New_Params;
27 27
28 namespace WebKit { 28 namespace WebKit {
29 class WebMediaStreamCenter; 29 class WebMediaStreamCenter;
30 class WebMediaStreamCenterClient; 30 class WebMediaStreamCenterClient;
31 } 31 }
32 32
33 namespace base { 33 namespace base {
34 class Histogram;
34 class MessageLoopProxy; 35 class MessageLoopProxy;
35 class Thread; 36 class Thread;
36 37
37 #if defined(OS_WIN) 38 #if defined(OS_WIN)
38 namespace win { 39 namespace win {
39 class ScopedCOMInitializer; 40 class ScopedCOMInitializer;
40 } 41 }
41 #endif 42 #endif
42 } 43 }
43 44
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 // displaying a page from the same host. |host| is the host where a 260 // displaying a page from the same host. |host| is the host where a
260 // RenderView navigated, and |view_count| is the number of RenderViews in 261 // RenderView navigated, and |view_count| is the number of RenderViews in
261 // this process. 262 // this process.
262 void RenderViewNavigatedToHost(const std::string& host, size_t view_count); 263 void RenderViewNavigatedToHost(const std::string& host, size_t view_count);
263 264
264 // Used for customizing some histograms if all RenderViews share the same 265 // Used for customizing some histograms if all RenderViews share the same
265 // host. Returns the current custom histogram name to use for 266 // host. Returns the current custom histogram name to use for
266 // |histogram_name|, or |histogram_name| if it shouldn't be customized. 267 // |histogram_name|, or |histogram_name| if it shouldn't be customized.
267 std::string ConvertToCustomHistogramName(const char* histogram_name) const; 268 std::string ConvertToCustomHistogramName(const char* histogram_name) const;
268 269
270 // Custom histograms maintained by the HistogramCustomizer itself.
271 base::Histogram* memory_renderer_used();
272
269 private: 273 private:
270 friend class RenderThreadImplUnittest; 274 friend class RenderThreadImplUnittest;
271 275
272 // Used for updating the information on which is the common host which all 276 // Used for updating the information on which is the common host which all
273 // RenderView's share (if any). If there is no common host, this function is 277 // RenderView's share (if any). If there is no common host, this function is
274 // called with an empty string. 278 // called with an empty string.
275 void SetCommonHost(const std::string& host); 279 void SetCommonHost(const std::string& host);
276 280
277 // The current common host of the RenderViews; empty string if there is no 281 // The current common host of the RenderViews; empty string if there is no
278 // common host. 282 // common host.
279 std::string common_host_; 283 std::string common_host_;
280 // The corresponding suffix. 284 // The corresponding suffix.
281 std::string common_host_histogram_suffix_; 285 std::string common_host_histogram_suffix_;
282 // Set of histograms for which we want to produce a custom histogram if 286 // Set of histograms for which we want to produce a custom histogram if
283 // possible. 287 // possible.
284 std::set<std::string> custom_histograms_; 288 std::set<std::string> custom_histograms_;
285 289
290 // Custom histograms maintained by this object.
291 base::Histogram* memory_renderer_used_;
292
286 DISALLOW_COPY_AND_ASSIGN(HistogramCustomizer); 293 DISALLOW_COPY_AND_ASSIGN(HistogramCustomizer);
287 }; 294 };
288 295
289 HistogramCustomizer* histogram_customizer() { 296 HistogramCustomizer* histogram_customizer() {
290 return &histogram_customizer_; 297 return &histogram_customizer_;
291 } 298 }
292 299
293 private: 300 private:
294 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; 301 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE;
295 302
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 scoped_ptr<AudioRendererMixerManager> audio_renderer_mixer_manager_; 380 scoped_ptr<AudioRendererMixerManager> audio_renderer_mixer_manager_;
374 381
375 HistogramCustomizer histogram_customizer_; 382 HistogramCustomizer histogram_customizer_;
376 383
377 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); 384 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl);
378 }; 385 };
379 386
380 } // namespace content 387 } // namespace content
381 388
382 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ 389 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698