OLD | NEW |
---|---|
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 CONTENT_BROWSER_CHROME_BLOB_STORAGE_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_CHROME_BLOB_STORAGE_CONTEXT_H_ |
6 #define CONTENT_BROWSER_CHROME_BLOB_STORAGE_CONTEXT_H_ | 6 #define CONTENT_BROWSER_CHROME_BLOB_STORAGE_CONTEXT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop_helpers.h" | 11 #include "base/message_loop_helpers.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
14 | 14 |
15 namespace content { | |
16 class BrowserContext; | |
17 } | |
18 | |
15 namespace webkit_blob { | 19 namespace webkit_blob { |
16 class BlobStorageController; | 20 class BlobStorageController; |
17 } | 21 } |
18 | 22 |
19 // A context class that keeps track of BlobStorageController used by the chrome. | 23 // A context class that keeps track of BlobStorageController used by the chrome. |
20 // There is an instance associated with each BrowserContext. There could be | 24 // There is an instance associated with each BrowserContext. There could be |
21 // multiple URLRequestContexts in the same browser context that refers to the | 25 // multiple URLRequestContexts in the same browser context that refers to the |
22 // same instance. | 26 // same instance. |
23 // | 27 // |
24 // All methods, except the ctor, are expected to be called on | 28 // All methods, except the ctor, are expected to be called on |
25 // the IO thread (unless specifically called out in doc comments). | 29 // the IO thread (unless specifically called out in doc comments). |
26 class CONTENT_EXPORT ChromeBlobStorageContext | 30 class CONTENT_EXPORT ChromeBlobStorageContext |
Jói
2012/02/20 23:13:49
So this is chrome as in "the browser chrome"? Som
jam
2012/02/21 01:20:13
it was called chrome before we had the content spl
| |
27 : public base::RefCountedThreadSafe< | 31 : public base::RefCountedThreadSafe< |
28 ChromeBlobStorageContext, content::BrowserThread::DeleteOnIOThread> { | 32 ChromeBlobStorageContext, content::BrowserThread::DeleteOnIOThread> { |
29 public: | 33 public: |
34 static ChromeBlobStorageContext* GetFor( | |
35 content::BrowserContext* browser_context); | |
36 | |
30 ChromeBlobStorageContext(); | 37 ChromeBlobStorageContext(); |
31 | 38 |
32 void InitializeOnIOThread(); | 39 void InitializeOnIOThread(); |
33 | 40 |
34 webkit_blob::BlobStorageController* controller() const { | 41 webkit_blob::BlobStorageController* controller() const { |
35 return controller_.get(); | 42 return controller_.get(); |
36 } | 43 } |
37 | 44 |
38 private: | 45 private: |
39 friend class base::RefCountedThreadSafe< | 46 friend class base::RefCountedThreadSafe< |
40 ChromeBlobStorageContext, content::BrowserThread::DeleteOnIOThread>; | 47 ChromeBlobStorageContext, content::BrowserThread::DeleteOnIOThread>; |
41 friend class content::BrowserThread; | 48 friend class content::BrowserThread; |
42 friend class base::DeleteHelper<ChromeBlobStorageContext>; | 49 friend class base::DeleteHelper<ChromeBlobStorageContext>; |
43 | 50 |
44 virtual ~ChromeBlobStorageContext(); | 51 virtual ~ChromeBlobStorageContext(); |
45 | 52 |
46 scoped_ptr<webkit_blob::BlobStorageController> controller_; | 53 scoped_ptr<webkit_blob::BlobStorageController> controller_; |
47 }; | 54 }; |
48 | 55 |
49 #endif // CONTENT_BROWSER_CHROME_BLOB_STORAGE_CONTEXT_H_ | 56 #endif // CONTENT_BROWSER_CHROME_BLOB_STORAGE_CONTEXT_H_ |
OLD | NEW |