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

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

Issue 8508059: build blob as a component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up nits Created 9 years, 1 month 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 | « webkit/blob/blob_url_request_job_factory.h ('k') | webkit/blob/view_blob_internals_job.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef WEBKIT_BLOB_DELETABLE_FILE_REFERENCE_H_ 5 #ifndef WEBKIT_BLOB_DELETABLE_FILE_REFERENCE_H_
6 #define WEBKIT_BLOB_DELETABLE_FILE_REFERENCE_H_ 6 #define WEBKIT_BLOB_DELETABLE_FILE_REFERENCE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/file_path.h" 12 #include "base/file_path.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "webkit/blob/blob_export.h"
14 15
15 namespace base { 16 namespace base {
16 class MessageLoopProxy; 17 class MessageLoopProxy;
17 } 18 }
18 19
19 namespace webkit_blob { 20 namespace webkit_blob {
20 21
21 // A refcounted wrapper around a FilePath that schedules the file 22 // A refcounted wrapper around a FilePath that schedules the file
22 // to be deleted upon final release. 23 // to be deleted upon final release.
23 class DeletableFileReference : public base::RefCounted<DeletableFileReference> { 24 class BLOB_EXPORT DeletableFileReference :
25 public base::RefCounted<DeletableFileReference> {
24 public: 26 public:
25 typedef base::Callback<void(const FilePath&)> DeletionCallback; 27 typedef base::Callback<void(const FilePath&)> DeletionCallback;
26 28
27 // Returns a DeletableFileReference for the given path, if no reference 29 // Returns a DeletableFileReference for the given path, if no reference
28 // for this path exists returns NULL. 30 // for this path exists returns NULL.
29 static scoped_refptr<DeletableFileReference> Get(const FilePath& path); 31 static scoped_refptr<DeletableFileReference> Get(const FilePath& path);
30 32
31 // Returns a DeletableFileReference for the given path, creating a new 33 // Returns a DeletableFileReference for the given path, creating a new
32 // reference if none yet exists. 34 // reference if none yet exists.
33 static scoped_refptr<DeletableFileReference> GetOrCreate( 35 static scoped_refptr<DeletableFileReference> GetOrCreate(
(...skipping 15 matching lines...) Expand all
49 scoped_refptr<base::MessageLoopProxy> file_thread_; 51 scoped_refptr<base::MessageLoopProxy> file_thread_;
50 52
51 std::vector<DeletionCallback> deletion_callbacks_; 53 std::vector<DeletionCallback> deletion_callbacks_;
52 54
53 DISALLOW_COPY_AND_ASSIGN(DeletableFileReference); 55 DISALLOW_COPY_AND_ASSIGN(DeletableFileReference);
54 }; 56 };
55 57
56 } // namespace webkit_blob 58 } // namespace webkit_blob
57 59
58 #endif // BASE_DELETABLE_FILE_REFERENCE_H_ 60 #endif // BASE_DELETABLE_FILE_REFERENCE_H_
OLDNEW
« no previous file with comments | « webkit/blob/blob_url_request_job_factory.h ('k') | webkit/blob/view_blob_internals_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698