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

Side by Side Diff: chrome/browser/chromeos/extensions/file_browser_private_api.cc

Issue 10828086: File Manager: fix an unsafe const reference (intermittent crash). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « no previous file | 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/extensions/file_browser_private_api.h" 5 #include "chrome/browser/chromeos/extensions/file_browser_private_api.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 const std::string& mount_type_str, 1145 const std::string& mount_type_str,
1146 const SelectedFileInfoList& files) { 1146 const SelectedFileInfoList& files) {
1147 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1147 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1148 1148
1149 if (!files.size()) { 1149 if (!files.size()) {
1150 SendResponse(false); 1150 SendResponse(false);
1151 return; 1151 return;
1152 } 1152 }
1153 1153
1154 const FilePath& source_path = files[0].local_path; 1154 const FilePath& source_path = files[0].local_path;
1155 const FilePath::StringType& display_name = 1155 const FilePath::StringType display_name =
1156 files[0].file_path.BaseName().value(); 1156 files[0].file_path.BaseName().value();
tbarzic 2012/07/31 01:00:25 yeah, this is my fault.. I forgot to undo some exp
hshi1 2012/07/31 01:04:41 Ah I see so it IS a regression after all... would
1157 // Check if the source path is under GData cache directory. 1157 // Check if the source path is under GData cache directory.
1158 gdata::GDataSystemService* system_service = 1158 gdata::GDataSystemService* system_service =
1159 gdata::GDataSystemServiceFactory::GetForProfile(profile_); 1159 gdata::GDataSystemServiceFactory::GetForProfile(profile_);
1160 gdata::GDataCache* cache = system_service ? system_service->cache() : NULL; 1160 gdata::GDataCache* cache = system_service ? system_service->cache() : NULL;
1161 if (cache && cache->IsUnderGDataCacheDirectory(source_path)) { 1161 if (cache && cache->IsUnderGDataCacheDirectory(source_path)) {
1162 cache->SetMountedStateOnUIThread( 1162 cache->SetMountedStateOnUIThread(
1163 source_path, 1163 source_path,
1164 true, 1164 true,
1165 base::Bind(&AddMountFunction::OnMountedStateSet, this, mount_type_str, 1165 base::Bind(&AddMountFunction::OnMountedStateSet, this, mount_type_str,
1166 display_name)); 1166 display_name));
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after
2414 gdata::GDataSystemService* system_service = 2414 gdata::GDataSystemService* system_service =
2415 gdata::GDataSystemServiceFactory::GetForProfile(profile_); 2415 gdata::GDataSystemServiceFactory::GetForProfile(profile_);
2416 if (!system_service || !system_service->file_system()) 2416 if (!system_service || !system_service->file_system())
2417 return false; 2417 return false;
2418 2418
2419 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string)); 2419 FilePath directory_path = GetVirtualPathFromURL(GURL(file_url_as_string));
2420 system_service->file_system()->RequestDirectoryRefresh(directory_path); 2420 system_service->file_system()->RequestDirectoryRefresh(directory_path);
2421 2421
2422 return true; 2422 return true;
2423 } 2423 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698