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

Side by Side Diff: webkit/fileapi/sandbox_mount_point_provider.cc

Issue 13811013: Refactor FileSystemMountPointProvider::CreateFileStream{Reader,Writer} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: conflict fix Created 7 years, 8 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
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 "webkit/fileapi/sandbox_mount_point_provider.h" 5 #include "webkit/fileapi/sandbox_mount_point_provider.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 return new sync_file_system::SyncableFileSystemOperation( 325 return new sync_file_system::SyncableFileSystemOperation(
326 context, operation_context.Pass()); 326 context, operation_context.Pass());
327 } 327 }
328 328
329 // For regular sandboxed types. 329 // For regular sandboxed types.
330 operation_context->set_update_observers(update_observers_); 330 operation_context->set_update_observers(update_observers_);
331 operation_context->set_access_observers(access_observers_); 331 operation_context->set_access_observers(access_observers_);
332 return new LocalFileSystemOperation(context, operation_context.Pass()); 332 return new LocalFileSystemOperation(context, operation_context.Pass());
333 } 333 }
334 334
335 webkit_blob::FileStreamReader* 335 scoped_ptr<webkit_blob::FileStreamReader>
336 SandboxMountPointProvider::CreateFileStreamReader( 336 SandboxMountPointProvider::CreateFileStreamReader(
337 const FileSystemURL& url, 337 const FileSystemURL& url,
338 int64 offset, 338 int64 offset,
339 const base::Time& expected_modification_time, 339 const base::Time& expected_modification_time,
340 FileSystemContext* context) const { 340 FileSystemContext* context) const {
341 return new FileSystemFileStreamReader( 341 return scoped_ptr<webkit_blob::FileStreamReader>(
342 context, url, offset, expected_modification_time); 342 new FileSystemFileStreamReader(
343 context, url, offset, expected_modification_time));
343 } 344 }
344 345
345 fileapi::FileStreamWriter* SandboxMountPointProvider::CreateFileStreamWriter( 346 scoped_ptr<fileapi::FileStreamWriter>
347 SandboxMountPointProvider::CreateFileStreamWriter(
346 const FileSystemURL& url, 348 const FileSystemURL& url,
347 int64 offset, 349 int64 offset,
348 FileSystemContext* context) const { 350 FileSystemContext* context) const {
349 return new SandboxFileStreamWriter( 351 return scoped_ptr<fileapi::FileStreamWriter>(
350 context, url, offset, update_observers_); 352 new SandboxFileStreamWriter(context, url, offset, update_observers_));
351 } 353 }
352 354
353 FileSystemQuotaUtil* SandboxMountPointProvider::GetQuotaUtil() { 355 FileSystemQuotaUtil* SandboxMountPointProvider::GetQuotaUtil() {
354 return this; 356 return this;
355 } 357 }
356 358
357 void SandboxMountPointProvider::DeleteFileSystem( 359 void SandboxMountPointProvider::DeleteFileSystem(
358 const GURL& origin_url, 360 const GURL& origin_url,
359 FileSystemType type, 361 FileSystemType type,
360 FileSystemContext* context, 362 FileSystemContext* context,
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 FileSystemType type, 638 FileSystemType type,
637 FileSystemUsageCache* usage_cache) { 639 FileSystemUsageCache* usage_cache) {
638 base::PlatformFileError error = base::PLATFORM_FILE_OK; 640 base::PlatformFileError error = base::PLATFORM_FILE_OK;
639 base::FilePath usage_cache_path = GetUsageCachePathForOriginAndType( 641 base::FilePath usage_cache_path = GetUsageCachePathForOriginAndType(
640 file_util, origin, type, &error); 642 file_util, origin, type, &error);
641 if (error == base::PLATFORM_FILE_OK) 643 if (error == base::PLATFORM_FILE_OK)
642 usage_cache->IncrementDirty(usage_cache_path); 644 usage_cache->IncrementDirty(usage_cache_path);
643 } 645 }
644 646
645 } // namespace fileapi 647 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/sandbox_mount_point_provider.h ('k') | webkit/fileapi/test_mount_point_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698