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

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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 306
308 // Creates and adds the IO thread message filters. 307 // Creates and adds the IO thread message filters.
309 void CreateMessageFilters(); 308 void CreateMessageFilters();
310 309
311 // Registers Mojo services to be exposed to the renderer. 310 // Registers Mojo services to be exposed to the renderer.
312 void RegisterMojoServices(); 311 void RegisterMojoServices();
313 312
314 // Control message handlers. 313 // Control message handlers.
315 void OnShutdownRequest(); 314 void OnShutdownRequest();
316 void OnDumpHandlesDone(); 315 void OnDumpHandlesDone();
317 void SuddenTerminationChanged(bool enabled); 316 void OnSuddenTerminationChanged(bool enabled);
318 void OnUserMetricsRecordAction(const std::string& action); 317 void OnUserMetricsRecordAction(const std::string& action);
319 void OnSavedPageAsMHTML(int job_id, int64 mhtml_file_size); 318 void OnSavedPageAsMHTML(int job_id, int64 mhtml_file_size);
320 void OnCloseACK(int old_route_id); 319 void OnCloseACK(int old_route_id);
321 320
322 // Generates a command line to be used to spawn a renderer and appends the 321 // Generates a command line to be used to spawn a renderer and appends the
323 // results to |*command_line|. 322 // results to |*command_line|.
324 void AppendRendererCommandLine(base::CommandLine* command_line) const; 323 void AppendRendererCommandLine(base::CommandLine* command_line) const;
325 324
326 // Copies applicable command line switches from the given |browser_cmd| line 325 // Copies applicable command line switches from the given |browser_cmd| line
327 // 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
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 int id_; 407 int id_;
409 408
410 BrowserContext* browser_context_; 409 BrowserContext* browser_context_;
411 410
412 // Owned by |browser_context_|. 411 // Owned by |browser_context_|.
413 StoragePartitionImpl* storage_partition_impl_; 412 StoragePartitionImpl* storage_partition_impl_;
414 413
415 // The observers watching our lifetime. 414 // The observers watching our lifetime.
416 ObserverList<RenderProcessHostObserver> observers_; 415 ObserverList<RenderProcessHostObserver> observers_;
417 416
418 // True if the process can be shut down suddenly. If this is true, then we're 417 // True if the process can be shut down suddenly. If this is true, then it's
419 // sure that all the RenderViews in the process can be shutdown suddenly. If 418 // sure that all the RenderFrames in the process can be shutdown suddenly. If
420 // it's false, then specific RenderViews might still be allowed to be shutdown 419 // it's false, then specific RenderFrames might still be allowed to be
421 // suddenly by checking their SuddenTerminationAllowed() flag. This can occur 420 // shutdown suddenly by checking their SuddenTerminationAllowed() flag. This
422 // if one WebContents has an unload event listener but another WebContents in 421 // can occur when a RenderFrame has an unload/beforeUnload event listener
423 // the same process doesn't. 422 // registerd but another RenderFrame in the same process doesn't.
Charlie Reis 2015/02/05 17:12:17 nit: registered
clamy 2015/02/05 17:48:46 Done.
424 bool sudden_termination_allowed_; 423 bool sudden_termination_allowed_;
425 424
426 // Set to true if we shouldn't send input events. We actually do the 425 // Set to true if we shouldn't send input events. We actually do the
427 // filtering for this at the render widget level. 426 // filtering for this at the render widget level.
428 bool ignore_input_events_; 427 bool ignore_input_events_;
429 428
430 // Records the last time we regarded the child process active. 429 // Records the last time we regarded the child process active.
431 base::TimeTicks child_process_activity_time_; 430 base::TimeTicks child_process_activity_time_;
432 431
433 // Indicates whether this is a RenderProcessHost of a Browser Plugin guest 432 // Indicates whether this is a RenderProcessHost of a Browser Plugin guest
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 bool subscribe_uniform_enabled_; 500 bool subscribe_uniform_enabled_;
502 501
503 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; 502 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_;
504 503
505 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); 504 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl);
506 }; 505 };
507 506
508 } // namespace content 507 } // namespace content
509 508
510 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ 509 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698