Chromium Code Reviews| Index: content/public/browser/browser_child_process_observer.h |
| diff --git a/content/public/browser/browser_child_process_observer.h b/content/public/browser/browser_child_process_observer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f17cbf8a649c964e461aa362eff6eb533b214101 |
| --- /dev/null |
| +++ b/content/public/browser/browser_child_process_observer.h |
| @@ -0,0 +1,45 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
|
tfarina
2013/02/26 19:47:25
no (c)
Paweł Hajdan Jr.
2013/02/27 19:13:23
Done.
Note that I see little point for drive-bys
tfarina
2013/02/27 19:17:13
If no one points, people will keep using it.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_OBSERVER_H_ |
| +#define CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_OBSERVER_H_ |
| + |
| +#include "base/basictypes.h" |
|
tfarina
2013/02/26 19:47:25
can you remove this now?
Paweł Hajdan Jr.
2013/02/27 19:13:23
Done.
|
| +#include "content/common/content_export.h" |
| + |
| +namespace content { |
| + |
| +struct ChildProcessData; |
| + |
| +// An observer API implemented by classes which are interested |
| +// in browser child process events. |
| +class CONTENT_EXPORT BrowserChildProcessObserver { |
| + public: |
| + // Called when a child process host has connected to a child process. |
| + virtual void BrowserChildProcessHostConnected(const ChildProcessData& data) {} |
| + |
| + // Called after a ChildProcessHost is disconnected from the child process. |
| + virtual void BrowserChildProcessHostDisconnected( |
| + const ChildProcessData& data) {} |
| + |
| + // Called when a child process disappears unexpectedly as a result of a crash. |
| + virtual void BrowserChildProcessCrashed(const ChildProcessData& data) {} |
| + |
| + // Called when an instance of a particular child is created in a page. If one |
| + // page contains several regions rendered by the same child, this will be |
| + // called once for each region during the page load. |
| + virtual void BrowserChildProcessInstanceCreated( |
| + const ChildProcessData& data) {} |
| + |
| + protected: |
| + // The observer can be destroyed on any thread. |
| + virtual ~BrowserChildProcessObserver() {} |
| + |
| + static void Add(BrowserChildProcessObserver* observer); |
| + static void Remove(BrowserChildProcessObserver* observer); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_BROWSER_BROWSER_CHILD_PROCESS_OBSERVER_H_ |