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

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.h

Issue 2365273004: Initial implementation for sharing field trial state (win) (Closed)
Patch Set: add missing include Created 4 years, 2 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_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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 mojo::InterfaceRequest<mojom::StoragePartitionService> request); 329 mojo::InterfaceRequest<mojom::StoragePartitionService> request);
330 330
331 // Control message handlers. 331 // Control message handlers.
332 void OnShutdownRequest(); 332 void OnShutdownRequest();
333 void SuddenTerminationChanged(bool enabled); 333 void SuddenTerminationChanged(bool enabled);
334 void OnUserMetricsRecordAction(const std::string& action); 334 void OnUserMetricsRecordAction(const std::string& action);
335 void OnCloseACK(int old_route_id); 335 void OnCloseACK(int old_route_id);
336 336
337 // Generates a command line to be used to spawn a renderer and appends the 337 // Generates a command line to be used to spawn a renderer and appends the
338 // results to |*command_line|. 338 // results to |*command_line|.
339 void AppendRendererCommandLine(base::CommandLine* command_line) const; 339 void AppendRendererCommandLine(base::CommandLine* command_line);
340 340
341 // Copies applicable command line switches from the given |browser_cmd| line 341 // Copies applicable command line switches from the given |browser_cmd| line
342 // flags to the output |renderer_cmd| line flags. Not all switches will be 342 // flags to the output |renderer_cmd| line flags. Not all switches will be
343 // copied over. 343 // copied over.
344 void PropagateBrowserCommandLineToRenderer( 344 void PropagateBrowserCommandLineToRenderer(
345 const base::CommandLine& browser_cmd, 345 const base::CommandLine& browser_cmd,
346 base::CommandLine* renderer_cmd) const; 346 base::CommandLine* renderer_cmd);
347 347
348 // Inspects the current object state and sets/removes background priority if 348 // Inspects the current object state and sets/removes background priority if
349 // appropriate. Should be called after any of the involved data members 349 // appropriate. Should be called after any of the involved data members
350 // change. 350 // change.
351 void UpdateProcessPriority(); 351 void UpdateProcessPriority();
352 352
353 // Creates a PersistentMemoryAllocator and shares it with the renderer 353 // Creates a PersistentMemoryAllocator and shares it with the renderer
354 // process for it to store histograms from that process. The allocator is 354 // process for it to store histograms from that process. The allocator is
355 // available for extraction by a SubprocesMetricsProvider in order to 355 // available for extraction by a SubprocesMetricsProvider in order to
356 // report those histograms to UMA. 356 // report those histograms to UMA.
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 // for UMA. 550 // for UMA.
551 size_t max_worker_count_; 551 size_t max_worker_count_;
552 552
553 // Context shared for each mojom::PermissionService instance created for this 553 // Context shared for each mojom::PermissionService instance created for this
554 // RPH. 554 // RPH.
555 std::unique_ptr<PermissionServiceContext> permission_service_context_; 555 std::unique_ptr<PermissionServiceContext> permission_service_context_;
556 556
557 // The memory allocator, if any, in which the renderer will write its metrics. 557 // The memory allocator, if any, in which the renderer will write its metrics.
558 std::unique_ptr<base::SharedPersistentMemoryAllocator> metrics_allocator_; 558 std::unique_ptr<base::SharedPersistentMemoryAllocator> metrics_allocator_;
559 559
560 // Anonymous shared memory segment to share with subprocess containing list of
561 // field trials (represented as a string).
562 // TODO(lawrencewu): Eventually remove this and use single shared memory
563 // object across processes.
Alexei Svitkine (slow) 2016/10/06 21:39:28 Suggest filing a crbug for this later work and ref
lawrencewu 2016/10/07 15:07:21 Done: crbug.com/653874
564 std::unique_ptr<base::SharedMemory> field_trial_state_;
565
560 bool channel_connected_; 566 bool channel_connected_;
561 bool sent_render_process_ready_; 567 bool sent_render_process_ready_;
562 568
563 #if defined(OS_ANDROID) 569 #if defined(OS_ANDROID)
564 // UI thread is the source of sync IPCs and all shutdown signals. 570 // UI thread is the source of sync IPCs and all shutdown signals.
565 // Therefore a proper shutdown event to unblock the UI thread is not 571 // Therefore a proper shutdown event to unblock the UI thread is not
566 // possible without massive refactoring shutdown code. 572 // possible without massive refactoring shutdown code.
567 // Luckily Android never performs a clean shutdown. So explicitly 573 // Luckily Android never performs a clean shutdown. So explicitly
568 // ignore this problem. 574 // ignore this problem.
569 base::WaitableEvent never_signaled_; 575 base::WaitableEvent never_signaled_;
570 #endif 576 #endif
571 577
572 scoped_refptr<ResourceMessageFilter> resource_message_filter_; 578 scoped_refptr<ResourceMessageFilter> resource_message_filter_;
573 579
574 mojom::RouteProviderAssociatedPtr remote_route_provider_; 580 mojom::RouteProviderAssociatedPtr remote_route_provider_;
575 581
576 // A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend 582 // A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend
577 // WeakPtrs which are invalidated any time the RPHI is recycled. 583 // WeakPtrs which are invalidated any time the RPHI is recycled.
578 std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>> 584 std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>>
579 instance_weak_factory_; 585 instance_weak_factory_;
580 586
581 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; 587 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_;
582 588
583 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); 589 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl);
584 }; 590 };
585 591
586 } // namespace content 592 } // namespace content
587 593
588 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ 594 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698