OLD | NEW |
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_FILE_UTILITIES_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_FILE_UTILITIES_MESSAGE_FILTER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_FILE_UTILITIES_MESSAGE_FILTER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_FILE_UTILITIES_MESSAGE_FILTER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "content/public/browser/browser_message_filter.h" | 11 #include "content/public/browser/browser_message_filter.h" |
12 | 12 |
13 namespace IPC { | 13 namespace IPC { |
14 class Message; | 14 class Message; |
15 } | 15 } |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 class FileUtilitiesMessageFilter : public BrowserMessageFilter { | 19 class FileUtilitiesMessageFilter : public BrowserMessageFilter { |
20 public: | 20 public: |
21 explicit FileUtilitiesMessageFilter(int process_id); | 21 explicit FileUtilitiesMessageFilter(int process_id); |
22 | 22 |
23 // BrowserMessageFilter implementation. | 23 // BrowserMessageFilter implementation. |
24 virtual void OverrideThreadForMessage( | 24 virtual void OverrideThreadForMessage( |
25 const IPC::Message& message, | 25 const IPC::Message& message, |
26 BrowserThread::ID* thread) OVERRIDE; | 26 BrowserThread::ID* thread) OVERRIDE; |
27 virtual bool OnMessageReceived(const IPC::Message& message, | 27 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
28 bool* message_was_ok) OVERRIDE; | |
29 private: | 28 private: |
30 virtual ~FileUtilitiesMessageFilter(); | 29 virtual ~FileUtilitiesMessageFilter(); |
31 | 30 |
32 typedef void (*FileInfoWriteFunc)(IPC::Message* reply_msg, | 31 typedef void (*FileInfoWriteFunc)(IPC::Message* reply_msg, |
33 const base::File::Info& file_info); | 32 const base::File::Info& file_info); |
34 | 33 |
35 void OnGetFileInfo(const base::FilePath& path, | 34 void OnGetFileInfo(const base::FilePath& path, |
36 base::File::Info* result, | 35 base::File::Info* result, |
37 base::File::Error* status); | 36 base::File::Error* status); |
38 | 37 |
39 // The ID of this process. | 38 // The ID of this process. |
40 int process_id_; | 39 int process_id_; |
41 | 40 |
42 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilitiesMessageFilter); | 41 DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilitiesMessageFilter); |
43 }; | 42 }; |
44 | 43 |
45 } // namespace content | 44 } // namespace content |
46 | 45 |
47 #endif // CONTENT_BROWSER_RENDERER_HOST_FILE_UTILITIES_MESSAGE_FILTER_H_ | 46 #endif // CONTENT_BROWSER_RENDERER_HOST_FILE_UTILITIES_MESSAGE_FILTER_H_ |
OLD | NEW |