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

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: Addressed Charlie's comments Created 5 years, 10 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;
125 bool SuddenTerminationAllowed() const override; 124 bool SuddenTerminationAllowed() const override;
126 IPC::ChannelProxy* GetChannel() override; 125 IPC::ChannelProxy* GetChannel() override;
127 void AddFilter(BrowserMessageFilter* filter) override; 126 void AddFilter(BrowserMessageFilter* filter) override;
128 bool FastShutdownForPageCount(size_t count) override; 127 bool FastShutdownForPageCount(size_t count) override;
129 bool FastShutdownStarted() const override; 128 bool FastShutdownStarted() const override;
130 base::TimeDelta GetChildProcessIdleTime() const override; 129 base::TimeDelta GetChildProcessIdleTime() const override;
131 void ResumeRequestsForView(int route_id) override; 130 void ResumeRequestsForView(int route_id) override;
132 void FilterURL(bool empty_allowed, GURL* url) override; 131 void FilterURL(bool empty_allowed, GURL* url) override;
133 #if defined(ENABLE_WEBRTC) 132 #if defined(ENABLE_WEBRTC)
134 void EnableAecDump(const base::FilePath& file) override; 133 void EnableAecDump(const base::FilePath& file) override;
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 304
306 // Creates and adds the IO thread message filters. 305 // Creates and adds the IO thread message filters.
307 void CreateMessageFilters(); 306 void CreateMessageFilters();
308 307
309 // Registers Mojo services to be exposed to the renderer. 308 // Registers Mojo services to be exposed to the renderer.
310 void RegisterMojoServices(); 309 void RegisterMojoServices();
311 310
312 // Control message handlers. 311 // Control message handlers.
313 void OnShutdownRequest(); 312 void OnShutdownRequest();
314 void OnDumpHandlesDone(); 313 void OnDumpHandlesDone();
315 void SuddenTerminationChanged(bool enabled); 314 void OnSuddenTerminationChanged(bool enabled);
316 void OnUserMetricsRecordAction(const std::string& action); 315 void OnUserMetricsRecordAction(const std::string& action);
317 void OnSavedPageAsMHTML(int job_id, int64 mhtml_file_size); 316 void OnSavedPageAsMHTML(int job_id, int64 mhtml_file_size);
318 void OnCloseACK(int old_route_id); 317 void OnCloseACK(int old_route_id);
319 318
320 // 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
321 // results to |*command_line|. 320 // results to |*command_line|.
322 void AppendRendererCommandLine(base::CommandLine* command_line) const; 321 void AppendRendererCommandLine(base::CommandLine* command_line) const;
323 322
324 // Copies applicable command line switches from the given |browser_cmd| line 323 // Copies applicable command line switches from the given |browser_cmd| line
325 // 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
406 int id_; 405 int id_;
407 406
408 BrowserContext* browser_context_; 407 BrowserContext* browser_context_;
409 408
410 // Owned by |browser_context_|. 409 // Owned by |browser_context_|.
411 StoragePartitionImpl* storage_partition_impl_; 410 StoragePartitionImpl* storage_partition_impl_;
412 411
413 // The observers watching our lifetime. 412 // The observers watching our lifetime.
414 ObserverList<RenderProcessHostObserver> observers_; 413 ObserverList<RenderProcessHostObserver> observers_;
415 414
416 // True if the process can be shut down suddenly. If this is true, then we're 415 // Whether the sudden termination of the process is allowed at a process
417 // sure that all the RenderViews in the process can be shutdown suddenly. If 416 // level. This is independent from the status of the various RenderFrames in
418 // it's false, then specific RenderViews might still be allowed to be shutdown 417 // the process: even if this is false, some RenderFrames may be shutdown
419 // suddenly by checking their SuddenTerminationAllowed() flag. This can occur 418 // suddenly if their SuddenTerminationAllowed() flag is true. Similarly, if it
420 // if one WebContents has an unload event listener but another WebContents in 419 // is true, but some of the RenderFrames cannot be shutdown suddenly, then the
421 // the same process doesn't. 420 // process cannot be suddenly terminated.
422 bool sudden_termination_allowed_; 421 bool sudden_termination_allowed_;
423 422
424 // Set to true if we shouldn't send input events. We actually do the 423 // Set to true if we shouldn't send input events. We actually do the
425 // filtering for this at the render widget level. 424 // filtering for this at the render widget level.
426 bool ignore_input_events_; 425 bool ignore_input_events_;
427 426
428 // Records the last time we regarded the child process active. 427 // Records the last time we regarded the child process active.
429 base::TimeTicks child_process_activity_time_; 428 base::TimeTicks child_process_activity_time_;
430 429
431 // Indicates whether this is a RenderProcessHost of a Browser Plugin guest 430 // Indicates whether this is a RenderProcessHost of a Browser Plugin guest
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 bool subscribe_uniform_enabled_; 498 bool subscribe_uniform_enabled_;
500 499
501 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; 500 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_;
502 501
503 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); 502 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl);
504 }; 503 };
505 504
506 } // namespace content 505 } // namespace content
507 506
508 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ 507 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698