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

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

Issue 72203003: Introduce RenderProcessHostObserver, use it in its first client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed Created 7 years, 1 month 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 | Annotate | Revision Log
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_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_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>
11 11
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/observer_list.h"
13 #include "base/process/process.h" 14 #include "base/process/process.h"
14 #include "base/timer/timer.h" 15 #include "base/timer/timer.h"
15 #include "content/browser/child_process_launcher.h" 16 #include "content/browser/child_process_launcher.h"
16 #include "content/browser/power_monitor_message_broadcaster.h" 17 #include "content/browser/power_monitor_message_broadcaster.h"
17 #include "content/common/content_export.h" 18 #include "content/common/content_export.h"
18 #include "content/public/browser/global_request_id.h" 19 #include "content/public/browser/global_request_id.h"
19 #include "content/public/browser/gpu_data_manager_observer.h" 20 #include "content/public/browser/gpu_data_manager_observer.h"
20 #include "content/public/browser/render_process_host.h" 21 #include "content/public/browser/render_process_host.h"
21 #include "ipc/ipc_channel_proxy.h" 22 #include "ipc/ipc_channel_proxy.h"
22 #include "ui/surface/transport_dib.h" 23 #include "ui/surface/transport_dib.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 bool supports_browser_plugin, 76 bool supports_browser_plugin,
76 bool is_guest); 77 bool is_guest);
77 virtual ~RenderProcessHostImpl(); 78 virtual ~RenderProcessHostImpl();
78 79
79 // RenderProcessHost implementation (public portion). 80 // RenderProcessHost implementation (public portion).
80 virtual void EnableSendQueue() OVERRIDE; 81 virtual void EnableSendQueue() OVERRIDE;
81 virtual bool Init() OVERRIDE; 82 virtual bool Init() OVERRIDE;
82 virtual int GetNextRoutingID() OVERRIDE; 83 virtual int GetNextRoutingID() OVERRIDE;
83 virtual void AddRoute(int32 routing_id, IPC::Listener* listener) OVERRIDE; 84 virtual void AddRoute(int32 routing_id, IPC::Listener* listener) OVERRIDE;
84 virtual void RemoveRoute(int32 routing_id) OVERRIDE; 85 virtual void RemoveRoute(int32 routing_id) OVERRIDE;
86 virtual void AddObserver(RenderProcessHostObserver* observer) OVERRIDE;
87 virtual void RemoveObserver(RenderProcessHostObserver* observer) OVERRIDE;
85 virtual bool WaitForBackingStoreMsg(int render_widget_id, 88 virtual bool WaitForBackingStoreMsg(int render_widget_id,
86 const base::TimeDelta& max_delay, 89 const base::TimeDelta& max_delay,
87 IPC::Message* msg) OVERRIDE; 90 IPC::Message* msg) OVERRIDE;
88 virtual void ReceivedBadMessage() OVERRIDE; 91 virtual void ReceivedBadMessage() OVERRIDE;
89 virtual void WidgetRestored() OVERRIDE; 92 virtual void WidgetRestored() OVERRIDE;
90 virtual void WidgetHidden() OVERRIDE; 93 virtual void WidgetHidden() OVERRIDE;
91 virtual int VisibleWidgetCount() const OVERRIDE; 94 virtual int VisibleWidgetCount() const OVERRIDE;
92 virtual bool IsGuest() const OVERRIDE; 95 virtual bool IsGuest() const OVERRIDE;
93 virtual StoragePartition* GetStoragePartition() const OVERRIDE; 96 virtual StoragePartition* GetStoragePartition() const OVERRIDE;
94 virtual bool FastShutdownIfPossible() OVERRIDE; 97 virtual bool FastShutdownIfPossible() OVERRIDE;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 std::queue<IPC::Message*> queued_messages_; 303 std::queue<IPC::Message*> queued_messages_;
301 304
302 // The globally-unique identifier for this RPH. 305 // The globally-unique identifier for this RPH.
303 int id_; 306 int id_;
304 307
305 BrowserContext* browser_context_; 308 BrowserContext* browser_context_;
306 309
307 // Owned by |browser_context_|. 310 // Owned by |browser_context_|.
308 StoragePartitionImpl* storage_partition_impl_; 311 StoragePartitionImpl* storage_partition_impl_;
309 312
313 // The observers watching our lifetime.
314 ObserverList<RenderProcessHostObserver> observers_;
315
310 // True if the process can be shut down suddenly. If this is true, then we're 316 // True if the process can be shut down suddenly. If this is true, then we're
311 // sure that all the RenderViews in the process can be shutdown suddenly. If 317 // sure that all the RenderViews in the process can be shutdown suddenly. If
312 // it's false, then specific RenderViews might still be allowed to be shutdown 318 // it's false, then specific RenderViews might still be allowed to be shutdown
313 // suddenly by checking their SuddenTerminationAllowed() flag. This can occur 319 // suddenly by checking their SuddenTerminationAllowed() flag. This can occur
314 // if one WebContents has an unload event listener but another WebContents in 320 // if one WebContents has an unload event listener but another WebContents in
315 // the same process doesn't. 321 // the same process doesn't.
316 bool sudden_termination_allowed_; 322 bool sudden_termination_allowed_;
317 323
318 // Set to true if we shouldn't send input events. We actually do the 324 // Set to true if we shouldn't send input events. We actually do the
319 // filtering for this at the render widget level. 325 // filtering for this at the render widget level.
(...skipping 26 matching lines...) Expand all
346 #if defined(OS_ANDROID) 352 #if defined(OS_ANDROID)
347 scoped_refptr<BrowserDemuxerAndroid> browser_demuxer_android_; 353 scoped_refptr<BrowserDemuxerAndroid> browser_demuxer_android_;
348 #endif 354 #endif
349 355
350 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); 356 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl);
351 }; 357 };
352 358
353 } // namespace content 359 } // namespace content
354 360
355 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ 361 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_process_host_impl.cc » ('j') | content/browser/site_instance_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698