| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 switches::kDisableDatabases, | 984 switches::kDisableDatabases, |
| 982 switches::kDisableDelegatedRenderer, | 985 switches::kDisableDelegatedRenderer, |
| 983 switches::kDisableDesktopNotifications, | 986 switches::kDisableDesktopNotifications, |
| 984 switches::kDisableDirectNPAPIRequests, | 987 switches::kDisableDirectNPAPIRequests, |
| 985 switches::kDisableFileSystem, | 988 switches::kDisableFileSystem, |
| 986 switches::kDisableFiltersOverIPC, | 989 switches::kDisableFiltersOverIPC, |
| 987 switches::kDisableGpu, | 990 switches::kDisableGpu, |
| 988 switches::kDisableGpuCompositing, | 991 switches::kDisableGpuCompositing, |
| 989 switches::kDisableGpuVsync, | 992 switches::kDisableGpuVsync, |
| 990 switches::kDisableHistogramCustomizer, | 993 switches::kDisableHistogramCustomizer, |
| 994 switches::kDisableImplSidePainting, |
| 995 switches::kDisableLCDText, |
| 991 switches::kDisableLayerSquashing, | 996 switches::kDisableLayerSquashing, |
| 992 switches::kDisableLocalStorage, | 997 switches::kDisableLocalStorage, |
| 993 switches::kDisableLogging, | 998 switches::kDisableLogging, |
| 999 switches::kDisableMapImage, |
| 994 switches::kDisableOpusPlayback, | 1000 switches::kDisableOpusPlayback, |
| 995 switches::kDisableOverlayScrollbar, | 1001 switches::kDisableOverlayScrollbar, |
| 996 switches::kDisablePinch, | 1002 switches::kDisablePinch, |
| 997 switches::kDisablePrefixedEncryptedMedia, | 1003 switches::kDisablePrefixedEncryptedMedia, |
| 998 switches::kDisableRepaintAfterLayout, | 1004 switches::kDisableRepaintAfterLayout, |
| 999 switches::kDisableSeccompFilterSandbox, | 1005 switches::kDisableSeccompFilterSandbox, |
| 1000 switches::kDisableSessionStorage, | 1006 switches::kDisableSessionStorage, |
| 1001 switches::kDisableSharedWorkers, | 1007 switches::kDisableSharedWorkers, |
| 1002 switches::kDisableSpeechInput, | 1008 switches::kDisableSpeechInput, |
| 1003 switches::kDisableThreadedCompositing, | 1009 switches::kDisableThreadedCompositing, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1026 switches::kEnableEncryptedMedia, | 1032 switches::kEnableEncryptedMedia, |
| 1027 switches::kEnableExperimentalCanvasFeatures, | 1033 switches::kEnableExperimentalCanvasFeatures, |
| 1028 switches::kEnableExperimentalWebPlatformFeatures, | 1034 switches::kEnableExperimentalWebPlatformFeatures, |
| 1029 switches::kEnableExperimentalWebSocket, | 1035 switches::kEnableExperimentalWebSocket, |
| 1030 switches::kEnableFastTextAutosizing, | 1036 switches::kEnableFastTextAutosizing, |
| 1031 switches::kEnableGPUClientLogging, | 1037 switches::kEnableGPUClientLogging, |
| 1032 switches::kEnableGpuClientTracing, | 1038 switches::kEnableGpuClientTracing, |
| 1033 switches::kEnableGPUServiceLogging, | 1039 switches::kEnableGPUServiceLogging, |
| 1034 switches::kEnableHighDpiCompositingForFixedPosition, | 1040 switches::kEnableHighDpiCompositingForFixedPosition, |
| 1035 switches::kEnableHTMLImports, | 1041 switches::kEnableHTMLImports, |
| 1042 switches::kEnableImplSidePainting, |
| 1036 switches::kEnableInbandTextTracks, | 1043 switches::kEnableInbandTextTracks, |
| 1044 switches::kEnableLCDText, |
| 1037 switches::kEnableLayerSquashing, | 1045 switches::kEnableLayerSquashing, |
| 1038 switches::kEnableLogging, | 1046 switches::kEnableLogging, |
| 1039 switches::kEnableMP3StreamParser, | 1047 switches::kEnableMP3StreamParser, |
| 1048 switches::kEnableMapImage, |
| 1040 switches::kEnableMemoryBenchmarking, | 1049 switches::kEnableMemoryBenchmarking, |
| 1041 switches::kEnableOverlayFullscreenVideo, | 1050 switches::kEnableOverlayFullscreenVideo, |
| 1042 switches::kEnableOverlayScrollbar, | 1051 switches::kEnableOverlayScrollbar, |
| 1043 switches::kEnableOverscrollNotifications, | 1052 switches::kEnableOverscrollNotifications, |
| 1044 switches::kEnablePinch, | 1053 switches::kEnablePinch, |
| 1045 switches::kEnablePreparsedJsCaching, | 1054 switches::kEnablePreparsedJsCaching, |
| 1046 switches::kEnablePruneGpuCommandBuffers, | 1055 switches::kEnablePruneGpuCommandBuffers, |
| 1047 switches::kEnableRepaintAfterLayout, | 1056 switches::kEnableRepaintAfterLayout, |
| 1048 switches::kEnableServiceWorker, | 1057 switches::kEnableServiceWorker, |
| 1049 switches::kEnableSkiaBenchmarking, | 1058 switches::kEnableSkiaBenchmarking, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1068 switches::kJavaScriptFlags, | 1077 switches::kJavaScriptFlags, |
| 1069 switches::kLoggingLevel, | 1078 switches::kLoggingLevel, |
| 1070 switches::kMaxUntiledLayerWidth, | 1079 switches::kMaxUntiledLayerWidth, |
| 1071 switches::kMaxUntiledLayerHeight, | 1080 switches::kMaxUntiledLayerHeight, |
| 1072 switches::kMemoryMetrics, | 1081 switches::kMemoryMetrics, |
| 1073 switches::kNoReferrers, | 1082 switches::kNoReferrers, |
| 1074 switches::kNoSandbox, | 1083 switches::kNoSandbox, |
| 1075 switches::kNumRasterThreads, | 1084 switches::kNumRasterThreads, |
| 1076 switches::kPpapiInProcess, | 1085 switches::kPpapiInProcess, |
| 1077 switches::kProfilerTiming, | 1086 switches::kProfilerTiming, |
| 1087 switches::kRasterizationSite, |
| 1078 switches::kReduceSecurityForTesting, | 1088 switches::kReduceSecurityForTesting, |
| 1079 switches::kRegisterPepperPlugins, | 1089 switches::kRegisterPepperPlugins, |
| 1080 switches::kRendererAssertTest, | 1090 switches::kRendererAssertTest, |
| 1081 switches::kRendererStartupDialog, | 1091 switches::kRendererStartupDialog, |
| 1082 switches::kShowPaintRects, | 1092 switches::kShowPaintRects, |
| 1083 switches::kSitePerProcess, | 1093 switches::kSitePerProcess, |
| 1084 switches::kStatsCollectionController, | 1094 switches::kStatsCollectionController, |
| 1085 switches::kTestSandbox, | 1095 switches::kTestSandbox, |
| 1086 switches::kTouchEvents, | 1096 switches::kTouchEvents, |
| 1087 switches::kTraceToConsole, | 1097 switches::kTraceToConsole, |
| 1088 switches::kUseDiscardableMemory, | 1098 switches::kUseDiscardableMemory, |
| 1089 // This flag needs to be propagated to the renderer process for | 1099 // This flag needs to be propagated to the renderer process for |
| 1090 // --in-process-webgl. | 1100 // --in-process-webgl. |
| 1091 switches::kUseGL, | 1101 switches::kUseGL, |
| 1092 switches::kUseMobileUserAgent, | 1102 switches::kUseMobileUserAgent, |
| 1093 switches::kUserAgent, | 1103 switches::kUserAgent, |
| 1094 switches::kV, | 1104 switches::kV, |
| 1095 switches::kVideoThreads, | 1105 switches::kVideoThreads, |
| 1096 switches::kVModule, | 1106 switches::kVModule, |
| 1097 switches::kWebGLCommandBufferSizeKb, | 1107 switches::kWebGLCommandBufferSizeKb, |
| 1098 // Please keep these in alphabetical order. Compositor switches here should | 1108 // Please keep these in alphabetical order. Compositor switches here should |
| 1099 // also be added to chrome/browser/chromeos/login/chrome_restart_request.cc. | 1109 // also be added to chrome/browser/chromeos/login/chrome_restart_request.cc. |
| 1100 cc::switches::kBackgroundColorInsteadOfCheckerboard, | 1110 cc::switches::kBackgroundColorInsteadOfCheckerboard, |
| 1101 cc::switches::kCompositeToMailbox, | 1111 cc::switches::kCompositeToMailbox, |
| 1102 cc::switches::kDisableCompositedAntialiasing, | 1112 cc::switches::kDisableCompositedAntialiasing, |
| 1103 cc::switches::kDisableCompositorTouchHitTesting, | 1113 cc::switches::kDisableCompositorTouchHitTesting, |
| 1104 cc::switches::kDisableGPURasterization, | |
| 1105 cc::switches::kDisableImplSidePainting, | |
| 1106 cc::switches::kDisableLCDText, | |
| 1107 cc::switches::kDisableMapImage, | |
| 1108 cc::switches::kDisableThreadedAnimation, | 1114 cc::switches::kDisableThreadedAnimation, |
| 1109 cc::switches::kEnableGpuBenchmarking, | 1115 cc::switches::kEnableGpuBenchmarking, |
| 1110 cc::switches::kEnableGPURasterization, | |
| 1111 cc::switches::kEnableImplSidePainting, | |
| 1112 cc::switches::kEnableLCDText, | |
| 1113 cc::switches::kEnableMapImage, | |
| 1114 cc::switches::kEnablePinchVirtualViewport, | 1116 cc::switches::kEnablePinchVirtualViewport, |
| 1115 cc::switches::kEnableTopControlsPositionCalculation, | 1117 cc::switches::kEnableTopControlsPositionCalculation, |
| 1116 cc::switches::kMaxTilesForInterestArea, | 1118 cc::switches::kMaxTilesForInterestArea, |
| 1117 cc::switches::kMaxUnusedResourceMemoryUsagePercentage, | 1119 cc::switches::kMaxUnusedResourceMemoryUsagePercentage, |
| 1118 cc::switches::kShowCompositedLayerBorders, | 1120 cc::switches::kShowCompositedLayerBorders, |
| 1119 cc::switches::kShowFPSCounter, | 1121 cc::switches::kShowFPSCounter, |
| 1120 cc::switches::kShowLayerAnimationBounds, | 1122 cc::switches::kShowLayerAnimationBounds, |
| 1121 cc::switches::kShowNonOccludingRects, | 1123 cc::switches::kShowNonOccludingRects, |
| 1122 cc::switches::kShowOccludingRects, | 1124 cc::switches::kShowOccludingRects, |
| 1123 cc::switches::kShowPropertyChangedRects, | 1125 cc::switches::kShowPropertyChangedRects, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1187 // Disable databases in incognito mode. | 1189 // Disable databases in incognito mode. |
| 1188 if (GetBrowserContext()->IsOffTheRecord() && | 1190 if (GetBrowserContext()->IsOffTheRecord() && |
| 1189 !browser_cmd.HasSwitch(switches::kDisableDatabases)) { | 1191 !browser_cmd.HasSwitch(switches::kDisableDatabases)) { |
| 1190 renderer_cmd->AppendSwitch(switches::kDisableDatabases); | 1192 renderer_cmd->AppendSwitch(switches::kDisableDatabases); |
| 1191 #if defined(OS_ANDROID) | 1193 #if defined(OS_ANDROID) |
| 1192 renderer_cmd->AppendSwitch(switches::kDisableMediaHistoryLogging); | 1194 renderer_cmd->AppendSwitch(switches::kDisableMediaHistoryLogging); |
| 1193 #endif | 1195 #endif |
| 1194 } | 1196 } |
| 1195 | 1197 |
| 1196 // Enforce the extra command line flags for impl-side painting. | 1198 // Enforce the extra command line flags for impl-side painting. |
| 1197 if (cc::switches::IsImplSidePaintingEnabled() && | 1199 if (IsImplSidePaintingEnabled() && |
| 1198 !browser_cmd.HasSwitch(switches::kEnableDeferredImageDecoding)) | 1200 !browser_cmd.HasSwitch(switches::kEnableDeferredImageDecoding)) |
| 1199 renderer_cmd->AppendSwitch(switches::kEnableDeferredImageDecoding); | 1201 renderer_cmd->AppendSwitch(switches::kEnableDeferredImageDecoding); |
| 1200 } | 1202 } |
| 1201 | 1203 |
| 1202 base::ProcessHandle RenderProcessHostImpl::GetHandle() const { | 1204 base::ProcessHandle RenderProcessHostImpl::GetHandle() const { |
| 1203 if (run_renderer_in_process()) | 1205 if (run_renderer_in_process()) |
| 1204 return base::Process::Current().handle(); | 1206 return base::Process::Current().handle(); |
| 1205 | 1207 |
| 1206 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) | 1208 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) |
| 1207 return base::kNullProcessHandle; | 1209 return base::kNullProcessHandle; |
| (...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2095 | 2097 |
| 2096 void RenderProcessHostImpl::DecrementWorkerRefCount() { | 2098 void RenderProcessHostImpl::DecrementWorkerRefCount() { |
| 2097 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 2099 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 2098 DCHECK_GT(worker_ref_count_, 0); | 2100 DCHECK_GT(worker_ref_count_, 0); |
| 2099 --worker_ref_count_; | 2101 --worker_ref_count_; |
| 2100 if (worker_ref_count_ == 0) | 2102 if (worker_ref_count_ == 0) |
| 2101 Cleanup(); | 2103 Cleanup(); |
| 2102 } | 2104 } |
| 2103 | 2105 |
| 2104 } // namespace content | 2106 } // namespace content |
| OLD | NEW |