| 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 // 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 "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 } | 932 } |
| 933 | 933 |
| 934 bool RenderProcessHostImpl::IsGuest() const { | 934 bool RenderProcessHostImpl::IsGuest() const { |
| 935 return is_guest_; | 935 return is_guest_; |
| 936 } | 936 } |
| 937 | 937 |
| 938 StoragePartition* RenderProcessHostImpl::GetStoragePartition() const { | 938 StoragePartition* RenderProcessHostImpl::GetStoragePartition() const { |
| 939 return storage_partition_impl_; | 939 return storage_partition_impl_; |
| 940 } | 940 } |
| 941 | 941 |
| 942 static void AppendGpuCommandLineFlags(CommandLine* command_line) { | 942 static void AppendCompositorCommandLineFlags(CommandLine* command_line) { |
| 943 if (IsPinchVirtualViewportEnabled()) |
| 944 command_line->AppendSwitch(cc::switches::kEnablePinchVirtualViewport); |
| 945 |
| 943 if (IsThreadedCompositingEnabled()) | 946 if (IsThreadedCompositingEnabled()) |
| 944 command_line->AppendSwitch(switches::kEnableThreadedCompositing); | 947 command_line->AppendSwitch(switches::kEnableThreadedCompositing); |
| 945 | 948 |
| 946 if (IsDelegatedRendererEnabled()) | 949 if (IsDelegatedRendererEnabled()) |
| 947 command_line->AppendSwitch(switches::kEnableDelegatedRenderer); | 950 command_line->AppendSwitch(switches::kEnableDelegatedRenderer); |
| 948 | 951 |
| 949 if (IsImplSidePaintingEnabled()) | 952 if (IsImplSidePaintingEnabled()) |
| 950 command_line->AppendSwitch(switches::kEnableImplSidePainting); | 953 command_line->AppendSwitch(switches::kEnableImplSidePainting); |
| 951 | 954 |
| 952 if (content::IsGpuRasterizationEnabled()) | 955 if (content::IsGpuRasterizationEnabled()) |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 command_line->AppendSwitchASCII(switches::kForceFieldTrials, | 988 command_line->AppendSwitchASCII(switches::kForceFieldTrials, |
| 986 field_trial_states); | 989 field_trial_states); |
| 987 } | 990 } |
| 988 | 991 |
| 989 GetContentClient()->browser()->AppendExtraCommandLineSwitches( | 992 GetContentClient()->browser()->AppendExtraCommandLineSwitches( |
| 990 command_line, GetID()); | 993 command_line, GetID()); |
| 991 | 994 |
| 992 if (content::IsPinchToZoomEnabled()) | 995 if (content::IsPinchToZoomEnabled()) |
| 993 command_line->AppendSwitch(switches::kEnablePinch); | 996 command_line->AppendSwitch(switches::kEnablePinch); |
| 994 | 997 |
| 995 AppendGpuCommandLineFlags(command_line); | 998 AppendCompositorCommandLineFlags(command_line); |
| 996 } | 999 } |
| 997 | 1000 |
| 998 void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( | 1001 void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( |
| 999 const CommandLine& browser_cmd, | 1002 const CommandLine& browser_cmd, |
| 1000 CommandLine* renderer_cmd) const { | 1003 CommandLine* renderer_cmd) const { |
| 1001 // Propagate the following switches to the renderer command line (along | 1004 // Propagate the following switches to the renderer command line (along |
| 1002 // with any associated values) if present in the browser command line. | 1005 // with any associated values) if present in the browser command line. |
| 1003 static const char* const kSwitchNames[] = { | 1006 static const char* const kSwitchNames[] = { |
| 1004 switches::kAllowLoopbackInPeerConnection, | 1007 switches::kAllowLoopbackInPeerConnection, |
| 1005 switches::kAudioBufferSize, | 1008 switches::kAudioBufferSize, |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1128 switches::kWebGLCommandBufferSizeKb, | 1131 switches::kWebGLCommandBufferSizeKb, |
| 1129 // Please keep these in alphabetical order. Compositor switches here should | 1132 // Please keep these in alphabetical order. Compositor switches here should |
| 1130 // also be added to chrome/browser/chromeos/login/chrome_restart_request.cc. | 1133 // also be added to chrome/browser/chromeos/login/chrome_restart_request.cc. |
| 1131 cc::switches::kCompositeToMailbox, | 1134 cc::switches::kCompositeToMailbox, |
| 1132 cc::switches::kDisableCompositedAntialiasing, | 1135 cc::switches::kDisableCompositedAntialiasing, |
| 1133 cc::switches::kDisableCompositorTouchHitTesting, | 1136 cc::switches::kDisableCompositorTouchHitTesting, |
| 1134 cc::switches::kDisableMainFrameBeforeActivation, | 1137 cc::switches::kDisableMainFrameBeforeActivation, |
| 1135 cc::switches::kDisableMainFrameBeforeDraw, | 1138 cc::switches::kDisableMainFrameBeforeDraw, |
| 1136 cc::switches::kDisableThreadedAnimation, | 1139 cc::switches::kDisableThreadedAnimation, |
| 1137 cc::switches::kEnableGpuBenchmarking, | 1140 cc::switches::kEnableGpuBenchmarking, |
| 1138 cc::switches::kEnablePinchVirtualViewport, | |
| 1139 cc::switches::kEnableMainFrameBeforeActivation, | 1141 cc::switches::kEnableMainFrameBeforeActivation, |
| 1140 cc::switches::kEnableTopControlsPositionCalculation, | 1142 cc::switches::kEnableTopControlsPositionCalculation, |
| 1141 cc::switches::kMaxTilesForInterestArea, | 1143 cc::switches::kMaxTilesForInterestArea, |
| 1142 cc::switches::kMaxUnusedResourceMemoryUsagePercentage, | 1144 cc::switches::kMaxUnusedResourceMemoryUsagePercentage, |
| 1143 cc::switches::kShowCompositedLayerBorders, | 1145 cc::switches::kShowCompositedLayerBorders, |
| 1144 cc::switches::kShowFPSCounter, | 1146 cc::switches::kShowFPSCounter, |
| 1145 cc::switches::kShowLayerAnimationBounds, | 1147 cc::switches::kShowLayerAnimationBounds, |
| 1146 cc::switches::kShowNonOccludingRects, | 1148 cc::switches::kShowNonOccludingRects, |
| 1147 cc::switches::kShowOccludingRects, | 1149 cc::switches::kShowOccludingRects, |
| 1148 cc::switches::kShowPropertyChangedRects, | 1150 cc::switches::kShowPropertyChangedRects, |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1636 if (!command_line->HasSwitch(switches::kLang)) { | 1638 if (!command_line->HasSwitch(switches::kLang)) { |
| 1637 // Modify the current process' command line to include the browser locale, | 1639 // Modify the current process' command line to include the browser locale, |
| 1638 // as the renderer expects this flag to be set. | 1640 // as the renderer expects this flag to be set. |
| 1639 const std::string locale = | 1641 const std::string locale = |
| 1640 GetContentClient()->browser()->GetApplicationLocale(); | 1642 GetContentClient()->browser()->GetApplicationLocale(); |
| 1641 command_line->AppendSwitchASCII(switches::kLang, locale); | 1643 command_line->AppendSwitchASCII(switches::kLang, locale); |
| 1642 } | 1644 } |
| 1643 // TODO(piman): we should really send configuration through bools rather | 1645 // TODO(piman): we should really send configuration through bools rather |
| 1644 // than by parsing strings, i.e. sending an IPC rather than command line | 1646 // than by parsing strings, i.e. sending an IPC rather than command line |
| 1645 // args. crbug.com/314909 | 1647 // args. crbug.com/314909 |
| 1646 AppendGpuCommandLineFlags(command_line); | 1648 AppendCompositorCommandLineFlags(command_line); |
| 1647 } | 1649 } |
| 1648 } | 1650 } |
| 1649 | 1651 |
| 1650 // static | 1652 // static |
| 1651 RenderProcessHost::iterator RenderProcessHost::AllHostsIterator() { | 1653 RenderProcessHost::iterator RenderProcessHost::AllHostsIterator() { |
| 1652 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1654 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1653 return iterator(g_all_hosts.Pointer()); | 1655 return iterator(g_all_hosts.Pointer()); |
| 1654 } | 1656 } |
| 1655 | 1657 |
| 1656 // static | 1658 // static |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2064 mojo::ScopedMessagePipeHandle handle) { | 2066 mojo::ScopedMessagePipeHandle handle) { |
| 2065 if (!mojo_application_host_->did_activate()) | 2067 if (!mojo_application_host_->did_activate()) |
| 2066 mojo_application_host_->Activate(this, GetHandle()); | 2068 mojo_application_host_->Activate(this, GetHandle()); |
| 2067 | 2069 |
| 2068 mojo::AllocationScope scope; | 2070 mojo::AllocationScope scope; |
| 2069 mojo_application_host_->shell_client()->AcceptConnection(service_name, | 2071 mojo_application_host_->shell_client()->AcceptConnection(service_name, |
| 2070 handle.Pass()); | 2072 handle.Pass()); |
| 2071 } | 2073 } |
| 2072 | 2074 |
| 2073 } // namespace content | 2075 } // namespace content |
| OLD | NEW |