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

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

Issue 857213003: Refactor sudden termination (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 base::ProcessHandle GetHandle() const override; 114 base::ProcessHandle GetHandle() const override;
115 BrowserContext* GetBrowserContext() const override; 115 BrowserContext* GetBrowserContext() const override;
116 bool InSameStoragePartition(StoragePartition* partition) const override; 116 bool InSameStoragePartition(StoragePartition* partition) const override;
117 int GetID() const override; 117 int GetID() const override;
118 bool HasConnection() const override; 118 bool HasConnection() const override;
119 void SetIgnoreInputEvents(bool ignore_input_events) override; 119 void SetIgnoreInputEvents(bool ignore_input_events) override;
120 bool IgnoreInputEvents() const override; 120 bool IgnoreInputEvents() const override;
121 void Cleanup() override; 121 void Cleanup() override;
122 void AddPendingView() override; 122 void AddPendingView() override;
123 void RemovePendingView() override; 123 void RemovePendingView() override;
124 void SetSuddenTerminationAllowed(bool enabled) override; 124 void SuddenTerminationChangedForFrame(bool enabled) override;
125 bool SuddenTerminationAllowed() const override; 125 bool SuddenTerminationAllowed() const override;
126 IPC::ChannelProxy* GetChannel() override; 126 IPC::ChannelProxy* GetChannel() override;
127 void AddFilter(BrowserMessageFilter* filter) override; 127 void AddFilter(BrowserMessageFilter* filter) override;
128 bool FastShutdownForPageCount(size_t count) override; 128 bool FastShutdownForPageCount(size_t count) override;
129 bool FastShutdownStarted() const override; 129 bool FastShutdownStarted() const override;
130 base::TimeDelta GetChildProcessIdleTime() const override; 130 base::TimeDelta GetChildProcessIdleTime() const override;
131 void ResumeRequestsForView(int route_id) override; 131 void ResumeRequestsForView(int route_id) override;
132 void FilterURL(bool empty_allowed, GURL* url) override; 132 void FilterURL(bool empty_allowed, GURL* url) override;
133 #if defined(ENABLE_WEBRTC) 133 #if defined(ENABLE_WEBRTC)
134 void EnableAecDump(const base::FilePath& file) override; 134 void EnableAecDump(const base::FilePath& file) override;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 304
305 // Creates and adds the IO thread message filters. 305 // Creates and adds the IO thread message filters.
306 void CreateMessageFilters(); 306 void CreateMessageFilters();
307 307
308 // Registers Mojo services to be exposed to the renderer. 308 // Registers Mojo services to be exposed to the renderer.
309 void RegisterMojoServices(); 309 void RegisterMojoServices();
310 310
311 // Control message handlers. 311 // Control message handlers.
312 void OnShutdownRequest(); 312 void OnShutdownRequest();
313 void OnDumpHandlesDone(); 313 void OnDumpHandlesDone();
314 void SuddenTerminationChanged(bool enabled); 314 void OnSuddenTerminationChanged(bool enabled);
315 void OnUserMetricsRecordAction(const std::string& action); 315 void OnUserMetricsRecordAction(const std::string& action);
316 void OnSavedPageAsMHTML(int job_id, int64 mhtml_file_size); 316 void OnSavedPageAsMHTML(int job_id, int64 mhtml_file_size);
317 void OnCloseACK(int old_route_id); 317 void OnCloseACK(int old_route_id);
318 318
319 // Generates a command line to be used to spawn a renderer and appends the 319 // Generates a command line to be used to spawn a renderer and appends the
320 // results to |*command_line|. 320 // results to |*command_line|.
321 void AppendRendererCommandLine(base::CommandLine* command_line) const; 321 void AppendRendererCommandLine(base::CommandLine* command_line) const;
322 322
323 // Copies applicable command line switches from the given |browser_cmd| line 323 // Copies applicable command line switches from the given |browser_cmd| line
324 // flags to the output |renderer_cmd| line flags. Not all switches will be 324 // flags to the output |renderer_cmd| line flags. Not all switches will be
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 int id_; 405 int id_;
406 406
407 BrowserContext* browser_context_; 407 BrowserContext* browser_context_;
408 408
409 // Owned by |browser_context_|. 409 // Owned by |browser_context_|.
410 StoragePartitionImpl* storage_partition_impl_; 410 StoragePartitionImpl* storage_partition_impl_;
411 411
412 // The observers watching our lifetime. 412 // The observers watching our lifetime.
413 ObserverList<RenderProcessHostObserver> observers_; 413 ObserverList<RenderProcessHostObserver> observers_;
414 414
415 // True if the process can be shut down suddenly. If this is true, then we're 415 // Number of frames that have disallowed sudden termination. If this is 0,
416 // sure that all the RenderViews in the process can be shutdown suddenly. If 416 // then we're sure that all the RenderFrames in the process can be shutdown
417 // it's false, then specific RenderViews might still be allowed to be shutdown 417 // suddenly. If it's not 0, then specific RenderFrames might still be allowed
418 // suddenly by checking their SuddenTerminationAllowed() flag. This can occur 418 // to be shutdown suddenly by checking their SuddenTerminationAllowed() flag.
419 // if one WebContents has an unload event listener but another WebContents in 419 // This can occur if one WebContents has an unload event listener but another
420 // the same process doesn't. 420 // WebContents in the same process doesn't.
421 bool sudden_termination_allowed_; 421 int sudden_termination_disallows_;
422
423 // Whether the sudden termination of the process was enabled on a process
424 // level. This is independant from the status of the various RenderFrames in
425 // the process: even if this is false, some RenderFrames may be shutdown
426 // suddenly if their SuddenTerminationAllowed() flag is true. Similarly, if it
427 // is true, but some of the RenderFrames cannot be shutdown suddenly, then the
428 // process cannot be suddenly terminated.
429 bool sudden_termination_enabled_;
clamy 2015/01/20 16:54:15 After discussing with michaeln@ it seems we cannot
Charlie Reis 2015/01/23 06:01:32 That's fine, but I don't understand why we're addi
clamy 2015/01/26 16:38:40 I removed the count of frames that have sudden ter
Charlie Reis 2015/01/29 23:20:40 I think my comments in WebContentsImpl::NeedToFire
422 430
423 // Set to true if we shouldn't send input events. We actually do the 431 // Set to true if we shouldn't send input events. We actually do the
424 // filtering for this at the render widget level. 432 // filtering for this at the render widget level.
425 bool ignore_input_events_; 433 bool ignore_input_events_;
426 434
427 // Records the last time we regarded the child process active. 435 // Records the last time we regarded the child process active.
428 base::TimeTicks child_process_activity_time_; 436 base::TimeTicks child_process_activity_time_;
429 437
430 // Indicates whether this is a RenderProcessHost of a Browser Plugin guest 438 // Indicates whether this is a RenderProcessHost of a Browser Plugin guest
431 // renderer. 439 // renderer.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 bool subscribe_uniform_enabled_; 502 bool subscribe_uniform_enabled_;
495 503
496 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; 504 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_;
497 505
498 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); 506 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl);
499 }; 507 };
500 508
501 } // namespace content 509 } // namespace content
502 510
503 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ 511 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698