Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Side by Side Diff: content/public/browser/render_process_host.h

Issue 2921063003: Fix process reuse for dedicated processes when over process limit. (Closed)
Patch Set: Cleanup Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_
6 #define CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ 6 #define CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 // Acquires the |mojom::Renderer| interface to the render process. This is for 345 // Acquires the |mojom::Renderer| interface to the render process. This is for
346 // internal use only, and is only exposed here to support 346 // internal use only, and is only exposed here to support
347 // MockRenderProcessHost usage in tests. 347 // MockRenderProcessHost usage in tests.
348 virtual mojom::Renderer* GetRendererInterface() = 0; 348 virtual mojom::Renderer* GetRendererInterface() = 0;
349 349
350 // Whether this process is locked out from ever being reused for sites other 350 // Whether this process is locked out from ever being reused for sites other
351 // than the ones it currently has. 351 // than the ones it currently has.
352 virtual void SetIsNeverSuitableForReuse() = 0; 352 virtual void SetIsNeverSuitableForReuse() = 0;
353 virtual bool MayReuseHost() = 0; 353 virtual bool MayReuseHost() = 0;
354 354
355 // Indicates whether this RenderProcessHost can be used to host a URL that
356 // requires a dedicated process. This starts out as true for new processes
357 // and will become false after a call to UnsetCanBecomeDedicatedProcess(),
358 // such as after the process has been used to host web content.
359 virtual bool CanBecomeDedicatedProcess() = 0;
alexmos 2017/06/12 17:35:07 These are public because of MockRenderProcessHost.
Charlie Reis 2017/06/12 23:08:17 Sigh. Some day we'll fix that.
Charlie Reis 2017/06/12 23:08:17 Yeah, I wonder if there's a better concept to be t
alexmos 2017/06/14 22:39:05 I like this, especially given the potential for th
Charlie Reis 2017/06/17 23:13:53 Yes, saying it's implicit in those cases might be
alexmos 2017/06/19 20:03:58 Done.
360 virtual void UnsetCanBecomeDedicatedProcess() = 0;
361
355 // Returns the current number of active views in this process. Excludes 362 // Returns the current number of active views in this process. Excludes
356 // any RenderViewHosts that are swapped out. 363 // any RenderViewHosts that are swapped out.
357 size_t GetActiveViewCount(); 364 size_t GetActiveViewCount();
358 365
359 // Posts |task|, if this RenderProcessHost is ready or when it becomes ready 366 // Posts |task|, if this RenderProcessHost is ready or when it becomes ready
360 // (see RenderProcessHost::IsReady method). The |task| might not run at all 367 // (see RenderProcessHost::IsReady method). The |task| might not run at all
361 // (e.g. if |render_process_host| is destroyed before becoming ready). This 368 // (e.g. if |render_process_host| is destroyed before becoming ready). This
362 // function can only be called on the browser's UI thread (and the |task| will 369 // function can only be called on the browser's UI thread (and the |task| will
363 // be posted back on the UI thread). 370 // be posted back on the UI thread).
364 void PostTaskWhenProcessIsReady(base::OnceClosure task); 371 void PostTaskWhenProcessIsReady(base::OnceClosure task);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 static void SetMaxRendererProcessCount(size_t count); 421 static void SetMaxRendererProcessCount(size_t count);
415 422
416 // Returns the current maximum number of renderer process hosts kept by the 423 // Returns the current maximum number of renderer process hosts kept by the
417 // content module. 424 // content module.
418 static size_t GetMaxRendererProcessCount(); 425 static size_t GetMaxRendererProcessCount();
419 }; 426 };
420 427
421 } // namespace content. 428 } // namespace content.
422 429
423 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ 430 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698