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

Side by Side Diff: chrome/browser/chromeos/drive/fake_file_system.cc

Issue 583583003: Files.app: Fix DCHECK in FakeFileSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/drive/fake_file_system.h" 5 #include "chrome/browser/chromeos/drive/fake_file_system.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 weak_ptr_factory_.GetWeakPtr(), 138 weak_ptr_factory_.GetWeakPtr(),
139 initialized_callback, get_content_callback, 139 initialized_callback, get_content_callback,
140 completion_callback)); 140 completion_callback));
141 return base::Bind(&base::DoNothing); 141 return base::Bind(&base::DoNothing);
142 } 142 }
143 143
144 void FakeFileSystem::GetResourceEntry( 144 void FakeFileSystem::GetResourceEntry(
145 const base::FilePath& file_path, 145 const base::FilePath& file_path,
146 const GetResourceEntryCallback& callback) { 146 const GetResourceEntryCallback& callback) {
147 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 147 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
148 DCHECK(file_path.BaseName() != file_path);
kinaba 2014/09/19 01:47:18 The condition looks a bit detouring. What we want
hirono 2014/09/22 04:53:28 Let me do this. Thank you!
148 149
149 // Now, we only support files under my drive. 150 // Now, we only support files under my drive.
150 DCHECK(!util::IsUnderDriveMountPoint(file_path));
151
152 if (file_path == util::GetDriveMyDriveRootPath()) { 151 if (file_path == util::GetDriveMyDriveRootPath()) {
153 // Specialized for the root entry. 152 // Specialized for the root entry.
154 drive_service_->GetAboutResource( 153 drive_service_->GetAboutResource(
155 base::Bind( 154 base::Bind(
156 &FakeFileSystem::GetResourceEntryAfterGetAboutResource, 155 &FakeFileSystem::GetResourceEntryAfterGetAboutResource,
157 weak_ptr_factory_.GetWeakPtr(), callback)); 156 weak_ptr_factory_.GetWeakPtr(), callback));
158 return; 157 return;
159 } 158 }
160 159
161 GetResourceEntry( 160 GetResourceEntry(
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 callback.Run(FILE_ERROR_OK, entry.Pass()); 386 callback.Run(FILE_ERROR_OK, entry.Pass());
388 return; 387 return;
389 } 388 }
390 } 389 }
391 390
392 callback.Run(FILE_ERROR_NOT_FOUND, scoped_ptr<ResourceEntry>()); 391 callback.Run(FILE_ERROR_NOT_FOUND, scoped_ptr<ResourceEntry>());
393 } 392 }
394 393
395 } // namespace test_util 394 } // namespace test_util
396 } // namespace drive 395 } // namespace drive
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