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

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

Issue 17653005: Merge StreamContext into ChromeBlobStorageContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | « no previous file | content/browser/fileapi/chrome_blob_storage_context.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_ 5 #ifndef CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_
6 #define CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_ 6 #define CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/sequenced_task_runner_helpers.h" 10 #include "base/sequenced_task_runner_helpers.h"
11 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
12 12
13 namespace webkit_blob { 13 namespace webkit_blob {
14 class BlobStorageController; 14 class BlobStorageController;
15 } 15 }
16 16
17 namespace content { 17 namespace content {
18 class BrowserContext; 18 class BrowserContext;
19 struct ChromeBlobStorageContextDeleter; 19 struct ChromeBlobStorageContextDeleter;
20 class StreamRegistry;
20 21
21 // A context class that keeps track of BlobStorageController used by the chrome. 22 // A context class that keeps track of BlobStorageController and StreamRegistry
22 // There is an instance associated with each BrowserContext. There could be 23 // used by the chrome. There is an instance associated with each BrowserContext.
23 // multiple URLRequestContexts in the same browser context that refers to the 24 // There could be multiple URLRequestContexts in the same browser context that
24 // same instance. 25 // refers to the same instance.
25 // 26 //
26 // All methods, except the ctor, are expected to be called on 27 // All methods, except the ctor, are expected to be called on
27 // the IO thread (unless specifically called out in doc comments). 28 // the IO thread (unless specifically called out in doc comments).
28 class CONTENT_EXPORT ChromeBlobStorageContext 29 class CONTENT_EXPORT ChromeBlobStorageContext
29 : public base::RefCountedThreadSafe<ChromeBlobStorageContext, 30 : public base::RefCountedThreadSafe<ChromeBlobStorageContext,
30 ChromeBlobStorageContextDeleter> { 31 ChromeBlobStorageContextDeleter> {
31 public: 32 public:
32 ChromeBlobStorageContext(); 33 ChromeBlobStorageContext();
33 34
34 static ChromeBlobStorageContext* GetFor( 35 static ChromeBlobStorageContext* GetFor(
35 BrowserContext* browser_context); 36 BrowserContext* browser_context);
36 37
37 void InitializeOnIOThread(); 38 void InitializeOnIOThread();
38 39
39 webkit_blob::BlobStorageController* controller() const { 40 webkit_blob::BlobStorageController* controller() const {
40 return controller_.get(); 41 return controller_.get();
41 } 42 }
42 43
44 StreamRegistry* stream_registry() const {
45 return stream_registry_.get();
46 }
47
43 protected: 48 protected:
44 virtual ~ChromeBlobStorageContext(); 49 virtual ~ChromeBlobStorageContext();
45 50
46 private: 51 private:
47 friend class base::DeleteHelper<ChromeBlobStorageContext>; 52 friend class base::DeleteHelper<ChromeBlobStorageContext>;
48 friend class base::RefCountedThreadSafe<ChromeBlobStorageContext, 53 friend class base::RefCountedThreadSafe<ChromeBlobStorageContext,
49 ChromeBlobStorageContextDeleter>; 54 ChromeBlobStorageContextDeleter>;
50 friend struct ChromeBlobStorageContextDeleter; 55 friend struct ChromeBlobStorageContextDeleter;
51 56
52 void DeleteOnCorrectThread() const; 57 void DeleteOnCorrectThread() const;
53 58
54 scoped_ptr<webkit_blob::BlobStorageController> controller_; 59 scoped_ptr<webkit_blob::BlobStorageController> controller_;
60 scoped_ptr<StreamRegistry> stream_registry_;
55 }; 61 };
56 62
57 struct ChromeBlobStorageContextDeleter { 63 struct ChromeBlobStorageContextDeleter {
58 static void Destruct(const ChromeBlobStorageContext* context) { 64 static void Destruct(const ChromeBlobStorageContext* context) {
59 context->DeleteOnCorrectThread(); 65 context->DeleteOnCorrectThread();
60 } 66 }
61 }; 67 };
62 68
63 } // namespace content 69 } // namespace content
64 70
65 #endif // CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_ 71 #endif // CONTENT_BROWSER_FILEAPI_CHROME_BLOB_STORAGE_CONTEXT_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/fileapi/chrome_blob_storage_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698