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

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

Issue 14139026: New blobstoragecontext for use in the main browser process, not plugged in yet. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 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
« no previous file with comments | « webkit/blob/blob_data.cc ('k') | webkit/blob/blob_data_handle.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2013 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_BLOB_DATA_HANDLE_H_
6 #define WEBKIT_BLOB_BLOB_DATA_HANDLE_H_
7
8 #include <string>
9
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/weak_ptr.h"
12 #include "base/supports_user_data.h"
13 #include "webkit/storage/webkit_storage_export.h"
14
15 namespace base {
16 class SequencedTaskRunner;
17 }
18
19 namespace webkit_blob {
20
21 class BlobData;
22 class BlobStorageContext;
23
24 // A scoper object for use in chrome's main browser process, ensures
25 // the underlying BlobData and its uuid remain in BlobStorageContext's
26 // collection for the duration. This object has delete semantics and
27 // maybe deleted on any thread.
28 class WEBKIT_STORAGE_EXPORT BlobDataHandle
29 : public base::SupportsUserData::Data {
30 public:
31 virtual ~BlobDataHandle(); // Maybe be deleted on any thread.
32 BlobData* data() const; // May only be accessed on the IO thread.
33
34 private:
35 friend class BlobStorageContext;
36 BlobDataHandle(BlobData* blob_data, BlobStorageContext* context,
37 base::SequencedTaskRunner* task_runner);
38
39 static void DeleteHelper(
40 base::WeakPtr<BlobStorageContext> context,
41 BlobData* blob_data);
42
43 BlobData* blob_data_; // Intentionally a raw ptr to a non-thread-safe ref.
44 base::WeakPtr<BlobStorageContext> context_;
45 scoped_refptr<base::SequencedTaskRunner> io_task_runner_;
46 };
47
48 } // namespace webkit_blob
49
50 #endif // WEBKIT_BLOB_BLOB_DATA_HANDLE_H_
OLDNEW
« no previous file with comments | « webkit/blob/blob_data.cc ('k') | webkit/blob/blob_data_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698