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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_util.cc

Issue 10536065: Fix file handler executer setting wrong cache path permissions on drive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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
« no previous file with comments | « chrome/browser/chromeos/extensions/file_handler_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/chromeos/gdata/gdata_util.h" 5 #include "chrome/browser/chromeos/gdata/gdata_util.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 Profile* profile, 233 Profile* profile,
234 const FilePath& gdata_path, 234 const FilePath& gdata_path,
235 std::vector<std::pair<FilePath, int> >* cache_paths ) { 235 std::vector<std::pair<FilePath, int> >* cache_paths ) {
236 DCHECK(cache_paths); 236 DCHECK(cache_paths);
237 237
238 GDataFileSystem* file_system = GetGDataFileSystem(profile); 238 GDataFileSystem* file_system = GetGDataFileSystem(profile);
239 if (!file_system) 239 if (!file_system)
240 return; 240 return;
241 241
242 GDataFileProperties file_properties; 242 GDataFileProperties file_properties;
243 file_system->GetFileInfoByPath(gdata_path, &file_properties); 243 if (!file_system->GetFileInfoByPath(gdata_path, &file_properties))
244 return;
244 245
245 std::string resource_id = file_properties.resource_id; 246 std::string resource_id = file_properties.resource_id;
246 std::string file_md5 = file_properties.file_md5; 247 std::string file_md5 = file_properties.file_md5;
247 248
248 // We check permissions for raw cache file paths only for read-only 249 // We check permissions for raw cache file paths only for read-only
249 // operations (when fileEntry.file() is called), so read only permissions 250 // operations (when fileEntry.file() is called), so read only permissions
250 // should be sufficient for all cache paths. For the rest of supported 251 // should be sufficient for all cache paths. For the rest of supported
251 // operations the file access check is done for drive/ paths. 252 // operations the file access check is done for drive/ paths.
252 cache_paths->push_back(std::make_pair( 253 cache_paths->push_back(std::make_pair(
253 file_system->GetCacheFilePath(resource_id, file_md5, 254 file_system->GetCacheFilePath(resource_id, file_md5,
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 // Assign the extracted extensions to md5 and extra_extension. 351 // Assign the extracted extensions to md5 and extra_extension.
351 int extension_count = extensions.size(); 352 int extension_count = extensions.size();
352 *md5 = (extension_count > 0) ? extensions[extension_count - 1] : 353 *md5 = (extension_count > 0) ? extensions[extension_count - 1] :
353 std::string(); 354 std::string();
354 *extra_extension = (extension_count > 1) ? extensions[extension_count - 2] : 355 *extra_extension = (extension_count > 1) ? extensions[extension_count - 2] :
355 std::string(); 356 std::string();
356 } 357 }
357 358
358 } // namespace util 359 } // namespace util
359 } // namespace gdata 360 } // namespace gdata
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/extensions/file_handler_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698