| 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 #include "content/browser/fileapi/fileapi_message_filter.h" | 5 #include "content/browser/fileapi/fileapi_message_filter.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 operations_.clear(); | 137 operations_.clear(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 base::TaskRunner* FileAPIMessageFilter::OverrideTaskRunnerForMessage( | 140 base::TaskRunner* FileAPIMessageFilter::OverrideTaskRunnerForMessage( |
| 141 const IPC::Message& message) { | 141 const IPC::Message& message) { |
| 142 if (message.type() == FileSystemHostMsg_SyncGetPlatformPath::ID) | 142 if (message.type() == FileSystemHostMsg_SyncGetPlatformPath::ID) |
| 143 return context_->default_file_task_runner(); | 143 return context_->default_file_task_runner(); |
| 144 return NULL; | 144 return NULL; |
| 145 } | 145 } |
| 146 | 146 |
| 147 bool FileAPIMessageFilter::OnMessageReceived( | 147 bool FileAPIMessageFilter::OnMessageReceived(const IPC::Message& message) { |
| 148 const IPC::Message& message, bool* message_was_ok) { | |
| 149 *message_was_ok = true; | |
| 150 bool handled = true; | 148 bool handled = true; |
| 151 IPC_BEGIN_MESSAGE_MAP_EX(FileAPIMessageFilter, message, *message_was_ok) | 149 IPC_BEGIN_MESSAGE_MAP(FileAPIMessageFilter, message) |
| 152 IPC_MESSAGE_HANDLER(FileSystemHostMsg_OpenFileSystem, OnOpenFileSystem) | 150 IPC_MESSAGE_HANDLER(FileSystemHostMsg_OpenFileSystem, OnOpenFileSystem) |
| 153 IPC_MESSAGE_HANDLER(FileSystemHostMsg_ResolveURL, OnResolveURL) | 151 IPC_MESSAGE_HANDLER(FileSystemHostMsg_ResolveURL, OnResolveURL) |
| 154 IPC_MESSAGE_HANDLER(FileSystemHostMsg_DeleteFileSystem, OnDeleteFileSystem) | 152 IPC_MESSAGE_HANDLER(FileSystemHostMsg_DeleteFileSystem, OnDeleteFileSystem) |
| 155 IPC_MESSAGE_HANDLER(FileSystemHostMsg_Move, OnMove) | 153 IPC_MESSAGE_HANDLER(FileSystemHostMsg_Move, OnMove) |
| 156 IPC_MESSAGE_HANDLER(FileSystemHostMsg_Copy, OnCopy) | 154 IPC_MESSAGE_HANDLER(FileSystemHostMsg_Copy, OnCopy) |
| 157 IPC_MESSAGE_HANDLER(FileSystemHostMsg_Remove, OnRemove) | 155 IPC_MESSAGE_HANDLER(FileSystemHostMsg_Remove, OnRemove) |
| 158 IPC_MESSAGE_HANDLER(FileSystemHostMsg_ReadMetadata, OnReadMetadata) | 156 IPC_MESSAGE_HANDLER(FileSystemHostMsg_ReadMetadata, OnReadMetadata) |
| 159 IPC_MESSAGE_HANDLER(FileSystemHostMsg_Create, OnCreate) | 157 IPC_MESSAGE_HANDLER(FileSystemHostMsg_Create, OnCreate) |
| 160 IPC_MESSAGE_HANDLER(FileSystemHostMsg_Exists, OnExists) | 158 IPC_MESSAGE_HANDLER(FileSystemHostMsg_Exists, OnExists) |
| 161 IPC_MESSAGE_HANDLER(FileSystemHostMsg_ReadDirectory, OnReadDirectory) | 159 IPC_MESSAGE_HANDLER(FileSystemHostMsg_ReadDirectory, OnReadDirectory) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 185 IPC_MESSAGE_HANDLER(StreamHostMsg_StartBuilding, OnStartBuildingStream) | 183 IPC_MESSAGE_HANDLER(StreamHostMsg_StartBuilding, OnStartBuildingStream) |
| 186 IPC_MESSAGE_HANDLER(StreamHostMsg_AppendBlobDataItem, | 184 IPC_MESSAGE_HANDLER(StreamHostMsg_AppendBlobDataItem, |
| 187 OnAppendBlobDataItemToStream) | 185 OnAppendBlobDataItemToStream) |
| 188 IPC_MESSAGE_HANDLER(StreamHostMsg_SyncAppendSharedMemory, | 186 IPC_MESSAGE_HANDLER(StreamHostMsg_SyncAppendSharedMemory, |
| 189 OnAppendSharedMemoryToStream) | 187 OnAppendSharedMemoryToStream) |
| 190 IPC_MESSAGE_HANDLER(StreamHostMsg_FinishBuilding, OnFinishBuildingStream) | 188 IPC_MESSAGE_HANDLER(StreamHostMsg_FinishBuilding, OnFinishBuildingStream) |
| 191 IPC_MESSAGE_HANDLER(StreamHostMsg_AbortBuilding, OnAbortBuildingStream) | 189 IPC_MESSAGE_HANDLER(StreamHostMsg_AbortBuilding, OnAbortBuildingStream) |
| 192 IPC_MESSAGE_HANDLER(StreamHostMsg_Clone, OnCloneStream) | 190 IPC_MESSAGE_HANDLER(StreamHostMsg_Clone, OnCloneStream) |
| 193 IPC_MESSAGE_HANDLER(StreamHostMsg_Remove, OnRemoveStream) | 191 IPC_MESSAGE_HANDLER(StreamHostMsg_Remove, OnRemoveStream) |
| 194 IPC_MESSAGE_UNHANDLED(handled = false) | 192 IPC_MESSAGE_UNHANDLED(handled = false) |
| 195 IPC_END_MESSAGE_MAP_EX() | 193 IPC_END_MESSAGE_MAP() |
| 196 return handled; | 194 return handled; |
| 197 } | 195 } |
| 198 | 196 |
| 199 FileAPIMessageFilter::~FileAPIMessageFilter() {} | 197 FileAPIMessageFilter::~FileAPIMessageFilter() {} |
| 200 | 198 |
| 201 void FileAPIMessageFilter::BadMessageReceived() { | 199 void FileAPIMessageFilter::BadMessageReceived() { |
| 202 RecordAction(base::UserMetricsAction("BadMessageTerminate_FAMF")); | 200 RecordAction(base::UserMetricsAction("BadMessageTerminate_FAMF")); |
| 203 BrowserMessageFilter::BadMessageReceived(); | 201 BrowserMessageFilter::BadMessageReceived(); |
| 204 } | 202 } |
| 205 | 203 |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 } | 868 } |
| 871 | 869 |
| 872 return true; | 870 return true; |
| 873 } | 871 } |
| 874 | 872 |
| 875 scoped_refptr<Stream> FileAPIMessageFilter::GetStreamForURL(const GURL& url) { | 873 scoped_refptr<Stream> FileAPIMessageFilter::GetStreamForURL(const GURL& url) { |
| 876 return stream_context_->registry()->GetStream(url); | 874 return stream_context_->registry()->GetStream(url); |
| 877 } | 875 } |
| 878 | 876 |
| 879 } // namespace content | 877 } // namespace content |
| OLD | NEW |