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_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
349 mojo::InterfaceRequest<mojom::StoragePartitionService> request); | 349 mojo::InterfaceRequest<mojom::StoragePartitionService> request); |
350 | 350 |
351 // Control message handlers. | 351 // Control message handlers. |
352 void OnShutdownRequest(); | 352 void OnShutdownRequest(); |
353 void SuddenTerminationChanged(bool enabled); | 353 void SuddenTerminationChanged(bool enabled); |
354 void OnUserMetricsRecordAction(const std::string& action); | 354 void OnUserMetricsRecordAction(const std::string& action); |
355 void OnCloseACK(int old_route_id); | 355 void OnCloseACK(int old_route_id); |
356 | 356 |
357 // Generates a command line to be used to spawn a renderer and appends the | 357 // Generates a command line to be used to spawn a renderer and appends the |
358 // results to |*command_line|. | 358 // results to |*command_line|. |
359 void AppendRendererCommandLine(base::CommandLine* command_line) const; | 359 void AppendRendererCommandLine(base::CommandLine* command_line); |
360 | 360 |
361 // Copies applicable command line switches from the given |browser_cmd| line | 361 // Copies applicable command line switches from the given |browser_cmd| line |
362 // flags to the output |renderer_cmd| line flags. Not all switches will be | 362 // flags to the output |renderer_cmd| line flags. Not all switches will be |
363 // copied over. | 363 // copied over. |
364 void PropagateBrowserCommandLineToRenderer( | 364 void PropagateBrowserCommandLineToRenderer( |
365 const base::CommandLine& browser_cmd, | 365 const base::CommandLine& browser_cmd, |
366 base::CommandLine* renderer_cmd) const; | 366 base::CommandLine* renderer_cmd); |
367 | 367 |
368 // Inspects the current object state and sets/removes background priority if | 368 // Inspects the current object state and sets/removes background priority if |
369 // appropriate. Should be called after any of the involved data members | 369 // appropriate. Should be called after any of the involved data members |
370 // change. | 370 // change. |
371 void UpdateProcessPriority(); | 371 void UpdateProcessPriority(); |
372 | 372 |
373 // Creates a PersistentMemoryAllocator and shares it with the renderer | 373 // Creates a PersistentMemoryAllocator and shares it with the renderer |
374 // process for it to store histograms from that process. The allocator is | 374 // process for it to store histograms from that process. The allocator is |
375 // available for extraction by a SubprocesMetricsProvider in order to | 375 // available for extraction by a SubprocesMetricsProvider in order to |
376 // report those histograms to UMA. | 376 // report those histograms to UMA. |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
580 // for UMA. | 580 // for UMA. |
581 size_t max_worker_count_; | 581 size_t max_worker_count_; |
582 | 582 |
583 // Context shared for each mojom::PermissionService instance created for this | 583 // Context shared for each mojom::PermissionService instance created for this |
584 // RPH. | 584 // RPH. |
585 std::unique_ptr<PermissionServiceContext> permission_service_context_; | 585 std::unique_ptr<PermissionServiceContext> permission_service_context_; |
586 | 586 |
587 // The memory allocator, if any, in which the renderer will write its metrics. | 587 // The memory allocator, if any, in which the renderer will write its metrics. |
588 std::unique_ptr<base::SharedPersistentMemoryAllocator> metrics_allocator_; | 588 std::unique_ptr<base::SharedPersistentMemoryAllocator> metrics_allocator_; |
589 | 589 |
590 std::unique_ptr<base::SharedMemory> field_trial_state_; | |
Alexei Svitkine (slow)
2016/10/03 15:28:05
Add a comment and document lifetime of this. Add a
lawrencewu
2016/10/03 21:36:11
Done.
| |
591 | |
590 bool channel_connected_; | 592 bool channel_connected_; |
591 bool sent_render_process_ready_; | 593 bool sent_render_process_ready_; |
592 | 594 |
593 #if defined(OS_ANDROID) | 595 #if defined(OS_ANDROID) |
594 // UI thread is the source of sync IPCs and all shutdown signals. | 596 // UI thread is the source of sync IPCs and all shutdown signals. |
595 // Therefore a proper shutdown event to unblock the UI thread is not | 597 // Therefore a proper shutdown event to unblock the UI thread is not |
596 // possible without massive refactoring shutdown code. | 598 // possible without massive refactoring shutdown code. |
597 // Luckily Android never performs a clean shutdown. So explicitly | 599 // Luckily Android never performs a clean shutdown. So explicitly |
598 // ignore this problem. | 600 // ignore this problem. |
599 base::WaitableEvent never_signaled_; | 601 base::WaitableEvent never_signaled_; |
600 #endif | 602 #endif |
601 | 603 |
602 scoped_refptr<ResourceMessageFilter> resource_message_filter_; | 604 scoped_refptr<ResourceMessageFilter> resource_message_filter_; |
603 | 605 |
604 mojom::RouteProviderAssociatedPtr remote_route_provider_; | 606 mojom::RouteProviderAssociatedPtr remote_route_provider_; |
605 | 607 |
606 // A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend | 608 // A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend |
607 // WeakPtrs which are invalidated any time the RPHI is recycled. | 609 // WeakPtrs which are invalidated any time the RPHI is recycled. |
608 std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>> | 610 std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>> |
609 instance_weak_factory_; | 611 instance_weak_factory_; |
610 | 612 |
611 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 613 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
612 | 614 |
613 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 615 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
614 }; | 616 }; |
615 | 617 |
616 } // namespace content | 618 } // namespace content |
617 | 619 |
618 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ | 620 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ |
OLD | NEW |