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

Side by Side Diff: webkit/blob/deletable_file_reference.h

Issue 3455022: Revert 60378 (trying to track down http://crbug.com/56752 )- Flesh out URLLoa... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 3 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
« no previous file with comments | « chrome/common/resource_dispatcher.cc ('k') | webkit/blob/deletable_file_reference.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WEBKIT_BLOB_DELETABLE_FILE_REFERENCE_H_
6 #define WEBKIT_BLOB_DELETABLE_FILE_REFERENCE_H_
7 #pragma once
8
9 #include "base/file_path.h"
10 #include "base/ref_counted.h"
11
12 namespace base {
13 class MessageLoopProxy;
14 }
15
16 namespace webkit_blob {
17
18 // A refcounted wrapper around a FilePath that schedules the file
19 // to be deleted upon final release.
20 class DeletableFileReference : public base::RefCounted<DeletableFileReference> {
21 public:
22 // Returns a DeletableFileReference for the given path, if no reference
23 // for this path exists returns NULL.
24 static scoped_refptr<DeletableFileReference> Get(const FilePath& path);
25
26 // Returns a DeletableFileReference for the given path, creating a new
27 // reference if none yet exists.
28 static scoped_refptr<DeletableFileReference> GetOrCreate(
29 const FilePath& path, base::MessageLoopProxy* file_thread);
30
31 // The full file path.
32 const FilePath& path() const { return path_; }
33
34 private:
35 friend class base::RefCounted<DeletableFileReference>;
36
37 DeletableFileReference(
38 const FilePath& path, base::MessageLoopProxy* file_thread);
39 ~DeletableFileReference();
40
41 const FilePath path_;
42 scoped_refptr<base::MessageLoopProxy> file_thread_;
43
44 DISALLOW_COPY_AND_ASSIGN(DeletableFileReference);
45 };
46
47 } // namespace webkit_blob
48
49 #endif // BASE_DELETABLE_FILE_REFERENCE_H_
OLDNEW
« no previous file with comments | « chrome/common/resource_dispatcher.cc ('k') | webkit/blob/deletable_file_reference.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698