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

Unified Diff: webkit/common/blob/shareable_file_reference.h

Issue 442383002: Move storage-related files from webkit/ to new top-level directory storage/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/common/blob/scoped_file.cc ('k') | webkit/common/blob/shareable_file_reference.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/common/blob/shareable_file_reference.h
diff --git a/webkit/common/blob/shareable_file_reference.h b/webkit/common/blob/shareable_file_reference.h
deleted file mode 100644
index daaa20c1b7ff7d25f02e38cacbbb4e1cc3315a20..0000000000000000000000000000000000000000
--- a/webkit/common/blob/shareable_file_reference.h
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef WEBKIT_COMMON_BLOB_SHAREABLE_FILE_REFERENCE_H_
-#define WEBKIT_COMMON_BLOB_SHAREABLE_FILE_REFERENCE_H_
-
-#include <vector>
-
-#include "webkit/common/blob/scoped_file.h"
-
-namespace webkit_blob {
-
-// ShareableFileReference allows consumers to share FileReference for the
-// same path if it already exists in its internal map.
-// This class is non-thread-safe and all methods must be called on a single
-// thread.
-class WEBKIT_STORAGE_COMMON_EXPORT ShareableFileReference
- : public base::RefCounted<ShareableFileReference> {
- public:
- typedef ScopedFile::ScopeOutCallback FinalReleaseCallback;
-
- enum FinalReleasePolicy {
- DELETE_ON_FINAL_RELEASE = ScopedFile::DELETE_ON_SCOPE_OUT,
- DONT_DELETE_ON_FINAL_RELEASE = ScopedFile::DONT_DELETE_ON_SCOPE_OUT,
- };
-
- // Returns a ShareableFileReference for the given path, if no reference
- // for this path exists returns NULL.
- static scoped_refptr<ShareableFileReference> Get(const base::FilePath& path);
-
- // Returns a ShareableFileReference for the given path, creating a new
- // reference if none yet exists. If there's a pre-existing reference for
- // the path, the policy parameter of this method is ignored.
- static scoped_refptr<ShareableFileReference> GetOrCreate(
- const base::FilePath& path,
- FinalReleasePolicy policy,
- base::TaskRunner* file_task_runner);
-
- // Returns a ShareableFileReference for the given path of the |scoped_file|,
- // creating a new reference if none yet exists. The ownership of |scoped_file|
- // is passed to this reference.
- // If there's a pre-existing reference for the path, the scope out policy
- // and scope-out-callbacks of the given |scoped_file| is ignored.
- // If the given scoped_file has an empty path (e.g. maybe already
- // released) this returns NULL reference.
- //
- // TODO(kinuko): Make sure if this behavior is ok, we could alternatively
- // merge callbacks to the existing one.
- static scoped_refptr<ShareableFileReference> GetOrCreate(
- ScopedFile scoped_file);
-
- // The full file path.
- const base::FilePath& path() const { return scoped_file_.path(); }
-
- // The |callback| is fired when the final reference of this instance
- // is released. If release policy is DELETE_ON_FINAL_RELEASE the
- // callback task(s) is/are posted before the deletion is scheduled.
- void AddFinalReleaseCallback(const FinalReleaseCallback& callback);
-
- private:
- friend class base::RefCounted<ShareableFileReference>;
-
- ShareableFileReference(ScopedFile scoped_file);
- ~ShareableFileReference();
-
- ScopedFile scoped_file_;
-
- DISALLOW_COPY_AND_ASSIGN(ShareableFileReference);
-};
-
-} // namespace webkit_blob
-
-#endif // WEBKIT_COMMON_BLOB_SHAREABLE_FILE_REFERENCE_H_
« no previous file with comments | « webkit/common/blob/scoped_file.cc ('k') | webkit/common/blob/shareable_file_reference.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698