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

Side by Side Diff: content/renderer/renderer_main.cc

Issue 11232014: Move a bunch of code in content\renderer to the content namespace. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac Created 8 years, 2 months 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
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 #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/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/hi_res_timer_manager.h" 9 #include "base/hi_res_timer_manager.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 24 matching lines...) Expand all
35 #include <Carbon/Carbon.h> 35 #include <Carbon/Carbon.h>
36 #include <signal.h> 36 #include <signal.h>
37 #include <unistd.h> 37 #include <unistd.h>
38 38
39 #include "base/mac/mac_util.h" 39 #include "base/mac/mac_util.h"
40 #include "base/mac/scoped_nsautorelease_pool.h" 40 #include "base/mac/scoped_nsautorelease_pool.h"
41 #include "third_party/mach_override/mach_override.h" 41 #include "third_party/mach_override/mach_override.h"
42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
43 #endif // OS_MACOSX 43 #endif // OS_MACOSX
44 44
45 namespace content {
46
45 namespace { 47 namespace {
46 48
47 #if defined(OS_MACOSX) 49 #if defined(OS_MACOSX)
48 50
49 CFArrayRef ChromeTISCreateInputSourceList( 51 CFArrayRef ChromeTISCreateInputSourceList(
50 CFDictionaryRef properties, 52 CFDictionaryRef properties,
51 Boolean includeAllInstalled) { 53 Boolean includeAllInstalled) {
52 CFTypeRef values[] = { CFSTR("") }; 54 CFTypeRef values[] = { CFSTR("") };
53 return CFArrayCreate( 55 return CFArrayCreate(
54 kCFAllocatorDefault, values, arraysize(values), &kCFTypeArrayCallBacks); 56 kCFAllocatorDefault, values, arraysize(values), &kCFTypeArrayCallBacks);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 process_times_->AddTime(base::TimeTicks::Now() - begin_process_message_); 117 process_times_->AddTime(base::TimeTicks::Now() - begin_process_message_);
116 } 118 }
117 119
118 private: 120 private:
119 base::TimeTicks begin_process_message_; 121 base::TimeTicks begin_process_message_;
120 base::Histogram* const process_times_; 122 base::Histogram* const process_times_;
121 DISALLOW_COPY_AND_ASSIGN(RendererMessageLoopObserver); 123 DISALLOW_COPY_AND_ASSIGN(RendererMessageLoopObserver);
122 }; 124 };
123 125
124 // mainline routine for running as the Renderer process 126 // mainline routine for running as the Renderer process
125 int RendererMain(const content::MainFunctionParams& parameters) { 127 int RendererMain(const MainFunctionParams& parameters) {
126 TRACE_EVENT_BEGIN_ETW("RendererMain", 0, ""); 128 TRACE_EVENT_BEGIN_ETW("RendererMain", 0, "");
127 129
128 const CommandLine& parsed_command_line = parameters.command_line; 130 const CommandLine& parsed_command_line = parameters.command_line;
129 131
130 #if defined(OS_MACOSX) 132 #if defined(OS_MACOSX)
131 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool; 133 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool;
132 InstallFrameworkHacks(); 134 InstallFrameworkHacks();
133 #endif // OS_MACOSX 135 #endif // OS_MACOSX
134 136
135 #if defined(OS_CHROMEOS) 137 #if defined(OS_CHROMEOS)
(...skipping 11 matching lines...) Expand all
147 // This function allows pausing execution using the --renderer-startup-dialog 149 // This function allows pausing execution using the --renderer-startup-dialog
148 // flag allowing us to attach a debugger. 150 // flag allowing us to attach a debugger.
149 // Do not move this function down since that would mean we can't easily debug 151 // Do not move this function down since that would mean we can't easily debug
150 // whatever occurs before it. 152 // whatever occurs before it.
151 HandleRendererErrorTestParameters(parsed_command_line); 153 HandleRendererErrorTestParameters(parsed_command_line);
152 154
153 RendererMainPlatformDelegate platform(parameters); 155 RendererMainPlatformDelegate platform(parameters);
154 156
155 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager = 157 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager =
156 webkit::ppapi::PpapiInterfaceFactoryManager::GetInstance(); 158 webkit::ppapi::PpapiInterfaceFactoryManager::GetInstance();
157 content::GetContentClient()->renderer()->RegisterPPAPIInterfaceFactories( 159 GetContentClient()->renderer()->RegisterPPAPIInterfaceFactories(
158 factory_manager); 160 factory_manager);
159 161
160 base::StatsCounterTimer stats_counter_timer("Content.RendererInit"); 162 base::StatsCounterTimer stats_counter_timer("Content.RendererInit");
161 base::StatsScope<base::StatsCounterTimer> startup_timer(stats_counter_timer); 163 base::StatsScope<base::StatsCounterTimer> startup_timer(stats_counter_timer);
162 164
163 RendererMessageLoopObserver task_observer; 165 RendererMessageLoopObserver task_observer;
164 #if defined(OS_MACOSX) 166 #if defined(OS_MACOSX)
165 // As long as we use Cocoa in the renderer (for the forseeable future as of 167 // As long as we use Cocoa in the renderer (for the forseeable future as of
166 // now; see http://crbug.com/13890 for info) we need to have a UI loop. 168 // now; see http://crbug.com/13890 for info) we need to have a UI loop.
167 MessageLoop main_message_loop(MessageLoop::TYPE_UI); 169 MessageLoop main_message_loop(MessageLoop::TYPE_UI);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // For convenience, we print the stack trace for crashes. We can't get 219 // For convenience, we print the stack trace for crashes. We can't get
218 // symbols when the sandbox is enabled, so only try when the sandbox is 220 // symbols when the sandbox is enabled, so only try when the sandbox is
219 // disabled. 221 // disabled.
220 base::EnableInProcessStackDumping(); 222 base::EnableInProcessStackDumping();
221 #endif 223 #endif
222 } 224 }
223 #if defined(OS_POSIX) && !defined(OS_MACOSX) 225 #if defined(OS_POSIX) && !defined(OS_MACOSX)
224 RenderProcessImpl render_process; 226 RenderProcessImpl render_process;
225 new RenderThreadImpl(); 227 new RenderThreadImpl();
226 #endif 228 #endif
227 new content::BrowserPluginManagerImpl(); 229 new BrowserPluginManagerImpl();
228 230
229 platform.RunSandboxTests(); 231 platform.RunSandboxTests();
230 232
231 startup_timer.Stop(); // End of Startup Time Measurement. 233 startup_timer.Stop(); // End of Startup Time Measurement.
232 234
233 if (run_loop) { 235 if (run_loop) {
234 #if defined(OS_MACOSX) 236 #if defined(OS_MACOSX)
235 if (pool) 237 if (pool)
236 pool->Recycle(); 238 pool->Recycle();
237 #endif 239 #endif
238 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); 240 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0);
239 MessageLoop::current()->Run(); 241 MessageLoop::current()->Run();
240 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); 242 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0);
241 } 243 }
242 } 244 }
243 platform.PlatformUninitialize(); 245 platform.PlatformUninitialize();
244 TRACE_EVENT_END_ETW("RendererMain", 0, ""); 246 TRACE_EVENT_END_ETW("RendererMain", 0, "");
245 return 0; 247 return 0;
246 } 248 }
249
250 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/renderer_clipboard_client.cc ('k') | content/renderer/renderer_webapplicationcachehost_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698