| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 using fileapi::FileSystemOperation; | 46 using fileapi::FileSystemOperation; |
| 47 using fileapi::FileSystemURL; | 47 using fileapi::FileSystemURL; |
| 48 using webkit_blob::BlobData; | 48 using webkit_blob::BlobData; |
| 49 using webkit_blob::BlobStorageContext; | 49 using webkit_blob::BlobStorageContext; |
| 50 using webkit_blob::BlobStorageHost; | 50 using webkit_blob::BlobStorageHost; |
| 51 | 51 |
| 52 namespace content { | 52 namespace content { |
| 53 | 53 |
| 54 namespace { | 54 namespace { |
| 55 | 55 |
| 56 const uint32 kFilteredMessageClasses[] = { | |
| 57 BlobMsgStart, | |
| 58 FileSystemMsgStart, | |
| 59 }; | |
| 60 | |
| 61 void RevokeFilePermission(int child_id, const base::FilePath& path) { | 56 void RevokeFilePermission(int child_id, const base::FilePath& path) { |
| 62 ChildProcessSecurityPolicyImpl::GetInstance()->RevokeAllPermissionsForFile( | 57 ChildProcessSecurityPolicyImpl::GetInstance()->RevokeAllPermissionsForFile( |
| 63 child_id, path); | 58 child_id, path); |
| 64 } | 59 } |
| 65 | 60 |
| 66 } // namespace | 61 } // namespace |
| 67 | 62 |
| 68 FileAPIMessageFilter::FileAPIMessageFilter( | 63 FileAPIMessageFilter::FileAPIMessageFilter( |
| 69 int process_id, | 64 int process_id, |
| 70 net::URLRequestContextGetter* request_context_getter, | 65 net::URLRequestContextGetter* request_context_getter, |
| 71 fileapi::FileSystemContext* file_system_context, | 66 fileapi::FileSystemContext* file_system_context, |
| 72 ChromeBlobStorageContext* blob_storage_context, | 67 ChromeBlobStorageContext* blob_storage_context, |
| 73 StreamContext* stream_context) | 68 StreamContext* stream_context) |
| 74 : BrowserMessageFilter( | 69 : process_id_(process_id), |
| 75 kFilteredMessageClasses, arraysize(kFilteredMessageClasses)), | |
| 76 process_id_(process_id), | |
| 77 context_(file_system_context), | 70 context_(file_system_context), |
| 78 security_policy_(ChildProcessSecurityPolicyImpl::GetInstance()), | 71 security_policy_(ChildProcessSecurityPolicyImpl::GetInstance()), |
| 79 request_context_getter_(request_context_getter), | 72 request_context_getter_(request_context_getter), |
| 80 request_context_(NULL), | 73 request_context_(NULL), |
| 81 blob_storage_context_(blob_storage_context), | 74 blob_storage_context_(blob_storage_context), |
| 82 stream_context_(stream_context) { | 75 stream_context_(stream_context) { |
| 83 DCHECK(context_); | 76 DCHECK(context_); |
| 84 DCHECK(request_context_getter_.get()); | 77 DCHECK(request_context_getter_.get()); |
| 85 DCHECK(blob_storage_context); | 78 DCHECK(blob_storage_context); |
| 86 DCHECK(stream_context); | 79 DCHECK(stream_context); |
| 87 } | 80 } |
| 88 | 81 |
| 89 FileAPIMessageFilter::FileAPIMessageFilter( | 82 FileAPIMessageFilter::FileAPIMessageFilter( |
| 90 int process_id, | 83 int process_id, |
| 91 net::URLRequestContext* request_context, | 84 net::URLRequestContext* request_context, |
| 92 fileapi::FileSystemContext* file_system_context, | 85 fileapi::FileSystemContext* file_system_context, |
| 93 ChromeBlobStorageContext* blob_storage_context, | 86 ChromeBlobStorageContext* blob_storage_context, |
| 94 StreamContext* stream_context) | 87 StreamContext* stream_context) |
| 95 : BrowserMessageFilter( | 88 : process_id_(process_id), |
| 96 kFilteredMessageClasses, arraysize(kFilteredMessageClasses)), | |
| 97 process_id_(process_id), | |
| 98 context_(file_system_context), | 89 context_(file_system_context), |
| 99 security_policy_(ChildProcessSecurityPolicyImpl::GetInstance()), | 90 security_policy_(ChildProcessSecurityPolicyImpl::GetInstance()), |
| 100 request_context_(request_context), | 91 request_context_(request_context), |
| 101 blob_storage_context_(blob_storage_context), | 92 blob_storage_context_(blob_storage_context), |
| 102 stream_context_(stream_context) { | 93 stream_context_(stream_context) { |
| 103 DCHECK(context_); | 94 DCHECK(context_); |
| 104 DCHECK(request_context_); | 95 DCHECK(request_context_); |
| 105 DCHECK(blob_storage_context); | 96 DCHECK(blob_storage_context); |
| 106 DCHECK(stream_context); | 97 DCHECK(stream_context); |
| 107 } | 98 } |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 } | 840 } |
| 850 | 841 |
| 851 return true; | 842 return true; |
| 852 } | 843 } |
| 853 | 844 |
| 854 scoped_refptr<Stream> FileAPIMessageFilter::GetStreamForURL(const GURL& url) { | 845 scoped_refptr<Stream> FileAPIMessageFilter::GetStreamForURL(const GURL& url) { |
| 855 return stream_context_->registry()->GetStream(url); | 846 return stream_context_->registry()->GetStream(url); |
| 856 } | 847 } |
| 857 | 848 |
| 858 } // namespace content | 849 } // namespace content |
| OLD | NEW |