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 quota { | 22 namespace quota { |
23 class QuotaManagerProxy; | 23 class QuotaManagerProxy; |
24 class SpecialStoragePolicy; | 24 class SpecialStoragePolicy; |
25 } | 25 } |
26 | 26 |
27 // There's one WebKitContext per profile. Various DispatcherHost classes | 27 // There's one WebKitContext per browser context. Various DispatcherHost |
28 // have a pointer to the Context to store shared state. Unfortunately, this | 28 // classes have a pointer to the Context to store shared state. Unfortunately, |
29 // class has become a bit of a dumping ground for calls made on the UI thread | 29 // this class has become a bit of a dumping ground for calls made on the UI |
30 // that need to be proxied over to the WebKit thread. | 30 // thread that need to be proxied over to the WebKit thread. |
31 // | 31 // |
32 // This class is created on the UI thread and accessed on the UI, IO, and WebKit | 32 // This class is created on the UI thread and accessed on the UI, IO, and WebKit |
33 // threads. | 33 // threads. |
34 class WebKitContext : public base::RefCountedThreadSafe<WebKitContext> { | 34 class WebKitContext : public base::RefCountedThreadSafe<WebKitContext> { |
35 public: | 35 public: |
36 WebKitContext(bool is_incognito, const FilePath& data_path, | 36 WebKitContext(bool is_incognito, const FilePath& data_path, |
37 quota::SpecialStoragePolicy* special_storage_policy, | 37 quota::SpecialStoragePolicy* special_storage_policy, |
38 bool clear_local_state_on_exit, | 38 bool clear_local_state_on_exit, |
39 quota::QuotaManagerProxy* quota_manager_proxy, | 39 quota::QuotaManagerProxy* quota_manager_proxy, |
40 base::MessageLoopProxy* webkit_thread_loop); | 40 base::MessageLoopProxy* webkit_thread_loop); |
(...skipping 29 matching lines...) Expand all Loading... |
70 void DeleteDataModifiedSince(const base::Time& cutoff); | 70 void DeleteDataModifiedSince(const base::Time& cutoff); |
71 | 71 |
72 // Delete the session storage namespace associated with this id. Can be | 72 // Delete the session storage namespace associated with this id. Can be |
73 // called from any thread. | 73 // called from any thread. |
74 void DeleteSessionStorageNamespace(int64 session_storage_namespace_id); | 74 void DeleteSessionStorageNamespace(int64 session_storage_namespace_id); |
75 | 75 |
76 private: | 76 private: |
77 friend class base::RefCountedThreadSafe<WebKitContext>; | 77 friend class base::RefCountedThreadSafe<WebKitContext>; |
78 virtual ~WebKitContext(); | 78 virtual ~WebKitContext(); |
79 | 79 |
80 // Copies of profile data that can be accessed on any thread. | 80 // Copies of browser context data that can be accessed on any thread. |
81 const FilePath data_path_; | 81 const FilePath data_path_; |
82 const bool is_incognito_; | 82 const bool is_incognito_; |
83 | 83 |
84 // True if the destructors of context objects should delete their files. | 84 // True if the destructors of context objects should delete their files. |
85 bool clear_local_state_on_exit_; | 85 bool clear_local_state_on_exit_; |
86 | 86 |
87 scoped_ptr<DOMStorageContext> dom_storage_context_; | 87 scoped_ptr<DOMStorageContext> dom_storage_context_; |
88 scoped_refptr<IndexedDBContext> indexed_db_context_; | 88 scoped_refptr<IndexedDBContext> indexed_db_context_; |
89 | 89 |
90 DISALLOW_IMPLICIT_CONSTRUCTORS(WebKitContext); | 90 DISALLOW_IMPLICIT_CONSTRUCTORS(WebKitContext); |
91 }; | 91 }; |
92 | 92 |
93 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_ | 93 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_ |
OLD | NEW |