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

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

Issue 2387603003: Resume a backgrounded renderer that was purged and suspended (Closed)
Patch Set: 2min / 1min. 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 override; 168 override;
169 const base::TimeTicks& GetInitTimeForNavigationMetrics() const override; 169 const base::TimeTicks& GetInitTimeForNavigationMetrics() const override;
170 bool IsProcessBackgrounded() const override; 170 bool IsProcessBackgrounded() const override;
171 void IncrementServiceWorkerRefCount() override; 171 void IncrementServiceWorkerRefCount() override;
172 void DecrementServiceWorkerRefCount() override; 172 void DecrementServiceWorkerRefCount() override;
173 void IncrementSharedWorkerRefCount() override; 173 void IncrementSharedWorkerRefCount() override;
174 void DecrementSharedWorkerRefCount() override; 174 void DecrementSharedWorkerRefCount() override;
175 void ForceReleaseWorkerRefCounts() override; 175 void ForceReleaseWorkerRefCounts() override;
176 bool IsWorkerRefCountDisabled() override; 176 bool IsWorkerRefCountDisabled() override;
177 void PurgeAndSuspend() override; 177 void PurgeAndSuspend() override;
178 void Resume() override;
179 const base::TimeTicks& GetLastPurgedAndSuspendedTime() const override;
180 const base::TimeTicks& GetLastResumedInBackgroundTime() const override;
178 181
179 mojom::RouteProvider* GetRemoteRouteProvider(); 182 mojom::RouteProvider* GetRemoteRouteProvider();
180 183
181 static mojom::Renderer* GetRendererInterface(RenderProcessHost* host); 184 static mojom::Renderer* GetRendererInterface(RenderProcessHost* host);
182 185
183 // IPC::Sender via RenderProcessHost. 186 // IPC::Sender via RenderProcessHost.
184 bool Send(IPC::Message* msg) override; 187 bool Send(IPC::Message* msg) override;
185 188
186 // IPC::Listener via RenderProcessHost. 189 // IPC::Listener via RenderProcessHost.
187 bool OnMessageReceived(const IPC::Message& msg) override; 190 bool OnMessageReceived(const IPC::Message& msg) override;
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 std::unique_ptr<base::Thread> in_process_renderer_; 461 std::unique_ptr<base::Thread> in_process_renderer_;
459 462
460 // True after Init() has been called. We can't just check channel_ because we 463 // True after Init() has been called. We can't just check channel_ because we
461 // also reset that in the case of process termination. 464 // also reset that in the case of process termination.
462 bool is_initialized_; 465 bool is_initialized_;
463 466
464 // PlzNavigate 467 // PlzNavigate
465 // Stores the time at which the first call to Init happened. 468 // Stores the time at which the first call to Init happened.
466 base::TimeTicks init_time_; 469 base::TimeTicks init_time_;
467 470
471 // The last time when the renderer is purged and suspended.
472 base::TimeTicks last_purged_and_suspended_time_;
473
474 // The last time when the renderer is resumed in the background.
475 base::TimeTicks last_resumed_in_background_time_;
476
468 // Used to launch and terminate the process without blocking the UI thread. 477 // Used to launch and terminate the process without blocking the UI thread.
469 std::unique_ptr<ChildProcessLauncher> child_process_launcher_; 478 std::unique_ptr<ChildProcessLauncher> child_process_launcher_;
470 479
471 // Messages we queue before the ChannelProxy is created. 480 // Messages we queue before the ChannelProxy is created.
472 using MessageQueue = std::queue<std::unique_ptr<IPC::Message>>; 481 using MessageQueue = std::queue<std::unique_ptr<IPC::Message>>;
473 MessageQueue queued_messages_; 482 MessageQueue queued_messages_;
474 483
475 // The globally-unique identifier for this RPH. 484 // The globally-unique identifier for this RPH.
476 const int id_; 485 const int id_;
477 486
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 instance_weak_factory_; 588 instance_weak_factory_;
580 589
581 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; 590 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_;
582 591
583 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); 592 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl);
584 }; 593 };
585 594
586 } // namespace content 595 } // namespace content
587 596
588 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ 597 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698