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 #include "content/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/allocator/allocator_extension.h" | 12 #include "base/allocator/allocator_extension.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/debug/trace_event.h" | 14 #include "base/debug/trace_event.h" |
15 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/metrics/field_trial.h" | 17 #include "base/metrics/field_trial.h" |
18 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
19 #include "base/metrics/stats_table.h" | 19 #include "base/metrics/stats_table.h" |
20 #include "base/path_service.h" | 20 #include "base/path_service.h" |
21 #include "base/shared_memory.h" | 21 #include "base/shared_memory.h" |
22 #include "base/string_number_conversions.h" // Temporary | 22 #include "base/string_number_conversions.h" // Temporary |
23 #include "base/threading/thread_local.h" | 23 #include "base/threading/thread_local.h" |
24 #include "base/utf_string_conversions.h" | 24 #include "base/utf_string_conversions.h" |
25 #include "base/values.h" | 25 #include "base/values.h" |
26 #include "base/win/scoped_com_initializer.h" | 26 #include "base/win/scoped_com_initializer.h" |
27 #include "content/common/appcache/appcache_dispatcher.h" | 27 #include "content/common/appcache/appcache_dispatcher.h" |
| 28 #include "content/common/child_histogram_message_filter.h" |
28 #include "content/common/child_process_messages.h" | 29 #include "content/common/child_process_messages.h" |
29 #include "content/common/database_messages.h" | 30 #include "content/common/database_messages.h" |
30 #include "content/common/db_message_filter.h" | 31 #include "content/common/db_message_filter.h" |
31 #include "content/common/dom_storage_messages.h" | 32 #include "content/common/dom_storage_messages.h" |
32 #include "content/common/gpu/client/gpu_channel_host.h" | 33 #include "content/common/gpu/client/gpu_channel_host.h" |
33 #include "content/common/gpu/gpu_messages.h" | 34 #include "content/common/gpu/gpu_messages.h" |
34 #include "content/common/indexed_db/indexed_db_dispatcher.h" | 35 #include "content/common/indexed_db/indexed_db_dispatcher.h" |
35 #include "content/common/indexed_db/indexed_db_message_filter.h" | 36 #include "content/common/indexed_db/indexed_db_message_filter.h" |
36 #include "content/common/npobject_util.h" | 37 #include "content/common/npobject_util.h" |
37 #include "content/common/plugin_messages.h" | 38 #include "content/common/plugin_messages.h" |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 void RenderThreadImpl::PreCacheFont(const LOGFONT& log_font) { | 715 void RenderThreadImpl::PreCacheFont(const LOGFONT& log_font) { |
715 Send(new ChildProcessHostMsg_PreCacheFont(log_font)); | 716 Send(new ChildProcessHostMsg_PreCacheFont(log_font)); |
716 } | 717 } |
717 | 718 |
718 void RenderThreadImpl::ReleaseCachedFonts() { | 719 void RenderThreadImpl::ReleaseCachedFonts() { |
719 Send(new ChildProcessHostMsg_ReleaseCachedFonts()); | 720 Send(new ChildProcessHostMsg_ReleaseCachedFonts()); |
720 } | 721 } |
721 | 722 |
722 #endif // OS_WIN | 723 #endif // OS_WIN |
723 | 724 |
| 725 void RenderThreadImpl::UpdateHistograms(int sequence_number) { |
| 726 child_histogram_message_filter()->SendHistograms(sequence_number); |
| 727 } |
| 728 |
724 bool RenderThreadImpl::IsWebFrameValid(WebKit::WebFrame* web_frame) { | 729 bool RenderThreadImpl::IsWebFrameValid(WebKit::WebFrame* web_frame) { |
725 if (!web_frame) | 730 if (!web_frame) |
726 return false; // We must be shutting down. | 731 return false; // We must be shutting down. |
727 | 732 |
728 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); | 733 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); |
729 if (!render_view) | 734 if (!render_view) |
730 return false; // We must be shutting down. | 735 return false; // We must be shutting down. |
731 | 736 |
732 return true; | 737 return true; |
733 } | 738 } |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 | 990 |
986 scoped_refptr<base::MessageLoopProxy> | 991 scoped_refptr<base::MessageLoopProxy> |
987 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 992 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
988 DCHECK(message_loop() == MessageLoop::current()); | 993 DCHECK(message_loop() == MessageLoop::current()); |
989 if (!file_thread_.get()) { | 994 if (!file_thread_.get()) { |
990 file_thread_.reset(new base::Thread("Renderer::FILE")); | 995 file_thread_.reset(new base::Thread("Renderer::FILE")); |
991 file_thread_->Start(); | 996 file_thread_->Start(); |
992 } | 997 } |
993 return file_thread_->message_loop_proxy(); | 998 return file_thread_->message_loop_proxy(); |
994 } | 999 } |
OLD | NEW |