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

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

Issue 8440027: Change renderer_client interface for registering PPAPI Factories (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update other renderer_clients Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/debug/trace_event.h" 6 #include "base/debug/trace_event.h"
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/metrics/stats_counters.h" 12 #include "base/metrics/stats_counters.h"
13 #include "base/path_service.h" 13 #include "base/path_service.h"
14 #include "base/process_util.h" 14 #include "base/process_util.h"
15 #include "base/string_util.h" 15 #include "base/string_util.h"
16 #include "base/system_monitor/system_monitor.h" 16 #include "base/system_monitor/system_monitor.h"
17 #include "base/threading/platform_thread.h" 17 #include "base/threading/platform_thread.h"
18 #include "base/time.h" 18 #include "base/time.h"
19 #include "content/common/content_counters.h" 19 #include "content/common/content_counters.h"
20 #include "content/common/hi_res_timer_manager.h" 20 #include "content/common/hi_res_timer_manager.h"
21 #include "content/common/pepper_plugin_registry.h" 21 #include "content/common/pepper_plugin_registry.h"
22 #include "content/public/common/content_switches.h" 22 #include "content/public/common/content_switches.h"
23 #include "content/public/common/main_function_params.h" 23 #include "content/public/common/main_function_params.h"
24 #include "content/public/renderer/content_renderer_client.h"
24 #include "content/renderer/render_process_impl.h" 25 #include "content/renderer/render_process_impl.h"
25 #include "content/renderer/render_thread_impl.h" 26 #include "content/renderer/render_thread_impl.h"
26 #include "content/renderer/renderer_main_platform_delegate.h" 27 #include "content/renderer/renderer_main_platform_delegate.h"
27 #include "ui/base/ui_base_switches.h" 28 #include "ui/base/ui_base_switches.h"
29 #include "webkit/plugins/ppapi/ppapi_interface_factory.h"
28 30
29 #if defined(OS_MACOSX) 31 #if defined(OS_MACOSX)
30 #include <Carbon/Carbon.h> 32 #include <Carbon/Carbon.h>
31 #include <signal.h> 33 #include <signal.h>
32 #include <unistd.h> 34 #include <unistd.h>
33 35
34 #include "base/mac/mac_util.h" 36 #include "base/mac/mac_util.h"
35 #include "base/mac/scoped_nsautorelease_pool.h" 37 #include "base/mac/scoped_nsautorelease_pool.h"
36 #include "third_party/mach_override/mach_override.h" 38 #include "third_party/mach_override/mach_override.h"
37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 #endif 146 #endif
145 147
146 // This function allows pausing execution using the --renderer-startup-dialog 148 // This function allows pausing execution using the --renderer-startup-dialog
147 // flag allowing us to attach a debugger. 149 // flag allowing us to attach a debugger.
148 // Do not move this function down since that would mean we can't easily debug 150 // Do not move this function down since that would mean we can't easily debug
149 // whatever occurs before it. 151 // whatever occurs before it.
150 HandleRendererErrorTestParameters(parsed_command_line); 152 HandleRendererErrorTestParameters(parsed_command_line);
151 153
152 RendererMainPlatformDelegate platform(parameters); 154 RendererMainPlatformDelegate platform(parameters);
153 155
156 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager =
157 webkit::ppapi::PpapiInterfaceFactoryManager::GetInstance();
158 content::GetContentClient()->renderer()->RegisterPPAPIInterfaceFactories(
159 factory_manager);
160
154 base::StatsScope<base::StatsCounterTimer> 161 base::StatsScope<base::StatsCounterTimer>
155 startup_timer(content::Counters::renderer_main()); 162 startup_timer(content::Counters::renderer_main());
156 163
157 RendererMessageLoopObserver task_observer; 164 RendererMessageLoopObserver task_observer;
158 #if defined(OS_MACOSX) 165 #if defined(OS_MACOSX)
159 // As long as we use Cocoa in the renderer (for the forseeable future as of 166 // As long as we use Cocoa in the renderer (for the forseeable future as of
160 // now; see http://crbug.com/13890 for info) we need to have a UI loop. 167 // now; see http://crbug.com/13890 for info) we need to have a UI loop.
161 MessageLoop main_message_loop(MessageLoop::TYPE_UI); 168 MessageLoop main_message_loop(MessageLoop::TYPE_UI);
162 #else 169 #else
163 // The main message loop of the renderer services doesn't have IO or UI tasks, 170 // The main message loop of the renderer services doesn't have IO or UI tasks,
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 #endif 235 #endif
229 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); 236 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0);
230 MessageLoop::current()->Run(); 237 MessageLoop::current()->Run();
231 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); 238 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0);
232 } 239 }
233 } 240 }
234 platform.PlatformUninitialize(); 241 platform.PlatformUninitialize();
235 TRACE_EVENT_END_ETW("RendererMain", 0, ""); 242 TRACE_EVENT_END_ETW("RendererMain", 0, "");
236 return 0; 243 return 0;
237 } 244 }
OLDNEW
« no previous file with comments | « content/renderer/mock_content_renderer_client.cc ('k') | content/shell/shell_content_renderer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698