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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc

Issue 689603002: [fsp] Implement storage::WatcherManager for FSP. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed. Created 6 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/file_system_provider/fake_provided_file_system .h" 5 #include "chrome/browser/chromeos/file_system_provider/fake_provided_file_system .h"
6 6
7 #include "base/files/file.h" 7 #include "base/files/file.h"
8 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/message_loop/message_loop_proxy.h"
9 #include "net/base/io_buffer.h" 9 #include "net/base/io_buffer.h"
10 10
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 entry->contents.replace(offset, length, buffer->data(), length); 319 entry->contents.replace(offset, length, buffer->data(), length);
320 320
321 return PostAbortableTask(base::Bind(callback, base::File::FILE_OK)); 321 return PostAbortableTask(base::Bind(callback, base::File::FILE_OK));
322 } 322 }
323 323
324 ProvidedFileSystemInterface::AbortCallback FakeProvidedFileSystem::AddWatcher( 324 ProvidedFileSystemInterface::AbortCallback FakeProvidedFileSystem::AddWatcher(
325 const GURL& origin, 325 const GURL& origin,
326 const base::FilePath& entry_watcher, 326 const base::FilePath& entry_watcher,
327 bool recursive, 327 bool recursive,
328 bool persistent, 328 bool persistent,
329 const storage::AsyncFileUtil::StatusCallback& callback) { 329 const storage::AsyncFileUtil::StatusCallback& callback,
330 const storage::WatcherManager::NotificationCallback&
331 notification_callback) {
330 // TODO(mtomasz): Implement it once needed. 332 // TODO(mtomasz): Implement it once needed.
331 return PostAbortableTask(base::Bind(callback, base::File::FILE_OK)); 333 return PostAbortableTask(base::Bind(callback, base::File::FILE_OK));
332 } 334 }
333 335
334 void FakeProvidedFileSystem::RemoveWatcher( 336 void FakeProvidedFileSystem::RemoveWatcher(
335 const GURL& origin, 337 const GURL& origin,
336 const base::FilePath& entry_path, 338 const base::FilePath& entry_path,
337 bool recursive, 339 bool recursive,
338 const storage::AsyncFileUtil::StatusCallback& callback) { 340 const storage::AsyncFileUtil::StatusCallback& callback) {
339 // TODO(mtomasz): Implement it once needed. 341 // TODO(mtomasz): Implement it once needed.
(...skipping 21 matching lines...) Expand all
361 363
362 void FakeProvidedFileSystem::RemoveObserver( 364 void FakeProvidedFileSystem::RemoveObserver(
363 ProvidedFileSystemObserver* observer) { 365 ProvidedFileSystemObserver* observer) {
364 DCHECK(observer); 366 DCHECK(observer);
365 observers_.RemoveObserver(observer); 367 observers_.RemoveObserver(observer);
366 } 368 }
367 369
368 bool FakeProvidedFileSystem::Notify( 370 bool FakeProvidedFileSystem::Notify(
369 const base::FilePath& entry_path, 371 const base::FilePath& entry_path,
370 bool recursive, 372 bool recursive,
371 ProvidedFileSystemObserver::ChangeType change_type, 373 storage::WatcherManager::ChangeType change_type,
372 scoped_ptr<ProvidedFileSystemObserver::Changes> changes, 374 scoped_ptr<ProvidedFileSystemObserver::Changes> changes,
373 const std::string& tag) { 375 const std::string& tag) {
374 NOTREACHED(); 376 NOTREACHED();
375 return false; 377 return false;
376 } 378 }
377 379
378 ProvidedFileSystemInterface* FakeProvidedFileSystem::Create( 380 ProvidedFileSystemInterface* FakeProvidedFileSystem::Create(
379 Profile* profile, 381 Profile* profile,
380 const ProvidedFileSystemInfo& file_system_info) { 382 const ProvidedFileSystemInfo& file_system_info) {
381 return new FakeProvidedFileSystem(file_system_info); 383 return new FakeProvidedFileSystem(file_system_info);
(...skipping 23 matching lines...) Expand all
405 const std::vector<int>& task_ids, 407 const std::vector<int>& task_ids,
406 const storage::AsyncFileUtil::StatusCallback& callback) { 408 const storage::AsyncFileUtil::StatusCallback& callback) {
407 for (size_t i = 0; i < task_ids.size(); ++i) { 409 for (size_t i = 0; i < task_ids.size(); ++i) {
408 tracker_.TryCancel(task_ids[i]); 410 tracker_.TryCancel(task_ids[i]);
409 } 411 }
410 callback.Run(base::File::FILE_OK); 412 callback.Run(base::File::FILE_OK);
411 } 413 }
412 414
413 } // namespace file_system_provider 415 } // namespace file_system_provider
414 } // namespace chromeos 416 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698