| 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/histogram_sender.h" |
| 19 #include "base/metrics/stats_table.h" | 20 #include "base/metrics/stats_table.h" |
| 20 #include "base/path_service.h" | 21 #include "base/path_service.h" |
| 21 #include "base/shared_memory.h" | 22 #include "base/shared_memory.h" |
| 22 #include "base/string_number_conversions.h" // Temporary | 23 #include "base/string_number_conversions.h" // Temporary |
| 23 #include "base/threading/thread_local.h" | 24 #include "base/threading/thread_local.h" |
| 24 #include "base/utf_string_conversions.h" | 25 #include "base/utf_string_conversions.h" |
| 25 #include "base/values.h" | 26 #include "base/values.h" |
| 26 #include "base/win/scoped_com_initializer.h" | 27 #include "base/win/scoped_com_initializer.h" |
| 27 #include "content/common/appcache/appcache_dispatcher.h" | 28 #include "content/common/appcache/appcache_dispatcher.h" |
| 28 #include "content/common/child_process_messages.h" | 29 #include "content/common/child_process_messages.h" |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 DCHECK(!lang.empty() || | 386 DCHECK(!lang.empty() || |
| 386 (!parsed_command_line.HasSwitch(switches::kRendererProcess) && | 387 (!parsed_command_line.HasSwitch(switches::kRendererProcess) && |
| 387 !parsed_command_line.HasSwitch(switches::kPluginProcess))); | 388 !parsed_command_line.HasSwitch(switches::kPluginProcess))); |
| 388 return lang; | 389 return lang; |
| 389 } | 390 } |
| 390 | 391 |
| 391 IPC::SyncMessageFilter* RenderThreadImpl::GetSyncMessageFilter() { | 392 IPC::SyncMessageFilter* RenderThreadImpl::GetSyncMessageFilter() { |
| 392 return sync_message_filter(); | 393 return sync_message_filter(); |
| 393 } | 394 } |
| 394 | 395 |
| 396 base::HistogramSender* RenderThreadImpl::GetHistogramSender() { |
| 397 return reinterpret_cast<base::HistogramSender*>( |
| 398 child_histogram_message_filter()); |
| 399 } |
| 400 |
| 395 scoped_refptr<base::MessageLoopProxy> | 401 scoped_refptr<base::MessageLoopProxy> |
| 396 RenderThreadImpl::GetIOMessageLoopProxy() { | 402 RenderThreadImpl::GetIOMessageLoopProxy() { |
| 397 return ChildProcess::current()->io_message_loop_proxy(); | 403 return ChildProcess::current()->io_message_loop_proxy(); |
| 398 } | 404 } |
| 399 | 405 |
| 400 void RenderThreadImpl::AddRoute(int32 routing_id, | 406 void RenderThreadImpl::AddRoute(int32 routing_id, |
| 401 IPC::Channel::Listener* listener) { | 407 IPC::Channel::Listener* listener) { |
| 402 widget_count_++; | 408 widget_count_++; |
| 403 return ChildThread::AddRoute(routing_id, listener); | 409 return ChildThread::AddRoute(routing_id, listener); |
| 404 } | 410 } |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 | 992 |
| 987 scoped_refptr<base::MessageLoopProxy> | 993 scoped_refptr<base::MessageLoopProxy> |
| 988 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 994 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
| 989 DCHECK(message_loop() == MessageLoop::current()); | 995 DCHECK(message_loop() == MessageLoop::current()); |
| 990 if (!file_thread_.get()) { | 996 if (!file_thread_.get()) { |
| 991 file_thread_.reset(new base::Thread("Renderer::FILE")); | 997 file_thread_.reset(new base::Thread("Renderer::FILE")); |
| 992 file_thread_->Start(); | 998 file_thread_->Start(); |
| 993 } | 999 } |
| 994 return file_thread_->message_loop_proxy(); | 1000 return file_thread_->message_loop_proxy(); |
| 995 } | 1001 } |
| OLD | NEW |