Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Side by Side Diff: content/browser/file_system/file_system_dispatcher_host.cc

Issue 6833007: More filesystem cleanup: convert URL-encoded-as-FilePath to actual URL, where (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/file_system/file_system_dispatcher_host.h" 5 #include "content/browser/file_system/file_system_dispatcher_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
11 #include "base/threading/thread.h" 11 #include "base/threading/thread.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 request_id_, info, platform_path)); 50 request_id_, info, platform_path));
51 } 51 }
52 52
53 virtual void DidReadDirectory( 53 virtual void DidReadDirectory(
54 const std::vector<base::FileUtilProxy::Entry>& entries, bool has_more) { 54 const std::vector<base::FileUtilProxy::Entry>& entries, bool has_more) {
55 dispatcher_host_->Send(new FileSystemMsg_DidReadDirectory( 55 dispatcher_host_->Send(new FileSystemMsg_DidReadDirectory(
56 request_id_, entries, has_more)); 56 request_id_, entries, has_more));
57 } 57 }
58 58
59 virtual void DidOpenFileSystem(const std::string& name, 59 virtual void DidOpenFileSystem(const std::string& name,
60 const FilePath& path) { 60 const GURL& root) {
61 dispatcher_host_->Send( 61 dispatcher_host_->Send(
62 new FileSystemMsg_OpenComplete(request_id_, !path.empty(), name, path)); 62 new FileSystemMsg_OpenComplete(
63 request_id_, root.is_valid(), name, root));
63 } 64 }
64 65
65 virtual void DidFail(base::PlatformFileError error_code) { 66 virtual void DidFail(base::PlatformFileError error_code) {
66 dispatcher_host_->Send(new FileSystemMsg_DidFail(request_id_, error_code)); 67 dispatcher_host_->Send(new FileSystemMsg_DidFail(request_id_, error_code));
67 } 68 }
68 69
69 virtual void DidWrite(int64 bytes, bool complete) { 70 virtual void DidWrite(int64 bytes, bool complete) {
70 dispatcher_host_->Send(new FileSystemMsg_DidWrite( 71 dispatcher_host_->Send(new FileSystemMsg_DidWrite(
71 request_id_, bytes, complete)); 72 request_id_, bytes, complete));
72 } 73 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 ContentSetting content_setting = 131 ContentSetting content_setting =
131 host_content_settings_map_->GetContentSetting( 132 host_content_settings_map_->GetContentSetting(
132 origin_url, CONTENT_SETTINGS_TYPE_COOKIES, ""); 133 origin_url, CONTENT_SETTINGS_TYPE_COOKIES, "");
133 DCHECK((content_setting == CONTENT_SETTING_ALLOW) || 134 DCHECK((content_setting == CONTENT_SETTING_ALLOW) ||
134 (content_setting == CONTENT_SETTING_BLOCK) || 135 (content_setting == CONTENT_SETTING_BLOCK) ||
135 (content_setting == CONTENT_SETTING_SESSION_ONLY)); 136 (content_setting == CONTENT_SETTING_SESSION_ONLY));
136 if (content_setting == CONTENT_SETTING_BLOCK) { 137 if (content_setting == CONTENT_SETTING_BLOCK) {
137 // TODO(kinuko): Need to notify the UI thread to indicate that 138 // TODO(kinuko): Need to notify the UI thread to indicate that
138 // there's a blocked content. 139 // there's a blocked content.
139 Send(new FileSystemMsg_OpenComplete( 140 Send(new FileSystemMsg_OpenComplete(
140 request_id, false, std::string(), FilePath())); 141 request_id, false, std::string(), GURL()));
141 return; 142 return;
142 } 143 }
143 144
144 GetNewOperation(request_id)->OpenFileSystem(origin_url, type, create); 145 GetNewOperation(request_id)->OpenFileSystem(origin_url, type, create);
145 } 146 }
146 147
147 void FileSystemDispatcherHost::OnMove( 148 void FileSystemDispatcherHost::OnMove(
148 int request_id, const FilePath& src_path, const FilePath& dest_path) { 149 int request_id, const GURL& src_path, const GURL& dest_path) {
149 GetNewOperation(request_id)->Move(src_path, dest_path); 150 GetNewOperation(request_id)->Move(src_path, dest_path);
150 } 151 }
151 152
152 void FileSystemDispatcherHost::OnCopy( 153 void FileSystemDispatcherHost::OnCopy(
153 int request_id, const FilePath& src_path, const FilePath& dest_path) { 154 int request_id, const GURL& src_path, const GURL& dest_path) {
154 GetNewOperation(request_id)->Copy(src_path, dest_path); 155 GetNewOperation(request_id)->Copy(src_path, dest_path);
155 } 156 }
156 157
157 void FileSystemDispatcherHost::OnRemove( 158 void FileSystemDispatcherHost::OnRemove(
158 int request_id, const FilePath& path, bool recursive) { 159 int request_id, const GURL& path, bool recursive) {
159 GetNewOperation(request_id)->Remove(path, recursive); 160 GetNewOperation(request_id)->Remove(path, recursive);
160 } 161 }
161 162
162 void FileSystemDispatcherHost::OnReadMetadata( 163 void FileSystemDispatcherHost::OnReadMetadata(
163 int request_id, const FilePath& path) { 164 int request_id, const GURL& path) {
164 GetNewOperation(request_id)->GetMetadata(path); 165 GetNewOperation(request_id)->GetMetadata(path);
165 } 166 }
166 167
167 void FileSystemDispatcherHost::OnCreate( 168 void FileSystemDispatcherHost::OnCreate(
168 int request_id, const FilePath& path, bool exclusive, 169 int request_id, const GURL& path, bool exclusive,
169 bool is_directory, bool recursive) { 170 bool is_directory, bool recursive) {
170 if (is_directory) 171 if (is_directory)
171 GetNewOperation(request_id)->CreateDirectory(path, exclusive, recursive); 172 GetNewOperation(request_id)->CreateDirectory(path, exclusive, recursive);
172 else 173 else
173 GetNewOperation(request_id)->CreateFile(path, exclusive); 174 GetNewOperation(request_id)->CreateFile(path, exclusive);
174 } 175 }
175 176
176 void FileSystemDispatcherHost::OnExists( 177 void FileSystemDispatcherHost::OnExists(
177 int request_id, const FilePath& path, bool is_directory) { 178 int request_id, const GURL& path, bool is_directory) {
178 if (is_directory) 179 if (is_directory)
179 GetNewOperation(request_id)->DirectoryExists(path); 180 GetNewOperation(request_id)->DirectoryExists(path);
180 else 181 else
181 GetNewOperation(request_id)->FileExists(path); 182 GetNewOperation(request_id)->FileExists(path);
182 } 183 }
183 184
184 void FileSystemDispatcherHost::OnReadDirectory( 185 void FileSystemDispatcherHost::OnReadDirectory(
185 int request_id, const FilePath& path) { 186 int request_id, const GURL& path) {
186 GetNewOperation(request_id)->ReadDirectory(path); 187 GetNewOperation(request_id)->ReadDirectory(path);
187 } 188 }
188 189
189 void FileSystemDispatcherHost::OnWrite( 190 void FileSystemDispatcherHost::OnWrite(
190 int request_id, 191 int request_id,
191 const FilePath& path, 192 const GURL& path,
192 const GURL& blob_url, 193 const GURL& blob_url,
193 int64 offset) { 194 int64 offset) {
194 GetNewOperation(request_id)->Write( 195 GetNewOperation(request_id)->Write(
195 request_context_, path, blob_url, offset); 196 request_context_, path, blob_url, offset);
196 } 197 }
197 198
198 void FileSystemDispatcherHost::OnTruncate( 199 void FileSystemDispatcherHost::OnTruncate(
199 int request_id, 200 int request_id,
200 const FilePath& path, 201 const GURL& path,
201 int64 length) { 202 int64 length) {
202 GetNewOperation(request_id)->Truncate(path, length); 203 GetNewOperation(request_id)->Truncate(path, length);
203 } 204 }
204 205
205 void FileSystemDispatcherHost::OnTouchFile( 206 void FileSystemDispatcherHost::OnTouchFile(
206 int request_id, 207 int request_id,
207 const FilePath& path, 208 const GURL& path,
208 const base::Time& last_access_time, 209 const base::Time& last_access_time,
209 const base::Time& last_modified_time) { 210 const base::Time& last_modified_time) {
210 GetNewOperation(request_id)->TouchFile( 211 GetNewOperation(request_id)->TouchFile(
211 path, last_access_time, last_modified_time); 212 path, last_access_time, last_modified_time);
212 } 213 }
213 214
214 void FileSystemDispatcherHost::OnCancel( 215 void FileSystemDispatcherHost::OnCancel(
215 int request_id, 216 int request_id,
216 int request_id_to_cancel) { 217 int request_id_to_cancel) {
217 FileSystemOperation* write = operations_.Lookup( 218 FileSystemOperation* write = operations_.Lookup(
(...skipping 19 matching lines...) Expand all
237 context_, 238 context_,
238 NULL); 239 NULL);
239 operations_.AddWithID(operation, request_id); 240 operations_.AddWithID(operation, request_id);
240 return operation; 241 return operation;
241 } 242 }
242 243
243 void FileSystemDispatcherHost::UnregisterOperation(int request_id) { 244 void FileSystemDispatcherHost::UnregisterOperation(int request_id) {
244 DCHECK(operations_.Lookup(request_id)); 245 DCHECK(operations_.Lookup(request_id));
245 operations_.Remove(request_id); 246 operations_.Remove(request_id);
246 } 247 }
OLDNEW
« no previous file with comments | « content/browser/file_system/file_system_dispatcher_host.h ('k') | content/common/file_system/file_system_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698