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_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_ |
6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_ | 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "content/browser/in_process_webkit/dom_storage_context.h" | 15 #include "content/browser/in_process_webkit/dom_storage_context.h" |
16 #include "content/browser/in_process_webkit/indexed_db_context.h" | 16 #include "content/browser/in_process_webkit/indexed_db_context.h" |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class MessageLoopProxy; | 19 class MessageLoopProxy; |
20 } | 20 } |
21 | 21 |
| 22 namespace content { |
| 23 class ResourceContext; |
| 24 } |
| 25 |
22 namespace quota { | 26 namespace quota { |
23 class QuotaManagerProxy; | 27 class QuotaManagerProxy; |
24 class SpecialStoragePolicy; | 28 class SpecialStoragePolicy; |
25 } | 29 } |
26 | 30 |
27 // There's one WebKitContext per profile. Various DispatcherHost classes | 31 // There's one WebKitContext per profile. Various DispatcherHost classes |
28 // have a pointer to the Context to store shared state. Unfortunately, this | 32 // have a pointer to the Context to store shared state. Unfortunately, this |
29 // class has become a bit of a dumping ground for calls made on the UI thread | 33 // class has become a bit of a dumping ground for calls made on the UI thread |
30 // that need to be proxied over to the WebKit thread. | 34 // that need to be proxied over to the WebKit thread. |
31 // | 35 // |
32 // This class is created on the UI thread and accessed on the UI, IO, and WebKit | 36 // This class is created on the UI thread and accessed on the UI, IO, and WebKit |
33 // threads. | 37 // threads. |
34 class WebKitContext : public base::RefCountedThreadSafe<WebKitContext> { | 38 class WebKitContext : public base::RefCountedThreadSafe<WebKitContext> { |
35 public: | 39 public: |
36 WebKitContext(bool is_incognito, const FilePath& data_path, | 40 WebKitContext(bool is_incognito, const FilePath& data_path, |
37 quota::SpecialStoragePolicy* special_storage_policy, | 41 quota::SpecialStoragePolicy* special_storage_policy, |
| 42 const content::ResourceContext& resource_context, |
38 bool clear_local_state_on_exit, | 43 bool clear_local_state_on_exit, |
39 quota::QuotaManagerProxy* quota_manager_proxy, | 44 quota::QuotaManagerProxy* quota_manager_proxy, |
40 base::MessageLoopProxy* webkit_thread_loop); | 45 base::MessageLoopProxy* webkit_thread_loop); |
41 | 46 |
42 const FilePath& data_path() const { return data_path_; } | 47 const FilePath& data_path() const { return data_path_; } |
43 bool is_incognito() const { return is_incognito_; } | 48 bool is_incognito() const { return is_incognito_; } |
44 | 49 |
45 DOMStorageContext* dom_storage_context() { | 50 DOMStorageContext* dom_storage_context() { |
46 return dom_storage_context_.get(); | 51 return dom_storage_context_.get(); |
47 } | 52 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // True if the destructors of context objects should delete their files. | 89 // True if the destructors of context objects should delete their files. |
85 bool clear_local_state_on_exit_; | 90 bool clear_local_state_on_exit_; |
86 | 91 |
87 scoped_ptr<DOMStorageContext> dom_storage_context_; | 92 scoped_ptr<DOMStorageContext> dom_storage_context_; |
88 scoped_refptr<IndexedDBContext> indexed_db_context_; | 93 scoped_refptr<IndexedDBContext> indexed_db_context_; |
89 | 94 |
90 DISALLOW_IMPLICIT_CONSTRUCTORS(WebKitContext); | 95 DISALLOW_IMPLICIT_CONSTRUCTORS(WebKitContext); |
91 }; | 96 }; |
92 | 97 |
93 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_ | 98 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_ |
OLD | NEW |