[email protected] | d977f9c | 2011-03-14 16:10:26 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | |
[email protected] | b80f6843 | 2011-05-02 17:22:30 | [diff] [blame] | 7 | #include "base/command_line.h" |
| 8 | #include "chrome/app/breakpad_mac.h" |
| 9 | #include "chrome/browser/browser_process.h" |
[email protected] | 763ec4ca | 2011-04-29 15:48:12 | [diff] [blame] | 10 | #include "chrome/browser/character_encoding.h" |
[email protected] | 97e6c4c | 2011-05-18 16:08:51 | [diff] [blame^] | 11 | #include "chrome/browser/chrome_plugin_message_filter.h" |
[email protected] | 5327dfb | 2011-05-03 17:50:36 | [diff] [blame] | 12 | #include "chrome/browser/chrome_worker_message_filter.h" |
[email protected] | a217679 | 2011-05-08 19:30:49 | [diff] [blame] | 13 | #include "chrome/browser/content_settings/host_content_settings_map.h" |
[email protected] | 8093a54 | 2011-05-13 07:29:32 | [diff] [blame] | 14 | #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
[email protected] | f364d139 | 2011-04-08 21:03:10 | [diff] [blame] | 15 | #include "chrome/browser/debugger/devtools_handler.h" |
| 16 | #include "chrome/browser/desktop_notification_handler.h" |
[email protected] | f364d139 | 2011-04-08 21:03:10 | [diff] [blame] | 17 | #include "chrome/browser/extensions/extension_message_handler.h" |
[email protected] | d977f9c | 2011-03-14 16:10:26 | [diff] [blame] | 18 | #include "chrome/browser/extensions/extension_service.h" |
[email protected] | 763ec4ca | 2011-04-29 15:48:12 | [diff] [blame] | 19 | #include "chrome/browser/google/google_util.h" |
| 20 | #include "chrome/browser/prefs/pref_service.h" |
[email protected] | 05fcf98 | 2011-04-19 00:44:14 | [diff] [blame] | 21 | #include "chrome/browser/printing/printing_message_filter.h" |
| 22 | #include "chrome/browser/profiles/profile.h" |
[email protected] | 8093a54 | 2011-05-13 07:29:32 | [diff] [blame] | 23 | #include "chrome/browser/profiles/profile_io_data.h" |
[email protected] | 05fcf98 | 2011-04-19 00:44:14 | [diff] [blame] | 24 | #include "chrome/browser/renderer_host/chrome_render_message_filter.h" |
[email protected] | 53a0afa | 2011-04-28 02:09:33 | [diff] [blame] | 25 | #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h" |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 26 | #include "chrome/browser/renderer_host/text_input_client_message_filter.h" |
[email protected] | 05fcf98 | 2011-04-19 00:44:14 | [diff] [blame] | 27 | #include "chrome/browser/search_engines/search_provider_install_state_message_filter.h" |
| 28 | #include "chrome/browser/spellcheck_message_filter.h" |
[email protected] | 1fd1a50 | 2011-03-30 16:55:56 | [diff] [blame] | 29 | #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" |
[email protected] | b80f6843 | 2011-05-02 17:22:30 | [diff] [blame] | 30 | #include "chrome/common/child_process_logging.h" |
| 31 | #include "chrome/common/chrome_switches.h" |
[email protected] | c5dbef0 | 2011-05-13 05:06:09 | [diff] [blame] | 32 | #include "chrome/common/extensions/extension_messages.h" |
[email protected] | 763ec4ca | 2011-04-29 15:48:12 | [diff] [blame] | 33 | #include "chrome/common/pref_names.h" |
[email protected] | c5dbef0 | 2011-05-13 05:06:09 | [diff] [blame] | 34 | #include "chrome/common/url_constants.h" |
| 35 | #include "content/browser/browsing_instance.h" |
| 36 | #include "content/browser/child_process_security_policy.h" |
[email protected] | 97e6c4c | 2011-05-18 16:08:51 | [diff] [blame^] | 37 | #include "content/browser/plugin_process_host.h" |
[email protected] | 05fcf98 | 2011-04-19 00:44:14 | [diff] [blame] | 38 | #include "content/browser/renderer_host/browser_render_process_host.h" |
[email protected] | d977f9c | 2011-03-14 16:10:26 | [diff] [blame] | 39 | #include "content/browser/renderer_host/render_view_host.h" |
[email protected] | a217679 | 2011-05-08 19:30:49 | [diff] [blame] | 40 | #include "content/browser/resource_context.h" |
[email protected] | c5dbef0 | 2011-05-13 05:06:09 | [diff] [blame] | 41 | #include "content/browser/site_instance.h" |
[email protected] | 763ec4ca | 2011-04-29 15:48:12 | [diff] [blame] | 42 | #include "content/browser/tab_contents/tab_contents.h" |
[email protected] | 5327dfb | 2011-05-03 17:50:36 | [diff] [blame] | 43 | #include "content/browser/worker_host/worker_process_host.h" |
[email protected] | c5dbef0 | 2011-05-13 05:06:09 | [diff] [blame] | 44 | #include "content/common/bindings_policy.h" |
[email protected] | ed24fad | 2011-05-10 22:44:01 | [diff] [blame] | 45 | #include "net/base/cookie_monster.h" |
| 46 | #include "net/base/cookie_options.h" |
| 47 | #include "net/base/static_cookie_policy.h" |
[email protected] | d977f9c | 2011-03-14 16:10:26 | [diff] [blame] | 48 | |
[email protected] | b80f6843 | 2011-05-02 17:22:30 | [diff] [blame] | 49 | #if defined(OS_LINUX) |
| 50 | #include "base/linux_util.h" |
| 51 | #include "chrome/browser/crash_handler_host_linux.h" |
| 52 | #endif // OS_LINUX |
| 53 | |
[email protected] | c5dbef0 | 2011-05-13 05:06:09 | [diff] [blame] | 54 | namespace { |
| 55 | |
| 56 | void InitRenderViewHostForExtensions(RenderViewHost* render_view_host) { |
| 57 | // Note that due to GetEffectiveURL(), even hosted apps will have a |
| 58 | // chrome-extension:// URL for their site, so we can ignore that wrinkle here. |
| 59 | SiteInstance* site_instance = render_view_host->site_instance(); |
| 60 | const GURL& site = site_instance->site(); |
| 61 | RenderProcessHost* process = render_view_host->process(); |
| 62 | |
| 63 | if (!site.SchemeIs(chrome::kExtensionScheme)) |
| 64 | return; |
| 65 | |
| 66 | Profile* profile = site_instance->browsing_instance()->profile(); |
| 67 | ExtensionService* service = profile->GetExtensionService(); |
| 68 | if (!service) |
| 69 | return; |
| 70 | |
| 71 | ExtensionProcessManager* process_manager = |
| 72 | profile->GetExtensionProcessManager(); |
| 73 | CHECK(process_manager); |
| 74 | |
| 75 | // This can happen if somebody typos a chrome-extension:// URL. |
| 76 | const Extension* extension = service->GetExtensionByURL(site); |
| 77 | if (!extension) |
| 78 | return; |
| 79 | |
| 80 | site_instance->GetProcess()->mark_is_extension_process(); |
| 81 | |
| 82 | // Register the association between extension and process with |
| 83 | // ExtensionProcessManager. |
| 84 | process_manager->RegisterExtensionProcess(extension->id(), process->id()); |
| 85 | |
| 86 | // Record which, if any, installed app is associated with this process. |
| 87 | // TODO(aa): Totally lame to store this state in a global map in extension |
| 88 | // service. Can we get it from EPM instead? |
| 89 | if (extension->is_app()) |
| 90 | service->SetInstalledAppForRenderer(process->id(), extension); |
| 91 | |
| 92 | // Some extensions use chrome:// URLs. |
| 93 | Extension::Type type = extension->GetType(); |
| 94 | if (type == Extension::TYPE_EXTENSION || |
| 95 | type == Extension::TYPE_PACKAGED_APP) { |
| 96 | ChildProcessSecurityPolicy::GetInstance()->GrantScheme( |
| 97 | process->id(), chrome::kChromeUIScheme); |
| 98 | } |
| 99 | |
| 100 | // Enable extension bindings for the renderer. Currently only extensions, |
| 101 | // packaged apps, and hosted component apps use extension bindings. |
| 102 | if (type == Extension::TYPE_EXTENSION || |
| 103 | type == Extension::TYPE_PACKAGED_APP || |
| 104 | (type == Extension::TYPE_HOSTED_APP && |
| 105 | extension->location() == Extension::COMPONENT)) { |
| 106 | render_view_host->Send(new ExtensionMsg_ActivateExtension(extension->id())); |
| 107 | render_view_host->AllowBindings(BindingsPolicy::EXTENSION); |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | } |
| 112 | |
[email protected] | d977f9c | 2011-03-14 16:10:26 | [diff] [blame] | 113 | namespace chrome { |
| 114 | |
[email protected] | f364d139 | 2011-04-08 21:03:10 | [diff] [blame] | 115 | void ChromeContentBrowserClient::RenderViewHostCreated( |
| 116 | RenderViewHost* render_view_host) { |
[email protected] | 53a0afa | 2011-04-28 02:09:33 | [diff] [blame] | 117 | new ChromeRenderViewHostObserver(render_view_host); |
[email protected] | f364d139 | 2011-04-08 21:03:10 | [diff] [blame] | 118 | new DesktopNotificationHandler(render_view_host); |
| 119 | new DevToolsHandler(render_view_host); |
| 120 | new ExtensionMessageHandler(render_view_host); |
[email protected] | f364d139 | 2011-04-08 21:03:10 | [diff] [blame] | 121 | |
[email protected] | c5dbef0 | 2011-05-13 05:06:09 | [diff] [blame] | 122 | InitRenderViewHostForExtensions(render_view_host); |
[email protected] | d977f9c | 2011-03-14 16:10:26 | [diff] [blame] | 123 | } |
| 124 | |
[email protected] | 05fcf98 | 2011-04-19 00:44:14 | [diff] [blame] | 125 | void ChromeContentBrowserClient::BrowserRenderProcessHostCreated( |
| 126 | BrowserRenderProcessHost* host) { |
[email protected] | c47cfd6 | 2011-04-29 21:27:02 | [diff] [blame] | 127 | int id = host->id(); |
| 128 | Profile* profile = host->profile(); |
[email protected] | 05fcf98 | 2011-04-19 00:44:14 | [diff] [blame] | 129 | host->channel()->AddFilter(new ChromeRenderMessageFilter( |
[email protected] | c47cfd6 | 2011-04-29 21:27:02 | [diff] [blame] | 130 | id, profile, profile->GetRequestContextForRenderProcess(id))); |
[email protected] | 05fcf98 | 2011-04-19 00:44:14 | [diff] [blame] | 131 | host->channel()->AddFilter(new PrintingMessageFilter()); |
| 132 | host->channel()->AddFilter( |
[email protected] | c47cfd6 | 2011-04-29 21:27:02 | [diff] [blame] | 133 | new SearchProviderInstallStateMessageFilter(id, profile)); |
| 134 | host->channel()->AddFilter(new SpellCheckMessageFilter(id)); |
[email protected] | d4cff27 | 2011-05-02 15:46:01 | [diff] [blame] | 135 | #if defined(OS_MACOSX) |
| 136 | host->channel()->AddFilter(new TextInputClientMessageFilter(host->id())); |
| 137 | #endif |
[email protected] | 05fcf98 | 2011-04-19 00:44:14 | [diff] [blame] | 138 | } |
| 139 | |
[email protected] | 97e6c4c | 2011-05-18 16:08:51 | [diff] [blame^] | 140 | void ChromeContentBrowserClient::PluginProcessHostCreated( |
| 141 | PluginProcessHost* host) { |
| 142 | host->AddFilter(new ChromePluginMessageFilter(host)); |
| 143 | } |
| 144 | |
[email protected] | 5327dfb | 2011-05-03 17:50:36 | [diff] [blame] | 145 | void ChromeContentBrowserClient::WorkerProcessHostCreated( |
| 146 | WorkerProcessHost* host) { |
| 147 | host->AddFilter(new ChromeWorkerMessageFilter(host)); |
| 148 | } |
| 149 | |
[email protected] | 1fd1a50 | 2011-03-30 16:55:56 | [diff] [blame] | 150 | content::WebUIFactory* ChromeContentBrowserClient::GetWebUIFactory() { |
| 151 | return ChromeWebUIFactory::GetInstance(); |
| 152 | } |
| 153 | |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 154 | GURL ChromeContentBrowserClient::GetEffectiveURL(Profile* profile, |
| 155 | const GURL& url) { |
| 156 | // Get the effective URL for the given actual URL. If the URL is part of an |
| 157 | // installed app, the effective URL is an extension URL with the ID of that |
| 158 | // extension as the host. This has the effect of grouping apps together in |
| 159 | // a common SiteInstance. |
| 160 | if (!profile || !profile->GetExtensionService()) |
| 161 | return url; |
| 162 | |
| 163 | const Extension* extension = |
| 164 | profile->GetExtensionService()->GetExtensionByWebExtent(url); |
| 165 | if (!extension) |
| 166 | return url; |
| 167 | |
| 168 | // If the URL is part of an extension's web extent, convert it to an |
| 169 | // extension URL. |
| 170 | return extension->GetResourceURL(url.path()); |
| 171 | } |
| 172 | |
[email protected] | 763ec4ca | 2011-04-29 15:48:12 | [diff] [blame] | 173 | GURL ChromeContentBrowserClient::GetAlternateErrorPageURL( |
| 174 | const TabContents* tab) { |
| 175 | GURL url; |
| 176 | // Disable alternate error pages when in OffTheRecord/Incognito mode. |
| 177 | if (tab->profile()->IsOffTheRecord()) |
| 178 | return url; |
| 179 | |
| 180 | PrefService* prefs = tab->profile()->GetPrefs(); |
| 181 | DCHECK(prefs); |
| 182 | if (prefs->GetBoolean(prefs::kAlternateErrorPagesEnabled)) { |
| 183 | url = google_util::AppendGoogleLocaleParam( |
| 184 | GURL(google_util::kLinkDoctorBaseURL)); |
| 185 | url = google_util::AppendGoogleTLDParam(url); |
| 186 | } |
| 187 | return url; |
| 188 | } |
| 189 | |
| 190 | std::string ChromeContentBrowserClient::GetCanonicalEncodingNameByAliasName( |
| 191 | const std::string& alias_name) { |
| 192 | return CharacterEncoding::GetCanonicalEncodingNameByAliasName(alias_name); |
| 193 | } |
| 194 | |
[email protected] | b80f6843 | 2011-05-02 17:22:30 | [diff] [blame] | 195 | void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( |
| 196 | CommandLine* command_line, int child_process_id) { |
| 197 | #if defined(USE_LINUX_BREAKPAD) |
| 198 | if (IsCrashReporterEnabled()) { |
| 199 | command_line->AppendSwitchASCII(switches::kEnableCrashReporter, |
| 200 | child_process_logging::GetClientId() + "," + base::GetLinuxDistro()); |
| 201 | } |
| 202 | #elif defined(OS_MACOSX) |
| 203 | if (IsCrashReporterEnabled()) { |
| 204 | command_line->AppendSwitchASCII(switches::kEnableCrashReporter, |
| 205 | child_process_logging::GetClientId()); |
| 206 | } |
| 207 | #endif // OS_MACOSX |
| 208 | |
| 209 | std::string process_type = |
| 210 | command_line->GetSwitchValueASCII(switches::kProcessType); |
| 211 | if (process_type == switches::kExtensionProcess || |
| 212 | process_type == switches::kRendererProcess) { |
| 213 | const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
| 214 | FilePath user_data_dir = |
| 215 | browser_command_line.GetSwitchValuePath(switches::kUserDataDir); |
| 216 | if (!user_data_dir.empty()) |
| 217 | command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir); |
| 218 | #if defined(OS_CHROMEOS) |
| 219 | const std::string& login_profile = |
| 220 | browser_command_line.GetSwitchValueASCII(switches::kLoginProfile); |
| 221 | if (!login_profile.empty()) |
| 222 | command_line->AppendSwitchASCII(switches::kLoginProfile, login_profile); |
| 223 | #endif |
| 224 | |
| 225 | RenderProcessHost* process = RenderProcessHost::FromID(child_process_id); |
| 226 | |
| 227 | PrefService* prefs = process->profile()->GetPrefs(); |
| 228 | // Currently this pref is only registered if applied via a policy. |
| 229 | if (prefs->HasPrefPath(prefs::kDisable3DAPIs) && |
| 230 | prefs->GetBoolean(prefs::kDisable3DAPIs)) { |
| 231 | // Turn this policy into a command line switch. |
| 232 | command_line->AppendSwitch(switches::kDisable3DAPIs); |
| 233 | } |
| 234 | |
| 235 | // Disable client-side phishing detection in the renderer if it is disabled |
| 236 | // in the browser process. |
| 237 | if (!g_browser_process->safe_browsing_detection_service()) |
| 238 | command_line->AppendSwitch(switches::kDisableClientSidePhishingDetection); |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | std::string ChromeContentBrowserClient::GetApplicationLocale() { |
| 243 | return g_browser_process->GetApplicationLocale(); |
| 244 | } |
| 245 | |
[email protected] | a217679 | 2011-05-08 19:30:49 | [diff] [blame] | 246 | bool ChromeContentBrowserClient::AllowAppCache( |
[email protected] | ed24fad | 2011-05-10 22:44:01 | [diff] [blame] | 247 | const GURL& manifest_url, const content::ResourceContext& context) { |
[email protected] | 8093a54 | 2011-05-13 07:29:32 | [diff] [blame] | 248 | DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 249 | ProfileIOData* io_data = |
| 250 | reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL)); |
[email protected] | efa5521 | 2011-05-13 16:19:38 | [diff] [blame] | 251 | ContentSetting setting = io_data->GetHostContentSettingsMap()-> |
[email protected] | a217679 | 2011-05-08 19:30:49 | [diff] [blame] | 252 | GetContentSetting(manifest_url, CONTENT_SETTINGS_TYPE_COOKIES, ""); |
| 253 | DCHECK(setting != CONTENT_SETTING_DEFAULT); |
| 254 | return setting != CONTENT_SETTING_BLOCK; |
| 255 | } |
| 256 | |
[email protected] | ed24fad | 2011-05-10 22:44:01 | [diff] [blame] | 257 | bool ChromeContentBrowserClient::AllowGetCookie( |
| 258 | const GURL& url, |
| 259 | const GURL& first_party, |
| 260 | const net::CookieList& cookie_list, |
| 261 | const content::ResourceContext& context, |
| 262 | int render_process_id, |
| 263 | int render_view_id) { |
| 264 | DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 265 | bool allow = true; |
[email protected] | 8093a54 | 2011-05-13 07:29:32 | [diff] [blame] | 266 | ProfileIOData* io_data = |
| 267 | reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL)); |
[email protected] | efa5521 | 2011-05-13 16:19:38 | [diff] [blame] | 268 | if (io_data->GetHostContentSettingsMap()->BlockThirdPartyCookies()) { |
[email protected] | ed24fad | 2011-05-10 22:44:01 | [diff] [blame] | 269 | bool strict = CommandLine::ForCurrentProcess()->HasSwitch( |
| 270 | switches::kBlockReadingThirdPartyCookies); |
| 271 | net::StaticCookiePolicy policy(strict ? |
| 272 | net::StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES : |
| 273 | net::StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES); |
| 274 | int rv = policy.CanGetCookies(url, first_party); |
| 275 | DCHECK_NE(net::ERR_IO_PENDING, rv); |
| 276 | if (rv != net::OK) |
| 277 | allow = false; |
| 278 | } |
| 279 | |
| 280 | if (allow) { |
[email protected] | efa5521 | 2011-05-13 16:19:38 | [diff] [blame] | 281 | ContentSetting setting = io_data->GetHostContentSettingsMap()-> |
[email protected] | ed24fad | 2011-05-10 22:44:01 | [diff] [blame] | 282 | GetContentSetting(url, CONTENT_SETTINGS_TYPE_COOKIES, ""); |
| 283 | allow = setting == CONTENT_SETTING_ALLOW || |
| 284 | setting == CONTENT_SETTING_SESSION_ONLY; |
| 285 | } |
| 286 | |
[email protected] | 8093a54 | 2011-05-13 07:29:32 | [diff] [blame] | 287 | BrowserThread::PostTask( |
| 288 | BrowserThread::UI, FROM_HERE, |
| 289 | NewRunnableFunction( |
| 290 | &TabSpecificContentSettings::CookiesRead, |
| 291 | render_process_id, render_view_id, url, cookie_list, !allow)); |
[email protected] | ed24fad | 2011-05-10 22:44:01 | [diff] [blame] | 292 | return allow; |
| 293 | } |
| 294 | |
| 295 | bool ChromeContentBrowserClient::AllowSetCookie( |
| 296 | const GURL& url, |
| 297 | const GURL& first_party, |
| 298 | const std::string& cookie_line, |
| 299 | const content::ResourceContext& context, |
| 300 | int render_process_id, |
| 301 | int render_view_id, |
| 302 | net::CookieOptions* options) { |
| 303 | DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 304 | bool allow = true; |
[email protected] | 8093a54 | 2011-05-13 07:29:32 | [diff] [blame] | 305 | ProfileIOData* io_data = |
| 306 | reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL)); |
[email protected] | efa5521 | 2011-05-13 16:19:38 | [diff] [blame] | 307 | if (io_data->GetHostContentSettingsMap()->BlockThirdPartyCookies()) { |
[email protected] | ed24fad | 2011-05-10 22:44:01 | [diff] [blame] | 308 | bool strict = CommandLine::ForCurrentProcess()->HasSwitch( |
| 309 | switches::kBlockReadingThirdPartyCookies); |
| 310 | net::StaticCookiePolicy policy(strict ? |
| 311 | net::StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES : |
| 312 | net::StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES); |
| 313 | int rv = policy.CanSetCookie(url, first_party, cookie_line); |
| 314 | if (rv != net::OK) |
| 315 | allow = false; |
| 316 | } |
| 317 | |
| 318 | if (allow) { |
[email protected] | efa5521 | 2011-05-13 16:19:38 | [diff] [blame] | 319 | ContentSetting setting = io_data->GetHostContentSettingsMap()-> |
[email protected] | ed24fad | 2011-05-10 22:44:01 | [diff] [blame] | 320 | GetContentSetting(url, CONTENT_SETTINGS_TYPE_COOKIES, ""); |
| 321 | |
| 322 | if (setting == CONTENT_SETTING_SESSION_ONLY) |
| 323 | options->set_force_session(); |
| 324 | |
| 325 | allow = setting == CONTENT_SETTING_ALLOW || |
| 326 | setting == CONTENT_SETTING_SESSION_ONLY; |
| 327 | } |
| 328 | |
[email protected] | 8093a54 | 2011-05-13 07:29:32 | [diff] [blame] | 329 | BrowserThread::PostTask( |
| 330 | BrowserThread::UI, FROM_HERE, |
| 331 | NewRunnableFunction( |
| 332 | &TabSpecificContentSettings::CookieChanged, |
| 333 | render_process_id, render_view_id, url, cookie_line, *options, |
| 334 | !allow)); |
[email protected] | ed24fad | 2011-05-10 22:44:01 | [diff] [blame] | 335 | return allow; |
| 336 | } |
| 337 | |
[email protected] | b80f6843 | 2011-05-02 17:22:30 | [diff] [blame] | 338 | #if defined(OS_LINUX) |
| 339 | int ChromeContentBrowserClient::GetCrashSignalFD( |
| 340 | const std::string& process_type) { |
| 341 | if (process_type == switches::kRendererProcess) |
| 342 | return RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
| 343 | |
| 344 | if (process_type == switches::kPluginProcess) |
| 345 | return PluginCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
| 346 | |
| 347 | if (process_type == switches::kPpapiPluginProcess) |
| 348 | return PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
| 349 | |
| 350 | if (process_type == switches::kGpuProcess) |
| 351 | return GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
| 352 | |
| 353 | return -1; |
| 354 | } |
| 355 | #endif |
| 356 | |
[email protected] | d977f9c | 2011-03-14 16:10:26 | [diff] [blame] | 357 | } // namespace chrome |