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

Side by Side Diff: chrome/browser/sync_file_system/local/canned_syncable_file_system.cc

Issue 810403004: [Storage] Blob Storage Refactoring pt 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: memory leak fixed Created 5 years, 11 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/sync_file_system/local/canned_syncable_file_system.h" 5 #include "chrome/browser/sync_file_system/local/canned_syncable_file_system.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 FROM_HERE, 462 FROM_HERE,
463 base::Bind(&CannedSyncableFileSystem::DoReadDirectory, 463 base::Bind(&CannedSyncableFileSystem::DoReadDirectory,
464 base::Unretained(this), 464 base::Unretained(this),
465 url, 465 url,
466 entries)); 466 entries));
467 } 467 }
468 468
469 int64 CannedSyncableFileSystem::Write( 469 int64 CannedSyncableFileSystem::Write(
470 net::URLRequestContext* url_request_context, 470 net::URLRequestContext* url_request_context,
471 const FileSystemURL& url, 471 const FileSystemURL& url,
472 scoped_ptr<storage::BlobDataHandle> blob_data_handle) { 472 scoped_ptr<storage::BlobDataSnapshotHandle> blob_data_handle) {
473 return RunOnThread<int64>(io_task_runner_.get(), 473 return RunOnThread<int64>(io_task_runner_.get(),
474 FROM_HERE, 474 FROM_HERE,
475 base::Bind(&CannedSyncableFileSystem::DoWrite, 475 base::Bind(&CannedSyncableFileSystem::DoWrite,
476 base::Unretained(this), 476 base::Unretained(this),
477 url_request_context, 477 url_request_context,
478 url, 478 url,
479 base::Passed(&blob_data_handle))); 479 base::Passed(&blob_data_handle)));
480 } 480 }
481 481
482 int64 CannedSyncableFileSystem::WriteString( 482 int64 CannedSyncableFileSystem::WriteString(
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 const StatusCallback& callback) { 680 const StatusCallback& callback) {
681 EXPECT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); 681 EXPECT_TRUE(io_task_runner_->RunsTasksOnCurrentThread());
682 EXPECT_TRUE(is_filesystem_opened_); 682 EXPECT_TRUE(is_filesystem_opened_);
683 operation_runner()->ReadDirectory( 683 operation_runner()->ReadDirectory(
684 url, base::Bind(&OnReadDirectory, entries, callback)); 684 url, base::Bind(&OnReadDirectory, entries, callback));
685 } 685 }
686 686
687 void CannedSyncableFileSystem::DoWrite( 687 void CannedSyncableFileSystem::DoWrite(
688 net::URLRequestContext* url_request_context, 688 net::URLRequestContext* url_request_context,
689 const FileSystemURL& url, 689 const FileSystemURL& url,
690 scoped_ptr<storage::BlobDataHandle> blob_data_handle, 690 scoped_ptr<storage::BlobDataSnapshotHandle> blob_data_handle,
691 const WriteCallback& callback) { 691 const WriteCallback& callback) {
692 EXPECT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); 692 EXPECT_TRUE(io_task_runner_->RunsTasksOnCurrentThread());
693 EXPECT_TRUE(is_filesystem_opened_); 693 EXPECT_TRUE(is_filesystem_opened_);
694 WriteHelper* helper = new WriteHelper; 694 WriteHelper* helper = new WriteHelper;
695 operation_runner()->Write(url_request_context, url, 695 operation_runner()->Write(url_request_context, url,
696 blob_data_handle.Pass(), 0, 696 blob_data_handle.Pass(), 0,
697 base::Bind(&WriteHelper::DidWrite, 697 base::Bind(&WriteHelper::DidWrite,
698 base::Owned(helper), callback)); 698 base::Owned(helper), callback));
699 } 699 }
700 700
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 sync_status_ = status; 757 sync_status_ = status;
758 quit_closure.Run(); 758 quit_closure.Run();
759 } 759 }
760 760
761 void CannedSyncableFileSystem::InitializeSyncStatusObserver() { 761 void CannedSyncableFileSystem::InitializeSyncStatusObserver() {
762 ASSERT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); 762 ASSERT_TRUE(io_task_runner_->RunsTasksOnCurrentThread());
763 backend()->sync_context()->sync_status()->AddObserver(this); 763 backend()->sync_context()->sync_status()->AddObserver(this);
764 } 764 }
765 765
766 } // namespace sync_file_system 766 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698