| Index: chrome/browser/renderer_host/file_utilities_message_filter.h
|
| ===================================================================
|
| --- chrome/browser/renderer_host/file_utilities_message_filter.h (revision 68877)
|
| +++ chrome/browser/renderer_host/file_utilities_message_filter.h (working copy)
|
| @@ -2,14 +2,13 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CHROME_BROWSER_RENDERER_HOST_FILE_UTILITIES_DISPATCHER_HOST_H_
|
| -#define CHROME_BROWSER_RENDERER_HOST_FILE_UTILITIES_DISPATCHER_HOST_H_
|
| +#ifndef CHROME_BROWSER_RENDERER_HOST_FILE_UTILITIES_MESSAGE_FILTER_H_
|
| +#define CHROME_BROWSER_RENDERER_HOST_FILE_UTILITIES_MESSAGE_FILTER_H_
|
|
|
| #include "base/basictypes.h"
|
| #include "base/file_path.h"
|
| -#include "base/process.h"
|
| -#include "base/ref_counted.h"
|
| -#include "ipc/ipc_message.h"
|
| +#include "chrome/browser/browser_message_filter.h"
|
| +#include "ipc/ipc_platform_file.h"
|
|
|
| namespace base {
|
| struct PlatformFileInfo;
|
| @@ -19,45 +18,31 @@
|
| class Message;
|
| }
|
|
|
| -class FileUtilitiesDispatcherHost
|
| - : public base::RefCountedThreadSafe<FileUtilitiesDispatcherHost> {
|
| +class FileUtilitiesMessageFilter : public BrowserMessageFilter {
|
| public:
|
| - FileUtilitiesDispatcherHost(IPC::Message::Sender* sender, int process_id);
|
| - void Init(base::ProcessHandle process_handle);
|
| - void Shutdown();
|
| - bool OnMessageReceived(const IPC::Message& message);
|
| + explicit FileUtilitiesMessageFilter(int process_id);
|
|
|
| - void Send(IPC::Message* message);
|
| -
|
| + // BrowserMessageFilter implementation.
|
| + virtual void OverrideThreadForMessage(const IPC::Message& message,
|
| + BrowserThread::ID* thread);
|
| + virtual bool OnMessageReceived(const IPC::Message& message,
|
| + bool* message_was_ok);
|
| private:
|
| - friend class base::RefCountedThreadSafe<FileUtilitiesDispatcherHost>;
|
| - ~FileUtilitiesDispatcherHost();
|
| + ~FileUtilitiesMessageFilter();
|
|
|
| typedef void (*FileInfoWriteFunc)(IPC::Message* reply_msg,
|
| const base::PlatformFileInfo& file_info);
|
|
|
| - void OnGetFileSize(const FilePath& path, IPC::Message* reply_msg);
|
| - void OnGetFileModificationTime(const FilePath& path, IPC::Message* reply_msg);
|
| - void OnGetFileInfoOnFileThread(const FilePath& path,
|
| - IPC::Message* reply_msg,
|
| - FileInfoWriteFunc write_func);
|
| - void OnOpenFile(const FilePath& path, int mode,IPC::Message* reply_msg);
|
| - void OnOpenFileOnFileThread(const FilePath& path,
|
| - int mode,
|
| - IPC::Message* reply_msg);
|
| + void OnGetFileSize(const FilePath& path, int64* result);
|
| + void OnGetFileModificationTime(const FilePath& path, base::Time* result);
|
| + void OnOpenFile(const FilePath& path,
|
| + int mode,
|
| + IPC::PlatformFileForTransit* result);
|
|
|
| - // The sender to be used for sending out IPC messages.
|
| - IPC::Message::Sender* message_sender_;
|
| -
|
| // The ID of this process.
|
| int process_id_;
|
|
|
| - // The handle of this process.
|
| - base::ProcessHandle process_handle_;
|
| -
|
| - bool shutdown_;
|
| -
|
| - DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilitiesDispatcherHost);
|
| + DISALLOW_IMPLICIT_CONSTRUCTORS(FileUtilitiesMessageFilter);
|
| };
|
|
|
| -#endif // CHROME_BROWSER_RENDERER_HOST_FILE_UTILITIES_DISPATCHER_HOST_H_
|
| +#endif // CHROME_BROWSER_RENDERER_HOST_FILE_UTILITIES_MESSAGE_FILTER_H_
|
|
|