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

Side by Side Diff: webkit/browser/fileapi/file_system_context.cc

Issue 264993002: [FileAPI] Remove Flush() on write completion on SandboxFileSystems (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: +comment Created 6 years, 7 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/browser/fileapi/file_system_context.h" 5 #include "webkit/browser/fileapi/file_system_context.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/task_runner_util.h" 10 #include "base/task_runner_util.h"
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 return false; 472 return false;
473 #if defined(OS_CHROMEOS) 473 #if defined(OS_CHROMEOS)
474 if (url.type() == kFileSystemTypeTemporary && 474 if (url.type() == kFileSystemTypeTemporary &&
475 sandbox_backend_->enable_temporary_file_system_in_incognito()) { 475 sandbox_backend_->enable_temporary_file_system_in_incognito()) {
476 return true; 476 return true;
477 } 477 }
478 #endif 478 #endif
479 return !is_incognito_ || !FileSystemContext::IsSandboxFileSystem(url.type()); 479 return !is_incognito_ || !FileSystemContext::IsSandboxFileSystem(url.type());
480 } 480 }
481 481
482 bool FileSystemContext::ShouldFlushOnWriteCompletion(
483 FileSystemType type) const {
484 if (IsSandboxFileSystem(type)) {
485 // Disable Flush() for each write operation on SandboxFileSystems since it
486 // hurts the performance, assuming the FileSystems are stored in a local
487 // disk, we don't need to keep calling fsync() for it.
kinuko 2014/05/02 07:02:48 Maybe... it'd be also better note that some non-sa
tzik 2014/05/02 07:37:24 Wrote some more about non-sandboxed filesystem.
488 return false;
489 }
490 return true;
491 }
492
482 void FileSystemContext::OpenPluginPrivateFileSystem( 493 void FileSystemContext::OpenPluginPrivateFileSystem(
483 const GURL& origin_url, 494 const GURL& origin_url,
484 FileSystemType type, 495 FileSystemType type,
485 const std::string& filesystem_id, 496 const std::string& filesystem_id,
486 const std::string& plugin_id, 497 const std::string& plugin_id,
487 OpenFileSystemMode mode, 498 OpenFileSystemMode mode,
488 const StatusCallback& callback) { 499 const StatusCallback& callback) {
489 DCHECK(plugin_private_backend_); 500 DCHECK(plugin_private_backend_);
490 plugin_private_backend_->OpenPrivateFileSystem( 501 plugin_private_backend_->OpenPrivateFileSystem(
491 origin_url, type, filesystem_id, plugin_id, mode, callback); 502 origin_url, type, filesystem_id, plugin_id, mode, callback);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 } else if (parent != child) { 618 } else if (parent != child) {
608 bool result = parent.AppendRelativePath(child, &path); 619 bool result = parent.AppendRelativePath(child, &path);
609 DCHECK(result); 620 DCHECK(result);
610 } 621 }
611 622
612 operation_runner()->GetMetadata( 623 operation_runner()->GetMetadata(
613 url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); 624 url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info));
614 } 625 }
615 626
616 } // namespace fileapi 627 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/browser/fileapi/file_system_context.h ('k') | webkit/browser/fileapi/file_system_operation_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698