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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 void RenderThreadImpl::PreCacheFont(const LOGFONT& log_font) { | 753 void RenderThreadImpl::PreCacheFont(const LOGFONT& log_font) { |
753 Send(new ChildProcessHostMsg_PreCacheFont(log_font)); | 754 Send(new ChildProcessHostMsg_PreCacheFont(log_font)); |
754 } | 755 } |
755 | 756 |
756 void RenderThreadImpl::ReleaseCachedFonts() { | 757 void RenderThreadImpl::ReleaseCachedFonts() { |
757 Send(new ChildProcessHostMsg_ReleaseCachedFonts()); | 758 Send(new ChildProcessHostMsg_ReleaseCachedFonts()); |
758 } | 759 } |
759 | 760 |
760 #endif // OS_WIN | 761 #endif // OS_WIN |
761 | 762 |
| 763 void RenderThreadImpl::UpdateHistograms(int sequence_number) { |
| 764 child_histogram_message_filter()->SendHistograms(sequence_number); |
| 765 } |
| 766 |
762 bool RenderThreadImpl::IsWebFrameValid(WebKit::WebFrame* web_frame) { | 767 bool RenderThreadImpl::IsWebFrameValid(WebKit::WebFrame* web_frame) { |
763 if (!web_frame) | 768 if (!web_frame) |
764 return false; // We must be shutting down. | 769 return false; // We must be shutting down. |
765 | 770 |
766 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); | 771 RenderViewImpl* render_view = RenderViewImpl::FromWebView(web_frame->view()); |
767 if (!render_view) | 772 if (!render_view) |
768 return false; // We must be shutting down. | 773 return false; // We must be shutting down. |
769 | 774 |
770 return true; | 775 return true; |
771 } | 776 } |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 | 1029 |
1025 scoped_refptr<base::MessageLoopProxy> | 1030 scoped_refptr<base::MessageLoopProxy> |
1026 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 1031 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
1027 DCHECK(message_loop() == MessageLoop::current()); | 1032 DCHECK(message_loop() == MessageLoop::current()); |
1028 if (!file_thread_.get()) { | 1033 if (!file_thread_.get()) { |
1029 file_thread_.reset(new base::Thread("Renderer::FILE")); | 1034 file_thread_.reset(new base::Thread("Renderer::FILE")); |
1030 file_thread_->Start(); | 1035 file_thread_->Start(); |
1031 } | 1036 } |
1032 return file_thread_->message_loop_proxy(); | 1037 return file_thread_->message_loop_proxy(); |
1033 } | 1038 } |
OLD | NEW |