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

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

Issue 1214393004: Proposed new approach for SetBackgrounded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dchecks. Created 5 years, 5 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 <map> 8 #include <map>
9 #include <queue> 9 #include <queue>
10 #include <string> 10 #include <string>
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 // results to |*command_line|. 322 // results to |*command_line|.
323 void AppendRendererCommandLine(base::CommandLine* command_line) const; 323 void AppendRendererCommandLine(base::CommandLine* command_line) const;
324 324
325 // Copies applicable command line switches from the given |browser_cmd| line 325 // Copies applicable command line switches from the given |browser_cmd| line
326 // flags to the output |renderer_cmd| line flags. Not all switches will be 326 // flags to the output |renderer_cmd| line flags. Not all switches will be
327 // copied over. 327 // copied over.
328 void PropagateBrowserCommandLineToRenderer( 328 void PropagateBrowserCommandLineToRenderer(
329 const base::CommandLine& browser_cmd, 329 const base::CommandLine& browser_cmd,
330 base::CommandLine* renderer_cmd) const; 330 base::CommandLine* renderer_cmd) const;
331 331
332 // Callers can reduce the RenderProcess' priority. 332 // Inspects the current object state and sets/removes background priority if
333 void SetBackgrounded(bool backgrounded); 333 // appropriate. Should be called after any of the involved data members
334 // change.
335 void UpdateProcessPriority();
334 336
335 // Handle termination of our process. 337 // Handle termination of our process.
336 void ProcessDied(bool already_dead, RendererClosedDetails* known_details); 338 void ProcessDied(bool already_dead, RendererClosedDetails* known_details);
337 339
338 // GpuSwitchingObserver implementation. 340 // GpuSwitchingObserver implementation.
339 void OnGpuSwitched() override; 341 void OnGpuSwitched() override;
340 342
341 #if defined(ENABLE_WEBRTC) 343 #if defined(ENABLE_WEBRTC)
342 void OnRegisterAecDumpConsumer(int id); 344 void OnRegisterAecDumpConsumer(int id);
343 void OnUnregisterAecDumpConsumer(int id); 345 void OnUnregisterAecDumpConsumer(int id);
(...skipping 10 matching lines...) Expand all
354 356
355 // The registered IPC listener objects. When this list is empty, we should 357 // The registered IPC listener objects. When this list is empty, we should
356 // delete ourselves. 358 // delete ourselves.
357 IDMap<IPC::Listener> listeners_; 359 IDMap<IPC::Listener> listeners_;
358 360
359 // The count of currently visible widgets. Since the host can be a container 361 // The count of currently visible widgets. Since the host can be a container
360 // for multiple widgets, it uses this count to determine when it should be 362 // for multiple widgets, it uses this count to determine when it should be
361 // backgrounded. 363 // backgrounded.
362 int32 visible_widgets_; 364 int32 visible_widgets_;
363 365
364 // Does this process have backgrounded priority. 366 // Whether this process currently has backgrounded priority. Tracked so that
365 bool backgrounded_; 367 // UpdateProcessPriority() can avoid redundantly setting the priority.
368 bool is_process_backgrounded_;
366 369
367 // Used to allow a RenderWidgetHost to intercept various messages on the 370 // Used to allow a RenderWidgetHost to intercept various messages on the
368 // IO thread. 371 // IO thread.
369 scoped_refptr<RenderWidgetHelper> widget_helper_; 372 scoped_refptr<RenderWidgetHelper> widget_helper_;
370 373
371 // The filter for GPU-related messages coming from the renderer. 374 // The filter for GPU-related messages coming from the renderer.
372 // Thread safety note: this field is to be accessed from the UI thread. 375 // Thread safety note: this field is to be accessed from the UI thread.
373 // We don't keep a reference to it, to avoid it being destroyed on the UI 376 // We don't keep a reference to it, to avoid it being destroyed on the UI
374 // thread, but we clear this field when we clear channel_. When channel_ goes 377 // thread, but we clear this field when we clear channel_. When channel_ goes
375 // away, it posts a task to the IO thread to destroy it there, so we know that 378 // away, it posts a task to the IO thread to destroy it there, so we know that
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 #endif 511 #endif
509 512
510 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; 513 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_;
511 514
512 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); 515 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl);
513 }; 516 };
514 517
515 } // namespace content 518 } // namespace content
516 519
517 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ 520 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698