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 #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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 | 357 |
358 // Acquires the interface to the Global Resource Coordinator for this process. | 358 // Acquires the interface to the Global Resource Coordinator for this process. |
359 virtual resource_coordinator::ResourceCoordinatorInterface* | 359 virtual resource_coordinator::ResourceCoordinatorInterface* |
360 GetProcessResourceCoordinator() = 0; | 360 GetProcessResourceCoordinator() = 0; |
361 | 361 |
362 // Whether this process is locked out from ever being reused for sites other | 362 // Whether this process is locked out from ever being reused for sites other |
363 // than the ones it currently has. | 363 // than the ones it currently has. |
364 virtual void SetIsNeverSuitableForReuse() = 0; | 364 virtual void SetIsNeverSuitableForReuse() = 0; |
365 virtual bool MayReuseHost() = 0; | 365 virtual bool MayReuseHost() = 0; |
366 | 366 |
| 367 // Indicates whether this RenderProcessHost is "unused". This starts out as |
| 368 // true for new processes and becomes false after one of the following: |
| 369 // (1) This process commits any page. |
| 370 // (2) This process is given to a SiteInstance that already has a site |
| 371 // assigned. |
| 372 // Note that a process hosting ServiceWorkers will be implicitly handled by |
| 373 // (2) during ServiceWorker initialization, and SharedWorkers will be handled |
| 374 // by (1) since a page needs to commit before it can create a SharedWorker. |
| 375 // |
| 376 // While a process is unused, it is still suitable to host a URL that |
| 377 // requires a dedicated process. |
| 378 virtual bool IsUnused() = 0; |
| 379 virtual void SetIsUsed() = 0; |
| 380 |
367 // Returns the current number of active views in this process. Excludes | 381 // Returns the current number of active views in this process. Excludes |
368 // any RenderViewHosts that are swapped out. | 382 // any RenderViewHosts that are swapped out. |
369 size_t GetActiveViewCount(); | 383 size_t GetActiveViewCount(); |
370 | 384 |
371 // Posts |task|, if this RenderProcessHost is ready or when it becomes ready | 385 // Posts |task|, if this RenderProcessHost is ready or when it becomes ready |
372 // (see RenderProcessHost::IsReady method). The |task| might not run at all | 386 // (see RenderProcessHost::IsReady method). The |task| might not run at all |
373 // (e.g. if |render_process_host| is destroyed before becoming ready). This | 387 // (e.g. if |render_process_host| is destroyed before becoming ready). This |
374 // function can only be called on the browser's UI thread (and the |task| will | 388 // function can only be called on the browser's UI thread (and the |task| will |
375 // be posted back on the UI thread). | 389 // be posted back on the UI thread). |
376 void PostTaskWhenProcessIsReady(base::OnceClosure task); | 390 void PostTaskWhenProcessIsReady(base::OnceClosure task); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 static void SetMaxRendererProcessCount(size_t count); | 440 static void SetMaxRendererProcessCount(size_t count); |
427 | 441 |
428 // Returns the current maximum number of renderer process hosts kept by the | 442 // Returns the current maximum number of renderer process hosts kept by the |
429 // content module. | 443 // content module. |
430 static size_t GetMaxRendererProcessCount(); | 444 static size_t GetMaxRendererProcessCount(); |
431 }; | 445 }; |
432 | 446 |
433 } // namespace content. | 447 } // namespace content. |
434 | 448 |
435 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ | 449 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ |
OLD | NEW |