| [email protected] | fd911dd | 2012-01-27 01:57:10 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 4 | |
| [email protected] | d353541f | 2012-05-03 22:45:41 | [diff] [blame] | 5 | #include "content/renderer/render_process_impl.h" |
| 6 | |
| [email protected] | 037fce0 | 2009-01-22 01:42:15 | [diff] [blame] | 7 | #include "build/build_config.h" |
| 8 | |
| [email protected] | 037fce0 | 2009-01-22 01:42:15 | [diff] [blame] | 9 | #if defined(OS_WIN) |
| initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 10 | #include <windows.h> |
| 11 | #include <objidl.h> |
| 12 | #include <mlang.h> |
| [email protected] | 037fce0 | 2009-01-22 01:42:15 | [diff] [blame] | 13 | #endif |
| initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 14 | |
| fdoray | d2233a7 | 2016-12-13 17:18:21 | [diff] [blame] | 15 | #include <stddef.h> |
| 16 | |
| fdoray | 743f8d6d | 2017-02-09 15:24:23 | [diff] [blame] | 17 | #include <algorithm> |
| fdoray | 31cc6f8 | 2017-02-10 23:31:10 | [diff] [blame] | 18 | #include <utility> |
| fdoray | d2233a7 | 2016-12-13 17:18:21 | [diff] [blame] | 19 | |
| Eric Holk | 1384f6d | 2018-01-05 00:49:36 | [diff] [blame] | 20 | #include "base/base_switches.h" |
| fdoray | d2233a7 | 2016-12-13 17:18:21 | [diff] [blame] | 21 | #include "base/bind.h" |
| initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 22 | #include "base/command_line.h" |
| [email protected] | 037fce0 | 2009-01-22 01:42:15 | [diff] [blame] | 23 | #include "base/compiler_specific.h" |
| georgesak | 80353b5 | 2017-01-10 21:18:51 | [diff] [blame] | 24 | #include "base/debug/crash_logging.h" |
| Eric Holk | dc499db | 2017-07-17 17:57:35 | [diff] [blame] | 25 | #include "base/debug/stack_trace.h" |
| ishell | 75fddc1 | 2016-04-12 14:03:14 | [diff] [blame] | 26 | #include "base/feature_list.h" |
| fdoray | 31cc6f8 | 2017-02-10 23:31:10 | [diff] [blame] | 27 | #include "base/memory/ptr_util.h" |
| Sebastien Marchand | 75a7cdf | 2018-11-13 23:47:03 | [diff] [blame] | 28 | #include "base/system/sys_info.h" |
| Gabriel Charette | 52fa3ae | 2019-04-15 21:44:37 | [diff] [blame] | 29 | #include "base/task/thread_pool/initialization_util.h" |
| fdoray | d2233a7 | 2016-12-13 17:18:21 | [diff] [blame] | 30 | #include "base/time/time.h" |
| Gabriel Charette | 52fa3ae | 2019-04-15 21:44:37 | [diff] [blame] | 31 | #include "content/common/thread_pool_util.h" |
| sammc | 7f6c6a0 | 2017-01-30 00:53:51 | [diff] [blame] | 32 | #include "content/public/common/bindings_policy.h" |
| fdoray | d2233a7 | 2016-12-13 17:18:21 | [diff] [blame] | 33 | #include "content/public/common/content_client.h" |
| bradnelson | c79f5a6f | 2016-10-10 18:31:14 | [diff] [blame] | 34 | #include "content/public/common/content_features.h" |
| [email protected] | c08950d2 | 2011-10-13 22:20:29 | [diff] [blame] | 35 | #include "content/public/common/content_switches.h" |
| [email protected] | d344114c | 2011-10-01 01:24:34 | [diff] [blame] | 36 | #include "content/public/renderer/content_renderer_client.h" |
| Eric Holk | 1384f6d | 2018-01-05 00:49:36 | [diff] [blame] | 37 | #include "services/service_manager/embedder/switches.h" |
| Blink Reformat | a30d423 | 2018-04-07 15:31:06 | [diff] [blame] | 38 | #include "third_party/blink/public/web/web_frame.h" |
| [email protected] | 067f519 | 2014-01-29 05:22:09 | [diff] [blame] | 39 | #include "v8/include/v8.h" |
| initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 40 | |
| georgesak | 80353b5 | 2017-01-10 21:18:51 | [diff] [blame] | 41 | #if defined(OS_WIN) |
| 42 | #include "base/win/win_util.h" |
| 43 | #endif |
| 44 | |
| ishell | 75fddc1 | 2016-04-12 14:03:14 | [diff] [blame] | 45 | namespace { |
| 46 | |
| ishell | 75fddc1 | 2016-04-12 14:03:14 | [diff] [blame] | 47 | void SetV8FlagIfFeature(const base::Feature& feature, const char* v8_flag) { |
| 48 | if (base::FeatureList::IsEnabled(feature)) { |
| 49 | v8::V8::SetFlagsFromString(v8_flag, strlen(v8_flag)); |
| 50 | } |
| 51 | } |
| 52 | |
| bradnelson | 2730e351 | 2017-01-21 20:32:21 | [diff] [blame] | 53 | void SetV8FlagIfNotFeature(const base::Feature& feature, const char* v8_flag) { |
| 54 | if (!base::FeatureList::IsEnabled(feature)) { |
| 55 | v8::V8::SetFlagsFromString(v8_flag, strlen(v8_flag)); |
| 56 | } |
| 57 | } |
| 58 | |
| ishell | 75fddc1 | 2016-04-12 14:03:14 | [diff] [blame] | 59 | void SetV8FlagIfHasSwitch(const char* switch_name, const char* v8_flag) { |
| 60 | if (base::CommandLine::ForCurrentProcess()->HasSwitch(switch_name)) { |
| 61 | v8::V8::SetFlagsFromString(v8_flag, strlen(v8_flag)); |
| 62 | } |
| 63 | } |
| 64 | |
| Gabriel Charette | 52fa3ae | 2019-04-15 21:44:37 | [diff] [blame] | 65 | std::unique_ptr<base::ThreadPool::InitParams> GetDefaultThreadPoolInitParams() { |
| Etienne Pierre-doray | ce56296 | 2019-02-08 18:50:48 | [diff] [blame] | 66 | constexpr int kMaxNumThreadsInBackgroundPool = 2; |
| 67 | constexpr int kMaxNumThreadsInForegroundPoolLowerBound = 3; |
| fdoray | d2233a7 | 2016-12-13 17:18:21 | [diff] [blame] | 68 | constexpr auto kSuggestedReclaimTime = base::TimeDelta::FromSeconds(30); |
| 69 | |
| Gabriel Charette | 52fa3ae | 2019-04-15 21:44:37 | [diff] [blame] | 70 | return std::make_unique<base::ThreadPool::InitParams>( |
| Gabriel Charette | 3e2898f | 2019-05-01 14:55:01 | [diff] [blame] | 71 | base::ThreadGroupParams(kMaxNumThreadsInBackgroundPool, |
| 72 | kSuggestedReclaimTime), |
| 73 | base::ThreadGroupParams( |
| Gabriel Charette | 52fa3ae | 2019-04-15 21:44:37 | [diff] [blame] | 74 | std::max(kMaxNumThreadsInForegroundPoolLowerBound, |
| 75 | content::GetMinForegroundThreadsInRendererThreadPool()), |
| Etienne Pierre-doray | ce56296 | 2019-02-08 18:50:48 | [diff] [blame] | 76 | kSuggestedReclaimTime)); |
| fdoray | d2233a7 | 2016-12-13 17:18:21 | [diff] [blame] | 77 | } |
| 78 | |
| Tomas Popela | afffa97 | 2018-11-13 20:42:05 | [diff] [blame] | 79 | #if defined(DCHECK_IS_CONFIGURABLE) |
| Sigurdur Asgeirsson | 379c51e4 | 2017-09-21 12:52:45 | [diff] [blame] | 80 | void V8DcheckCallbackHandler(const char* file, int line, const char* message) { |
| 81 | // TODO(siggi): Set a crash key or a breadcrumb so the fact that we hit a |
| 82 | // V8 DCHECK gets out in the crash report. |
| 83 | ::logging::LogMessage(file, line, logging::LOG_DCHECK).stream() << message; |
| 84 | } |
| Tomas Popela | afffa97 | 2018-11-13 20:42:05 | [diff] [blame] | 85 | #endif // defined(DCHECK_IS_CONFIGURABLE) |
| Sigurdur Asgeirsson | 379c51e4 | 2017-09-21 12:52:45 | [diff] [blame] | 86 | |
| ishell | 75fddc1 | 2016-04-12 14:03:14 | [diff] [blame] | 87 | } // namespace |
| 88 | |
| [email protected] | eb39819 | 2012-10-22 20:16:19 | [diff] [blame] | 89 | namespace content { |
| 90 | |
| fdoray | 31cc6f8 | 2017-02-10 23:31:10 | [diff] [blame] | 91 | RenderProcessImpl::RenderProcessImpl( |
| Gabriel Charette | 52fa3ae | 2019-04-15 21:44:37 | [diff] [blame] | 92 | std::unique_ptr<base::ThreadPool::InitParams> thread_pool_init_params) |
| 93 | : RenderProcess("Renderer", std::move(thread_pool_init_params)), |
| fdoray | 31cc6f8 | 2017-02-10 23:31:10 | [diff] [blame] | 94 | enabled_bindings_(0) { |
| Tomas Popela | afffa97 | 2018-11-13 20:42:05 | [diff] [blame] | 95 | #if defined(DCHECK_IS_CONFIGURABLE) |
| Wez | a6ca5b9 | 2018-03-23 19:03:07 | [diff] [blame] | 96 | // Some official builds ship with DCHECKs compiled in. Failing DCHECKs then |
| 97 | // are either fatal or simply log the error, based on a feature flag. |
| Sigurdur Asgeirsson | 379c51e4 | 2017-09-21 12:52:45 | [diff] [blame] | 98 | // Make sure V8 follows suit by setting a Dcheck handler that forwards to |
| 99 | // the Chrome base logging implementation. |
| 100 | v8::V8::SetDcheckErrorHandler(&V8DcheckCallbackHandler); |
| 101 | |
| Wez | a6ca5b9 | 2018-03-23 19:03:07 | [diff] [blame] | 102 | if (!base::FeatureList::IsEnabled(base::kDCheckIsFatalFeature)) { |
| Sigurdur Asgeirsson | 379c51e4 | 2017-09-21 12:52:45 | [diff] [blame] | 103 | // These V8 flags default on in this build configuration. This triggers |
| 104 | // additional verification and code generation, which both slows down V8, |
| 105 | // and can lead to fatal CHECKs. Turn these flags down to get something |
| 106 | // closer to V8s normal performance and behavior. |
| 107 | constexpr char kDisabledFlags[] = |
| 108 | "--noturbo_verify " |
| Sigurdur Asgeirsson | 379c51e4 | 2017-09-21 12:52:45 | [diff] [blame] | 109 | "--noturbo_verify_allocation " |
| 110 | "--nodebug_code"; |
| 111 | |
| 112 | v8::V8::SetFlagsFromString(kDisabledFlags, sizeof(kDisabledFlags)); |
| 113 | } |
| Tomas Popela | afffa97 | 2018-11-13 20:42:05 | [diff] [blame] | 114 | #endif // defined(DCHECK_IS_CONFIGURABLE) |
| Sigurdur Asgeirsson | 379c51e4 | 2017-09-21 12:52:45 | [diff] [blame] | 115 | |
| [email protected] | 35b4f0c | 2014-06-26 16:55:27 | [diff] [blame] | 116 | if (base::SysInfo::IsLowEndDevice()) { |
| [email protected] | 067f519 | 2014-01-29 05:22:09 | [diff] [blame] | 117 | std::string optimize_flag("--optimize-for-size"); |
| Clemens Hammacher | c4a139a | 2019-04-25 13:55:09 | [diff] [blame] | 118 | v8::V8::SetFlagsFromString(optimize_flag.c_str(), optimize_flag.size()); |
| [email protected] | 067f519 | 2014-01-29 05:22:09 | [diff] [blame] | 119 | } |
| [email protected] | 987422f | 2013-10-01 10:33:31 | [diff] [blame] | 120 | |
| ishell | 75fddc1 | 2016-04-12 14:03:14 | [diff] [blame] | 121 | SetV8FlagIfHasSwitch(switches::kDisableJavaScriptHarmonyShipping, |
| 122 | "--noharmony-shipping"); |
| 123 | SetV8FlagIfHasSwitch(switches::kJavaScriptHarmony, "--harmony"); |
| Kouhei Ueno | 14d350d | 2018-10-01 02:36:27 | [diff] [blame] | 124 | |
| 125 | constexpr char kModuleFlags[] = |
| 126 | "--harmony-dynamic-import --harmony-import-meta"; |
| 127 | v8::V8::SetFlagsFromString(kModuleFlags, sizeof(kModuleFlags)); |
| 128 | |
| Hannes Payer | 1130d567 | 2018-06-05 07:37:31 | [diff] [blame] | 129 | SetV8FlagIfFeature(features::kV8Orinoco, "--no-single-threaded-gc"); |
| 130 | SetV8FlagIfNotFeature(features::kV8Orinoco, "--single-threaded-gc"); |
| 131 | |
| Michael Hablich | 896d5266 | 2017-10-23 15:59:57 | [diff] [blame] | 132 | SetV8FlagIfFeature(features::kV8VmFuture, "--future"); |
| 133 | SetV8FlagIfNotFeature(features::kV8VmFuture, "--no-future"); |
| Clemens Hammacher | 0c8a15a | 2018-04-27 13:45:32 | [diff] [blame] | 134 | |
| Clemens Hammacher | fab5510 | 2018-07-24 16:19:19 | [diff] [blame] | 135 | SetV8FlagIfFeature(features::kWebAssemblyBaseline, |
| 136 | "--liftoff --wasm-tier-up"); |
| 137 | SetV8FlagIfNotFeature(features::kWebAssemblyBaseline, |
| 138 | "--no-liftoff --no-wasm-tier-up"); |
| Clemens Hammacher | 0c8a15a | 2018-04-27 13:45:32 | [diff] [blame] | 139 | |
| Clemens Hammacher | 082fa57 | 2019-04-25 08:22:29 | [diff] [blame] | 140 | SetV8FlagIfFeature(features::kWebAssemblyCodeGC, "--wasm-code-gc"); |
| 141 | SetV8FlagIfNotFeature(features::kWebAssemblyCodeGC, "--no-wasm-code-gc"); |
| 142 | |
| Deepti Gandluri | 11734cc4 | 2019-05-02 18:00:20 | [diff] [blame^] | 143 | SetV8FlagIfFeature(features::kWebAssemblySimd, "--experimental-wasm-simd"); |
| 144 | SetV8FlagIfNotFeature(features::kWebAssemblySimd, |
| 145 | "--no-experimental-wasm-simd"); |
| 146 | |
| Ben Smith | 24c1e5c | 2018-06-20 01:09:02 | [diff] [blame] | 147 | if (base::FeatureList::IsEnabled(features::kWebAssemblyThreads)) { |
| 148 | constexpr char kFlags[] = |
| 149 | "--harmony-sharedarraybuffer " |
| 150 | "--no-wasm-disable-structured-cloning " |
| 151 | "--experimental-wasm-threads"; |
| 152 | |
| 153 | v8::V8::SetFlagsFromString(kFlags, sizeof(kFlags)); |
| 154 | } else { |
| 155 | SetV8FlagIfNotFeature(features::kWebAssembly, |
| 156 | "--wasm-disable-structured-cloning"); |
| 157 | SetV8FlagIfFeature(features::kSharedArrayBuffer, |
| 158 | "--harmony-sharedarraybuffer"); |
| 159 | SetV8FlagIfNotFeature(features::kSharedArrayBuffer, |
| 160 | "--no-harmony-sharedarraybuffer"); |
| 161 | } |
| Michael Hablich | 896d5266 | 2017-10-23 15:59:57 | [diff] [blame] | 162 | |
| Maya Lekova | 4bbfdb7f | 2018-10-16 08:15:03 | [diff] [blame] | 163 | SetV8FlagIfFeature(features::kAwaitOptimization, |
| 164 | "--harmony-await-optimization"); |
| 165 | SetV8FlagIfNotFeature(features::kAwaitOptimization, |
| 166 | "--no-harmony-await-optimization"); |
| 167 | |
| Eric Holk | b4f6013 | 2017-08-18 19:37:41 | [diff] [blame] | 168 | SetV8FlagIfNotFeature(features::kWebAssemblyTrapHandler, |
| 169 | "--no-wasm-trap-handler"); |
| Lei Zhang | 2d3ead60 | 2018-07-10 01:15:50 | [diff] [blame] | 170 | #if defined(OS_LINUX) && defined(ARCH_CPU_X86_64) |
| Eric Holk | dc499db | 2017-07-17 17:57:35 | [diff] [blame] | 171 | if (base::FeatureList::IsEnabled(features::kWebAssemblyTrapHandler)) { |
| Eric Holk | 1384f6d | 2018-01-05 00:49:36 | [diff] [blame] | 172 | base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 173 | if (!command_line->HasSwitch( |
| 174 | service_manager::switches::kDisableInProcessStackTraces)) { |
| Andreas Haas | ef19d59 | 2019-04-30 18:16:51 | [diff] [blame] | 175 | // Only enable WebAssembly trap handler if we can set the callback. |
| 176 | if (base::debug::SetStackDumpFirstChanceCallback( |
| 177 | v8::V8::TryHandleSignal)) { |
| 178 | // We registered the WebAssembly trap handler callback with the stack |
| 179 | // dump signal handler successfully. We can tell V8 that it can enable |
| 180 | // WebAssembly trap handler without using the V8 signal handler. |
| 181 | v8::V8::EnableWebAssemblyTrapHandler(/*use_v8_signal_handler=*/false); |
| 182 | } |
| Eric Holk | 1384f6d | 2018-01-05 00:49:36 | [diff] [blame] | 183 | } else if (!command_line->HasSwitch(switches::kEnableCrashReporter) && |
| 184 | !command_line->HasSwitch( |
| 185 | switches::kEnableCrashReporterForTesting)) { |
| 186 | // If we are using WebAssembly trap handling but both Breakpad and |
| 187 | // in-process stack traces are disabled then there will be no signal |
| 188 | // handler. In this case, we fall back on V8's default handler |
| 189 | // (https://crbug.com/798150). |
| Andreas Haas | ef19d59 | 2019-04-30 18:16:51 | [diff] [blame] | 190 | v8::V8::EnableWebAssemblyTrapHandler(/*use_v8_signal_handler=*/true); |
| Eric Holk | 1384f6d | 2018-01-05 00:49:36 | [diff] [blame] | 191 | } |
| Eric Holk | dc499db | 2017-07-17 17:57:35 | [diff] [blame] | 192 | } |
| 193 | #endif |
| Andreas Haas | 5ed0f50 | 2018-11-06 09:05:06 | [diff] [blame] | 194 | #if defined(OS_WIN) && defined(ARCH_CPU_X86_64) |
| 195 | if (base::FeatureList::IsEnabled(features::kWebAssemblyTrapHandler)) { |
| 196 | // On Windows we use the default trap handler provided by V8. |
| 197 | bool use_v8_trap_handler = true; |
| 198 | v8::V8::EnableWebAssemblyTrapHandler(use_v8_trap_handler); |
| 199 | } |
| 200 | #endif |
| Andreas Haas | 3bd4532 | 2018-11-21 07:45:42 | [diff] [blame] | 201 | #if defined(OS_MACOSX) && defined(ARCH_CPU_X86_64) |
| 202 | if (base::FeatureList::IsEnabled(features::kWebAssemblyTrapHandler)) { |
| 203 | // On macOS, Crashpad uses exception ports to handle signals in a different |
| 204 | // process. As we cannot just pass a callback to this other process, we ask |
| 205 | // V8 to install its own signal handler to deal with WebAssembly traps. |
| 206 | bool use_v8_signal_handler = true; |
| 207 | v8::V8::EnableWebAssemblyTrapHandler(use_v8_signal_handler); |
| 208 | } |
| 209 | #endif // defined(OS_MACOSX) && defined(ARCH_CPU_X86_64) |
| Eric Holk | dc499db | 2017-07-17 17:57:35 | [diff] [blame] | 210 | |
| avi | 83883c8 | 2014-12-23 00:08:49 | [diff] [blame] | 211 | const base::CommandLine& command_line = |
| 212 | *base::CommandLine::ForCurrentProcess(); |
| ishell | 75fddc1 | 2016-04-12 14:03:14 | [diff] [blame] | 213 | |
| Ross McIlroy | 3ba9207 | 2018-08-01 00:43:30 | [diff] [blame] | 214 | if (command_line.HasSwitch(switches::kNoV8UntrustedCodeMitigations)) { |
| 215 | const char* disable_mitigations = "--no-untrusted-code-mitigations"; |
| 216 | v8::V8::SetFlagsFromString(disable_mitigations, |
| 217 | strlen(disable_mitigations)); |
| 218 | } |
| 219 | |
| [email protected] | 396c3a46 | 2010-03-03 05:03:22 | [diff] [blame] | 220 | if (command_line.HasSwitch(switches::kJavaScriptFlags)) { |
| [email protected] | 067f519 | 2014-01-29 05:22:09 | [diff] [blame] | 221 | std::string flags( |
| [email protected] | 95edc39 | 2010-07-30 22:00:38 | [diff] [blame] | 222 | command_line.GetSwitchValueASCII(switches::kJavaScriptFlags)); |
| Clemens Hammacher | c4a139a | 2019-04-25 13:55:09 | [diff] [blame] | 223 | v8::V8::SetFlagsFromString(flags.c_str(), flags.size()); |
| [email protected] | 396c3a46 | 2010-03-03 05:03:22 | [diff] [blame] | 224 | } |
| [email protected] | 55dd933 | 2013-09-04 17:17:50 | [diff] [blame] | 225 | |
| sammc | 7f6c6a0 | 2017-01-30 00:53:51 | [diff] [blame] | 226 | if (command_line.HasSwitch(switches::kDomAutomationController)) |
| 227 | enabled_bindings_ |= BINDINGS_POLICY_DOM_AUTOMATION; |
| 228 | if (command_line.HasSwitch(switches::kStatsCollectionController)) |
| 229 | enabled_bindings_ |= BINDINGS_POLICY_STATS_COLLECTION; |
| [email protected] | e68e62fa | 2009-02-20 02:00:04 | [diff] [blame] | 230 | } |
| 231 | |
| [email protected] | 396c3a46 | 2010-03-03 05:03:22 | [diff] [blame] | 232 | RenderProcessImpl::~RenderProcessImpl() { |
| [email protected] | 396c3a46 | 2010-03-03 05:03:22 | [diff] [blame] | 233 | #ifndef NDEBUG |
| Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 234 | int count = blink::WebFrame::InstanceCount(); |
| [email protected] | 6bd867b | 2013-07-24 22:10:20 | [diff] [blame] | 235 | if (count) |
| 236 | DLOG(ERROR) << "WebFrame LEAKED " << count << " TIMES"; |
| [email protected] | 396c3a46 | 2010-03-03 05:03:22 | [diff] [blame] | 237 | #endif |
| [email protected] | e68e62fa | 2009-02-20 02:00:04 | [diff] [blame] | 238 | |
| [email protected] | 396c3a46 | 2010-03-03 05:03:22 | [diff] [blame] | 239 | GetShutDownEvent()->Signal(); |
| [email protected] | 396c3a46 | 2010-03-03 05:03:22 | [diff] [blame] | 240 | } |
| [email protected] | e68e62fa | 2009-02-20 02:00:04 | [diff] [blame] | 241 | |
| fdoray | 31cc6f8 | 2017-02-10 23:31:10 | [diff] [blame] | 242 | std::unique_ptr<RenderProcess> RenderProcessImpl::Create() { |
| Gabriel Charette | 52fa3ae | 2019-04-15 21:44:37 | [diff] [blame] | 243 | auto thread_pool_init_params = |
| 244 | content::GetContentClient()->renderer()->GetThreadPoolInitParams(); |
| 245 | if (!thread_pool_init_params) |
| 246 | thread_pool_init_params = GetDefaultThreadPoolInitParams(); |
| fdoray | 31cc6f8 | 2017-02-10 23:31:10 | [diff] [blame] | 247 | |
| 248 | return base::WrapUnique( |
| Gabriel Charette | 52fa3ae | 2019-04-15 21:44:37 | [diff] [blame] | 249 | new RenderProcessImpl(std::move(thread_pool_init_params))); |
| fdoray | 31cc6f8 | 2017-02-10 23:31:10 | [diff] [blame] | 250 | } |
| 251 | |
| [email protected] | 744c2a2 | 2012-03-15 18:42:04 | [diff] [blame] | 252 | void RenderProcessImpl::AddBindings(int bindings) { |
| 253 | enabled_bindings_ |= bindings; |
| 254 | } |
| 255 | |
| 256 | int RenderProcessImpl::GetEnabledBindings() const { |
| 257 | return enabled_bindings_; |
| 258 | } |
| 259 | |
| Arthur Sonzogni | c4f8dee | 2018-09-05 08:51:33 | [diff] [blame] | 260 | void RenderProcessImpl::AddRefProcess() { |
| 261 | NOTREACHED(); |
| 262 | } |
| 263 | |
| 264 | void RenderProcessImpl::ReleaseProcess() { |
| 265 | NOTREACHED(); |
| 266 | } |
| 267 | |
| [email protected] | eb39819 | 2012-10-22 20:16:19 | [diff] [blame] | 268 | } // namespace content |