| 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 "base/base_switches.h" | 5 #include "base/base_switches.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/debug/debugger.h" | 7 #include "base/debug/debugger.h" |
| 8 #include "base/debug/stack_trace.h" | 8 #include "base/debug/stack_trace.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/hi_res_timer_manager.h" | 10 #include "base/hi_res_timer_manager.h" |
| 11 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "base/metrics/field_trial.h" | 14 #include "base/metrics/field_trial.h" |
| 15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
| 16 #include "base/metrics/statistics_recorder.h" | 16 #include "base/metrics/statistics_recorder.h" |
| 17 #include "base/metrics/stats_counters.h" | 17 #include "base/metrics/stats_counters.h" |
| 18 #include "base/path_service.h" | 18 #include "base/path_service.h" |
| 19 #include "base/pending_task.h" | 19 #include "base/pending_task.h" |
| 20 #include "base/power_monitor/power_monitor.h" | 20 #include "base/power_monitor/power_monitor.h" |
| 21 #include "base/process_util.h" | 21 #include "base/process_util.h" |
| 22 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
| 23 #include "base/threading/platform_thread.h" | 23 #include "base/threading/platform_thread.h" |
| 24 #include "base/time.h" | 24 #include "base/time.h" |
| 25 #include "content/child/child_process.h" | 25 #include "content/child/child_process.h" |
| 26 #include "content/common/content_constants_internal.h" |
| 26 #include "content/common/pepper_plugin_registry.h" | 27 #include "content/common/pepper_plugin_registry.h" |
| 27 #include "content/public/common/content_switches.h" | 28 #include "content/public/common/content_switches.h" |
| 28 #include "content/public/common/main_function_params.h" | 29 #include "content/public/common/main_function_params.h" |
| 29 #include "content/public/renderer/content_renderer_client.h" | 30 #include "content/public/renderer/content_renderer_client.h" |
| 30 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h" | 31 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h" |
| 31 #include "content/renderer/render_process_impl.h" | 32 #include "content/renderer/render_process_impl.h" |
| 32 #include "content/renderer/render_thread_impl.h" | 33 #include "content/renderer/render_thread_impl.h" |
| 33 #include "content/renderer/renderer_main_platform_delegate.h" | 34 #include "content/renderer/renderer_main_platform_delegate.h" |
| 34 #include "third_party/libjingle/overrides/init_webrtc.h" | 35 #include "third_party/libjingle/overrides/init_webrtc.h" |
| 35 #include "ui/base/ui_base_switches.h" | 36 #include "ui/base/ui_base_switches.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 virtual void DidProcessTask(const base::PendingTask& pending_task) OVERRIDE { | 101 virtual void DidProcessTask(const base::PendingTask& pending_task) OVERRIDE { |
| 101 HISTOGRAM_MEMORY_KB("Memory.RendererUsed", webkit_glue::MemoryUsageKB()); | 102 HISTOGRAM_MEMORY_KB("Memory.RendererUsed", webkit_glue::MemoryUsageKB()); |
| 102 } | 103 } |
| 103 private: | 104 private: |
| 104 DISALLOW_COPY_AND_ASSIGN(MemoryObserver); | 105 DISALLOW_COPY_AND_ASSIGN(MemoryObserver); |
| 105 }; | 106 }; |
| 106 | 107 |
| 107 // mainline routine for running as the Renderer process | 108 // mainline routine for running as the Renderer process |
| 108 int RendererMain(const MainFunctionParams& parameters) { | 109 int RendererMain(const MainFunctionParams& parameters) { |
| 109 TRACE_EVENT_BEGIN_ETW("RendererMain", 0, ""); | 110 TRACE_EVENT_BEGIN_ETW("RendererMain", 0, ""); |
| 111 base::debug::TraceLog::GetInstance()->SetProcessName("Renderer"); |
| 112 base::debug::TraceLog::GetInstance()->SetProcessSortIndex( |
| 113 kTraceEventRendererProcessSortIndex); |
| 110 | 114 |
| 111 const CommandLine& parsed_command_line = parameters.command_line; | 115 const CommandLine& parsed_command_line = parameters.command_line; |
| 112 | 116 |
| 113 #if defined(OS_MACOSX) | 117 #if defined(OS_MACOSX) |
| 114 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool; | 118 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool; |
| 115 #endif // OS_MACOSX | 119 #endif // OS_MACOSX |
| 116 | 120 |
| 117 #if defined(OS_CHROMEOS) | 121 #if defined(OS_CHROMEOS) |
| 118 // As Zygote process starts up earlier than browser process gets its own | 122 // As Zygote process starts up earlier than browser process gets its own |
| 119 // locale (at login time for Chrome OS), we have to set the ICU default | 123 // locale (at login time for Chrome OS), we have to set the ICU default |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 base::MessageLoop::current()->Run(); | 240 base::MessageLoop::current()->Run(); |
| 237 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 241 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
| 238 } | 242 } |
| 239 } | 243 } |
| 240 platform.PlatformUninitialize(); | 244 platform.PlatformUninitialize(); |
| 241 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 245 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
| 242 return 0; | 246 return 0; |
| 243 } | 247 } |
| 244 | 248 |
| 245 } // namespace content | 249 } // namespace content |
| OLD | NEW |