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

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

Issue 2618393003: Remove ScopedVector from ContentBrowserClient. (Closed)
Patch Set: rebase Created 3 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/sync_file_system_backend.h" 5 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/memory/ptr_util.h"
11 #include "chrome/browser/chrome_notification_types.h" 12 #include "chrome/browser/chrome_notification_types.h"
12 #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h" 13 #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h"
13 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h" 14 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h"
14 #include "chrome/browser/sync_file_system/local/syncable_file_system_operation.h " 15 #include "chrome/browser/sync_file_system/local/syncable_file_system_operation.h "
15 #include "chrome/browser/sync_file_system/sync_file_system_service.h" 16 #include "chrome/browser/sync_file_system/sync_file_system_service.h"
16 #include "chrome/browser/sync_file_system/sync_file_system_service_factory.h" 17 #include "chrome/browser/sync_file_system/sync_file_system_service_factory.h"
17 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" 18 #include "chrome/browser/sync_file_system/syncable_file_system_util.h"
18 #include "content/public/browser/browser_thread.h" 19 #include "content/public/browser/browser_thread.h"
19 #include "content/public/browser/notification_service.h" 20 #include "content/public/browser/notification_service.h"
20 #include "storage/browser/fileapi/file_stream_reader.h" 21 #include "storage/browser/fileapi/file_stream_reader.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 FROM_HERE, change_tracker_.release()); 81 FROM_HERE, change_tracker_.release());
81 } 82 }
82 83
83 if (profile_holder_ && !CalledOnUIThread()) { 84 if (profile_holder_ && !CalledOnUIThread()) {
84 BrowserThread::DeleteSoon( 85 BrowserThread::DeleteSoon(
85 BrowserThread::UI, FROM_HERE, profile_holder_.release()); 86 BrowserThread::UI, FROM_HERE, profile_holder_.release());
86 } 87 }
87 } 88 }
88 89
89 // static 90 // static
90 SyncFileSystemBackend* SyncFileSystemBackend::CreateForTesting() { 91 std::unique_ptr<SyncFileSystemBackend>
92 SyncFileSystemBackend::CreateForTesting() {
91 DCHECK(CalledOnUIThread()); 93 DCHECK(CalledOnUIThread());
92 SyncFileSystemBackend* backend = new SyncFileSystemBackend(nullptr); 94 auto backend = base::MakeUnique<SyncFileSystemBackend>(nullptr);
93 backend->skip_initialize_syncfs_service_for_testing_ = true; 95 backend->skip_initialize_syncfs_service_for_testing_ = true;
94 return backend; 96 return backend;
95 } 97 }
96 98
97 bool SyncFileSystemBackend::CanHandleType(storage::FileSystemType type) const { 99 bool SyncFileSystemBackend::CanHandleType(storage::FileSystemType type) const {
98 return type == storage::kFileSystemTypeSyncable || 100 return type == storage::kFileSystemTypeSyncable ||
99 type == storage::kFileSystemTypeSyncableForInternalSync; 101 type == storage::kFileSystemTypeSyncableForInternalSync;
100 } 102 }
101 103
102 void SyncFileSystemBackend::Initialize(storage::FileSystemContext* context) { 104 void SyncFileSystemBackend::Initialize(storage::FileSystemContext* context) {
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 SyncStatusCodeToFileError(status)); 313 SyncStatusCodeToFileError(status));
312 return; 314 return;
313 } 315 }
314 316
315 callback.Run(GetSyncableFileSystemRootURI(origin_url), 317 callback.Run(GetSyncableFileSystemRootURI(origin_url),
316 GetFileSystemName(origin_url, type), 318 GetFileSystemName(origin_url, type),
317 base::File::FILE_OK); 319 base::File::FILE_OK);
318 } 320 }
319 321
320 } // namespace sync_file_system 322 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698