blob: c449fd9889d1669f9d1aa36c7d8d675e072db6c7 [file] [log] [blame]
[email protected]c4f883a2012-02-03 17:02:071// 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
3// found in the LICENSE file.
4
5#ifndef CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_HOST_CLIENT_H_
6#define CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_HOST_CLIENT_H_
7#pragma once
8
9#include "base/memory/ref_counted.h"
10#include "content/common/content_export.h"
11
12namespace IPC {
13class Message;
14}
15
16namespace content {
17
18// An interface to be implemented by consumers of the utility process to
19// get results back. All functions are called on the thread passed along
20// to UtilityProcessHost.
21class UtilityProcessHostClient
22 : public base::RefCountedThreadSafe<UtilityProcessHostClient> {
23 public:
24 // Called when the process has crashed.
25 virtual void OnProcessCrashed(int exit_code) {}
26
27 // Allow the client to filter IPC messages.
28 virtual bool OnMessageReceived(const IPC::Message& message) = 0;
29
30 protected:
31 friend class base::RefCountedThreadSafe<UtilityProcessHostClient>;
32
33 virtual ~UtilityProcessHostClient() {}
34};
35
36}; // namespace content
37
38#endif // CONTENT_PUBLIC_BROWSER_UTILITY_PROCESS_HOST_CLIENT_H_