OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "chrome/browser/renderer_host/browser_render_process_host.h" | 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 // As a preventive mesure, we DCHECK if someone sends a synchronous message | 282 // As a preventive mesure, we DCHECK if someone sends a synchronous message |
283 // with no time-out, which in the context of the browser process we should not | 283 // with no time-out, which in the context of the browser process we should not |
284 // be doing. | 284 // be doing. |
285 channel_->set_sync_messages_with_no_timeout_allowed(false); | 285 channel_->set_sync_messages_with_no_timeout_allowed(false); |
286 | 286 |
287 // Build command line for renderer, we have to quote the executable name to | 287 // Build command line for renderer, we have to quote the executable name to |
288 // deal with spaces. | 288 // deal with spaces. |
289 CommandLine cmd_line(renderer_path); | 289 CommandLine cmd_line(renderer_path); |
290 cmd_line.AppendSwitchWithValue(switches::kProcessChannelID, | 290 cmd_line.AppendSwitchWithValue(switches::kProcessChannelID, |
291 ASCIIToWide(channel_id)); | 291 ASCIIToWide(channel_id)); |
292 if (is_extensions_process) { | 292 if (is_extensions_process) |
293 cmd_line.AppendSwitch(switches::kEnableDatabases); | 293 cmd_line.AppendSwitch(switches::kEnableDatabases); |
294 cmd_line.AppendSwitch(switches::kEnableLocalStorage); | |
295 } | |
296 bool has_cmd_prefix; | 294 bool has_cmd_prefix; |
297 AppendRendererCommandLine(&cmd_line, &has_cmd_prefix); | 295 AppendRendererCommandLine(&cmd_line, &has_cmd_prefix); |
298 | 296 |
299 if (run_renderer_in_process()) { | 297 if (run_renderer_in_process()) { |
300 // Crank up a thread and run the initialization there. With the way that | 298 // Crank up a thread and run the initialization there. With the way that |
301 // messages flow between the browser and renderer, this thread is required | 299 // messages flow between the browser and renderer, this thread is required |
302 // to prevent a deadlock in single-process mode. Since the primordial | 300 // to prevent a deadlock in single-process mode. Since the primordial |
303 // thread in the renderer process runs the WebKit code and can sometimes | 301 // thread in the renderer process runs the WebKit code and can sometimes |
304 // make blocking calls to the UI thread (i.e. this thread), they need to run | 302 // make blocking calls to the UI thread (i.e. this thread), they need to run |
305 // on separate threads. | 303 // on separate threads. |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 switches::kUseLowFragHeapCrt, | 517 switches::kUseLowFragHeapCrt, |
520 switches::kEnableStatsTable, | 518 switches::kEnableStatsTable, |
521 switches::kExperimentalSpellcheckerFeatures, | 519 switches::kExperimentalSpellcheckerFeatures, |
522 switches::kDisableAudio, | 520 switches::kDisableAudio, |
523 switches::kSimpleDataSource, | 521 switches::kSimpleDataSource, |
524 switches::kEnableBenchmarking, | 522 switches::kEnableBenchmarking, |
525 switches::kInternalNaCl, | 523 switches::kInternalNaCl, |
526 switches::kEnableDatabases, | 524 switches::kEnableDatabases, |
527 switches::kDisableByteRangeSupport, | 525 switches::kDisableByteRangeSupport, |
528 switches::kDisableWebSockets, | 526 switches::kDisableWebSockets, |
529 switches::kEnableLocalStorage, | 527 switches::kDisableLocalStorage, |
530 switches::kEnableSessionStorage, | 528 switches::kEnableSessionStorage, |
531 switches::kEnableDesktopNotifications, | 529 switches::kEnableDesktopNotifications, |
532 // We propagate the Chrome Frame command line here as well in case the | 530 // We propagate the Chrome Frame command line here as well in case the |
533 // renderer is not run in the sandbox. | 531 // renderer is not run in the sandbox. |
534 switches::kChromeFrame, | 532 switches::kChromeFrame, |
535 #if defined(OS_MACOSX) | 533 #if defined(OS_MACOSX) |
536 // Allow this to be set when invoking the browser and relayed along. | 534 // Allow this to be set when invoking the browser and relayed along. |
537 switches::kEnableSandboxLogging, | 535 switches::kEnableSandboxLogging, |
538 #endif | 536 #endif |
539 }; | 537 }; |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 profile()->GetExtensionMessageService()->RemoveEventListener( | 1038 profile()->GetExtensionMessageService()->RemoveEventListener( |
1041 event_name, id()); | 1039 event_name, id()); |
1042 } | 1040 } |
1043 } | 1041 } |
1044 | 1042 |
1045 void BrowserRenderProcessHost::OnExtensionCloseChannel(int port_id) { | 1043 void BrowserRenderProcessHost::OnExtensionCloseChannel(int port_id) { |
1046 if (profile()->GetExtensionMessageService()) { | 1044 if (profile()->GetExtensionMessageService()) { |
1047 profile()->GetExtensionMessageService()->CloseChannel(port_id); | 1045 profile()->GetExtensionMessageService()->CloseChannel(port_id); |
1048 } | 1046 } |
1049 } | 1047 } |
OLD | NEW |