| 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 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 return storage_partition_impl_; | 906 return storage_partition_impl_; |
| 907 } | 907 } |
| 908 | 908 |
| 909 static void AppendGpuCommandLineFlags(CommandLine* command_line) { | 909 static void AppendGpuCommandLineFlags(CommandLine* command_line) { |
| 910 if (content::IsThreadedCompositingEnabled()) | 910 if (content::IsThreadedCompositingEnabled()) |
| 911 command_line->AppendSwitch(switches::kEnableThreadedCompositing); | 911 command_line->AppendSwitch(switches::kEnableThreadedCompositing); |
| 912 | 912 |
| 913 if (content::IsDelegatedRendererEnabled()) | 913 if (content::IsDelegatedRendererEnabled()) |
| 914 command_line->AppendSwitch(switches::kEnableDelegatedRenderer); | 914 command_line->AppendSwitch(switches::kEnableDelegatedRenderer); |
| 915 | 915 |
| 916 if (content::IsImplSidePaintingEnabled()) |
| 917 command_line->AppendSwitch(switches::kEnableImplSidePainting); |
| 918 |
| 916 // Appending disable-gpu-feature switches due to software rendering list. | 919 // Appending disable-gpu-feature switches due to software rendering list. |
| 917 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | 920 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
| 918 DCHECK(gpu_data_manager); | 921 DCHECK(gpu_data_manager); |
| 919 gpu_data_manager->AppendRendererCommandLine(command_line); | 922 gpu_data_manager->AppendRendererCommandLine(command_line); |
| 920 } | 923 } |
| 921 | 924 |
| 922 void RenderProcessHostImpl::AppendRendererCommandLine( | 925 void RenderProcessHostImpl::AppendRendererCommandLine( |
| 923 CommandLine* command_line) const { | 926 CommandLine* command_line) const { |
| 924 // Pass the process type first, so it shows first in process listings. | 927 // Pass the process type first, so it shows first in process listings. |
| 925 command_line->AppendSwitchASCII(switches::kProcessType, | 928 command_line->AppendSwitchASCII(switches::kProcessType, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 switches::kDisableCompositingForFixedPosition, | 981 switches::kDisableCompositingForFixedPosition, |
| 979 switches::kDisableCompositingForTransition, | 982 switches::kDisableCompositingForTransition, |
| 980 switches::kDisableDatabases, | 983 switches::kDisableDatabases, |
| 981 switches::kDisableDelegatedRenderer, | 984 switches::kDisableDelegatedRenderer, |
| 982 switches::kDisableDesktopNotifications, | 985 switches::kDisableDesktopNotifications, |
| 983 switches::kDisableDirectNPAPIRequests, | 986 switches::kDisableDirectNPAPIRequests, |
| 984 switches::kDisableFileSystem, | 987 switches::kDisableFileSystem, |
| 985 switches::kDisableFiltersOverIPC, | 988 switches::kDisableFiltersOverIPC, |
| 986 switches::kDisableGpu, | 989 switches::kDisableGpu, |
| 987 switches::kDisableGpuCompositing, | 990 switches::kDisableGpuCompositing, |
| 991 switches::kDisableGpuRasterization, |
| 988 switches::kDisableGpuVsync, | 992 switches::kDisableGpuVsync, |
| 989 switches::kDisableHistogramCustomizer, | 993 switches::kDisableHistogramCustomizer, |
| 994 switches::kDisableImplSidePainting, |
| 995 switches::kDisableLCDText, |
| 990 switches::kDisableLayerSquashing, | 996 switches::kDisableLayerSquashing, |
| 991 switches::kDisableLocalStorage, | 997 switches::kDisableLocalStorage, |
| 992 switches::kDisableLogging, | 998 switches::kDisableLogging, |
| 999 switches::kDisableMapImage, |
| 993 switches::kDisableOverlayScrollbar, | 1000 switches::kDisableOverlayScrollbar, |
| 994 switches::kDisablePinch, | 1001 switches::kDisablePinch, |
| 995 switches::kDisablePrefixedEncryptedMedia, | 1002 switches::kDisablePrefixedEncryptedMedia, |
| 996 switches::kDisableRepaintAfterLayout, | 1003 switches::kDisableRepaintAfterLayout, |
| 997 switches::kDisableSeccompFilterSandbox, | 1004 switches::kDisableSeccompFilterSandbox, |
| 998 switches::kDisableSessionStorage, | 1005 switches::kDisableSessionStorage, |
| 999 switches::kDisableSharedWorkers, | 1006 switches::kDisableSharedWorkers, |
| 1000 switches::kDisableSpeechInput, | 1007 switches::kDisableSpeechInput, |
| 1001 switches::kDisableThreadedCompositing, | 1008 switches::kDisableThreadedCompositing, |
| 1002 switches::kDisableTouchAdjustment, | 1009 switches::kDisableTouchAdjustment, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1020 switches::kEnableDCHECK, | 1027 switches::kEnableDCHECK, |
| 1021 switches::kEnableDeferredImageDecoding, | 1028 switches::kEnableDeferredImageDecoding, |
| 1022 switches::kEnableDelegatedRenderer, | 1029 switches::kEnableDelegatedRenderer, |
| 1023 switches::kEnableEncryptedMedia, | 1030 switches::kEnableEncryptedMedia, |
| 1024 switches::kEnableExperimentalCanvasFeatures, | 1031 switches::kEnableExperimentalCanvasFeatures, |
| 1025 switches::kEnableExperimentalWebPlatformFeatures, | 1032 switches::kEnableExperimentalWebPlatformFeatures, |
| 1026 switches::kEnableExperimentalWebSocket, | 1033 switches::kEnableExperimentalWebSocket, |
| 1027 switches::kEnableFastTextAutosizing, | 1034 switches::kEnableFastTextAutosizing, |
| 1028 switches::kEnableGPUClientLogging, | 1035 switches::kEnableGPUClientLogging, |
| 1029 switches::kEnableGpuClientTracing, | 1036 switches::kEnableGpuClientTracing, |
| 1037 switches::kEnableGpuRasterization, |
| 1030 switches::kEnableGPUServiceLogging, | 1038 switches::kEnableGPUServiceLogging, |
| 1031 switches::kEnableHighDpiCompositingForFixedPosition, | 1039 switches::kEnableHighDpiCompositingForFixedPosition, |
| 1032 switches::kEnableHTMLImports, | 1040 switches::kEnableHTMLImports, |
| 1041 switches::kEnableImplSidePainting, |
| 1033 switches::kEnableInbandTextTracks, | 1042 switches::kEnableInbandTextTracks, |
| 1043 switches::kEnableLCDText, |
| 1034 switches::kEnableLayerSquashing, | 1044 switches::kEnableLayerSquashing, |
| 1035 switches::kEnableLogging, | 1045 switches::kEnableLogging, |
| 1036 switches::kEnableMP3StreamParser, | 1046 switches::kEnableMP3StreamParser, |
| 1047 switches::kEnableMapImage, |
| 1037 switches::kEnableMemoryBenchmarking, | 1048 switches::kEnableMemoryBenchmarking, |
| 1038 switches::kEnableOverlayFullscreenVideo, | 1049 switches::kEnableOverlayFullscreenVideo, |
| 1039 switches::kEnableOverlayScrollbar, | 1050 switches::kEnableOverlayScrollbar, |
| 1040 switches::kEnableOverscrollNotifications, | 1051 switches::kEnableOverscrollNotifications, |
| 1041 switches::kEnablePinch, | 1052 switches::kEnablePinch, |
| 1042 switches::kEnablePreparsedJsCaching, | 1053 switches::kEnablePreparsedJsCaching, |
| 1043 switches::kEnablePruneGpuCommandBuffers, | 1054 switches::kEnablePruneGpuCommandBuffers, |
| 1044 switches::kEnableRepaintAfterLayout, | 1055 switches::kEnableRepaintAfterLayout, |
| 1045 switches::kEnableServiceWorker, | 1056 switches::kEnableServiceWorker, |
| 1046 switches::kEnableSkiaBenchmarking, | 1057 switches::kEnableSkiaBenchmarking, |
| 1047 switches::kEnableSoftwareCompositing, | 1058 switches::kEnableSoftwareCompositing, |
| 1048 switches::kEnableSpeechSynthesis, | 1059 switches::kEnableSpeechSynthesis, |
| 1049 switches::kEnableStatsTable, | 1060 switches::kEnableStatsTable, |
| 1050 switches::kEnableStrictSiteIsolation, | 1061 switches::kEnableStrictSiteIsolation, |
| 1051 switches::kEnableTargetedStyleRecalc, | 1062 switches::kEnableTargetedStyleRecalc, |
| 1052 switches::kEnableThreadedCompositing, | 1063 switches::kEnableThreadedCompositing, |
| 1053 switches::kEnableUniversalAcceleratedOverflowScroll, | 1064 switches::kEnableUniversalAcceleratedOverflowScroll, |
| 1054 switches::kEnableTouchDragDrop, | 1065 switches::kEnableTouchDragDrop, |
| 1055 switches::kEnableTouchEditing, | 1066 switches::kEnableTouchEditing, |
| 1056 switches::kEnableViewport, | 1067 switches::kEnableViewport, |
| 1057 switches::kEnableViewportMeta, | 1068 switches::kEnableViewportMeta, |
| 1058 switches::kMainFrameResizesAreOrientationChanges, | 1069 switches::kMainFrameResizesAreOrientationChanges, |
| 1059 switches::kEnableVtune, | 1070 switches::kEnableVtune, |
| 1060 switches::kEnableWebAnimationsSVG, | 1071 switches::kEnableWebAnimationsSVG, |
| 1061 switches::kEnableWebGLDraftExtensions, | 1072 switches::kEnableWebGLDraftExtensions, |
| 1062 switches::kEnableWebMIDI, | 1073 switches::kEnableWebMIDI, |
| 1063 switches::kForceDeviceScaleFactor, | 1074 switches::kForceDeviceScaleFactor, |
| 1075 switches::kForceGpuRasterization, |
| 1064 switches::kFullMemoryCrashReport, | 1076 switches::kFullMemoryCrashReport, |
| 1065 switches::kJavaScriptFlags, | 1077 switches::kJavaScriptFlags, |
| 1066 switches::kLoggingLevel, | 1078 switches::kLoggingLevel, |
| 1067 switches::kMaxUntiledLayerWidth, | 1079 switches::kMaxUntiledLayerWidth, |
| 1068 switches::kMaxUntiledLayerHeight, | 1080 switches::kMaxUntiledLayerHeight, |
| 1069 switches::kMemoryMetrics, | 1081 switches::kMemoryMetrics, |
| 1070 switches::kNoReferrers, | 1082 switches::kNoReferrers, |
| 1071 switches::kNoSandbox, | 1083 switches::kNoSandbox, |
| 1072 switches::kNumRasterThreads, | 1084 switches::kNumRasterThreads, |
| 1073 switches::kPpapiInProcess, | 1085 switches::kPpapiInProcess, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1090 switches::kUserAgent, | 1102 switches::kUserAgent, |
| 1091 switches::kV, | 1103 switches::kV, |
| 1092 switches::kVideoThreads, | 1104 switches::kVideoThreads, |
| 1093 switches::kVModule, | 1105 switches::kVModule, |
| 1094 switches::kWebGLCommandBufferSizeKb, | 1106 switches::kWebGLCommandBufferSizeKb, |
| 1095 // Please keep these in alphabetical order. Compositor switches here should | 1107 // Please keep these in alphabetical order. Compositor switches here should |
| 1096 // also be added to chrome/browser/chromeos/login/chrome_restart_request.cc. | 1108 // also be added to chrome/browser/chromeos/login/chrome_restart_request.cc. |
| 1097 cc::switches::kCompositeToMailbox, | 1109 cc::switches::kCompositeToMailbox, |
| 1098 cc::switches::kDisableCompositedAntialiasing, | 1110 cc::switches::kDisableCompositedAntialiasing, |
| 1099 cc::switches::kDisableCompositorTouchHitTesting, | 1111 cc::switches::kDisableCompositorTouchHitTesting, |
| 1100 cc::switches::kDisableGPURasterization, | |
| 1101 cc::switches::kDisableImplSidePainting, | |
| 1102 cc::switches::kDisableLCDText, | |
| 1103 cc::switches::kDisableMapImage, | |
| 1104 cc::switches::kDisableThreadedAnimation, | 1112 cc::switches::kDisableThreadedAnimation, |
| 1105 cc::switches::kEnableGpuBenchmarking, | 1113 cc::switches::kEnableGpuBenchmarking, |
| 1106 cc::switches::kEnableGPURasterization, | |
| 1107 cc::switches::kEnableImplSidePainting, | |
| 1108 cc::switches::kEnableLCDText, | |
| 1109 cc::switches::kEnableMapImage, | |
| 1110 cc::switches::kEnablePinchVirtualViewport, | 1114 cc::switches::kEnablePinchVirtualViewport, |
| 1111 cc::switches::kEnableTopControlsPositionCalculation, | 1115 cc::switches::kEnableTopControlsPositionCalculation, |
| 1112 cc::switches::kMaxTilesForInterestArea, | 1116 cc::switches::kMaxTilesForInterestArea, |
| 1113 cc::switches::kMaxUnusedResourceMemoryUsagePercentage, | 1117 cc::switches::kMaxUnusedResourceMemoryUsagePercentage, |
| 1114 cc::switches::kShowCompositedLayerBorders, | 1118 cc::switches::kShowCompositedLayerBorders, |
| 1115 cc::switches::kShowFPSCounter, | 1119 cc::switches::kShowFPSCounter, |
| 1116 cc::switches::kShowLayerAnimationBounds, | 1120 cc::switches::kShowLayerAnimationBounds, |
| 1117 cc::switches::kShowNonOccludingRects, | 1121 cc::switches::kShowNonOccludingRects, |
| 1118 cc::switches::kShowOccludingRects, | 1122 cc::switches::kShowOccludingRects, |
| 1119 cc::switches::kShowPropertyChangedRects, | 1123 cc::switches::kShowPropertyChangedRects, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1183 // Disable databases in incognito mode. | 1187 // Disable databases in incognito mode. |
| 1184 if (GetBrowserContext()->IsOffTheRecord() && | 1188 if (GetBrowserContext()->IsOffTheRecord() && |
| 1185 !browser_cmd.HasSwitch(switches::kDisableDatabases)) { | 1189 !browser_cmd.HasSwitch(switches::kDisableDatabases)) { |
| 1186 renderer_cmd->AppendSwitch(switches::kDisableDatabases); | 1190 renderer_cmd->AppendSwitch(switches::kDisableDatabases); |
| 1187 #if defined(OS_ANDROID) | 1191 #if defined(OS_ANDROID) |
| 1188 renderer_cmd->AppendSwitch(switches::kDisableMediaHistoryLogging); | 1192 renderer_cmd->AppendSwitch(switches::kDisableMediaHistoryLogging); |
| 1189 #endif | 1193 #endif |
| 1190 } | 1194 } |
| 1191 | 1195 |
| 1192 // Enforce the extra command line flags for impl-side painting. | 1196 // Enforce the extra command line flags for impl-side painting. |
| 1193 if (cc::switches::IsImplSidePaintingEnabled() && | 1197 if (IsImplSidePaintingEnabled() && |
| 1194 !browser_cmd.HasSwitch(switches::kEnableDeferredImageDecoding)) | 1198 !browser_cmd.HasSwitch(switches::kEnableDeferredImageDecoding)) |
| 1195 renderer_cmd->AppendSwitch(switches::kEnableDeferredImageDecoding); | 1199 renderer_cmd->AppendSwitch(switches::kEnableDeferredImageDecoding); |
| 1196 } | 1200 } |
| 1197 | 1201 |
| 1198 base::ProcessHandle RenderProcessHostImpl::GetHandle() const { | 1202 base::ProcessHandle RenderProcessHostImpl::GetHandle() const { |
| 1199 if (run_renderer_in_process()) | 1203 if (run_renderer_in_process()) |
| 1200 return base::Process::Current().handle(); | 1204 return base::Process::Current().handle(); |
| 1201 | 1205 |
| 1202 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) | 1206 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) |
| 1203 return base::kNullProcessHandle; | 1207 return base::kNullProcessHandle; |
| (...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2091 | 2095 |
| 2092 void RenderProcessHostImpl::DecrementWorkerRefCount() { | 2096 void RenderProcessHostImpl::DecrementWorkerRefCount() { |
| 2093 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 2097 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 2094 DCHECK_GT(worker_ref_count_, 0); | 2098 DCHECK_GT(worker_ref_count_, 0); |
| 2095 --worker_ref_count_; | 2099 --worker_ref_count_; |
| 2096 if (worker_ref_count_ == 0) | 2100 if (worker_ref_count_ == 0) |
| 2097 Cleanup(); | 2101 Cleanup(); |
| 2098 } | 2102 } |
| 2099 | 2103 |
| 2100 } // namespace content | 2104 } // namespace content |
| OLD | NEW |