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

Side by Side Diff: content/browser/chrome_blob_storage_context.h

Issue 9558006: Rename content/{common,browser}/file_system to fileapi and move blob stuff into it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_CHROME_BLOB_STORAGE_CONTEXT_H_
6 #define CONTENT_BROWSER_CHROME_BLOB_STORAGE_CONTEXT_H_
7 #pragma once
8
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/message_loop_helpers.h"
12 #include "content/common/content_export.h"
13 #include "content/public/browser/browser_thread.h"
14
15 namespace content {
16 class BrowserContext;
17 }
18
19 namespace webkit_blob {
20 class BlobStorageController;
21 }
22
23 struct ChromeBlobStorageContextDeleter;
24
25 // A context class that keeps track of BlobStorageController used by the chrome.
26 // There is an instance associated with each BrowserContext. There could be
27 // multiple URLRequestContexts in the same browser context that refers to the
28 // same instance.
29 //
30 // All methods, except the ctor, are expected to be called on
31 // the IO thread (unless specifically called out in doc comments).
32 class CONTENT_EXPORT ChromeBlobStorageContext
33 : public base::RefCountedThreadSafe<
34 ChromeBlobStorageContext, ChromeBlobStorageContextDeleter> {
35 public:
36 static ChromeBlobStorageContext* GetFor(
37 content::BrowserContext* browser_context);
38
39 ChromeBlobStorageContext();
40 virtual ~ChromeBlobStorageContext();
41
42 void InitializeOnIOThread();
43
44 webkit_blob::BlobStorageController* controller() const {
45 return controller_.get();
46 }
47
48 private:
49 friend struct ChromeBlobStorageContextDeleter;
50
51 void DeleteOnCorrectThread() const;
52
53 scoped_ptr<webkit_blob::BlobStorageController> controller_;
54 };
55
56 struct ChromeBlobStorageContextDeleter {
57 static void Destruct(const ChromeBlobStorageContext* context) {
58 context->DeleteOnCorrectThread();
59 }
60 };
61
62 #endif // CONTENT_BROWSER_CHROME_BLOB_STORAGE_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698