| 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 #include "content/common/content_export.h" |
| 17 | 18 |
| 18 namespace base { | 19 namespace base { |
| 19 class MessageLoopProxy; | 20 class MessageLoopProxy; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace quota { | 23 namespace quota { |
| 23 class QuotaManagerProxy; | 24 class QuotaManagerProxy; |
| 24 class SpecialStoragePolicy; | 25 class SpecialStoragePolicy; |
| 25 } | 26 } |
| 26 | 27 |
| 27 // There's one WebKitContext per browser context. Various DispatcherHost | 28 // There's one WebKitContext per browser context. Various DispatcherHost |
| 28 // classes have a pointer to the Context to store shared state. Unfortunately, | 29 // classes have a pointer to the Context to store shared state. Unfortunately, |
| 29 // this class has become a bit of a dumping ground for calls made on the UI | 30 // this class has become a bit of a dumping ground for calls made on the UI |
| 30 // thread that need to be proxied over to the WebKit thread. | 31 // thread that need to be proxied over to the WebKit thread. |
| 31 // | 32 // |
| 32 // This class is created on the UI thread and accessed on the UI, IO, and WebKit | 33 // This class is created on the UI thread and accessed on the UI, IO, and WebKit |
| 33 // threads. | 34 // threads. |
| 34 class WebKitContext : public base::RefCountedThreadSafe<WebKitContext> { | 35 class CONTENT_EXPORT WebKitContext |
| 36 : public base::RefCountedThreadSafe<WebKitContext> { |
| 35 public: | 37 public: |
| 36 WebKitContext(bool is_incognito, const FilePath& data_path, | 38 WebKitContext(bool is_incognito, const FilePath& data_path, |
| 37 quota::SpecialStoragePolicy* special_storage_policy, | 39 quota::SpecialStoragePolicy* special_storage_policy, |
| 38 bool clear_local_state_on_exit, | 40 bool clear_local_state_on_exit, |
| 39 quota::QuotaManagerProxy* quota_manager_proxy, | 41 quota::QuotaManagerProxy* quota_manager_proxy, |
| 40 base::MessageLoopProxy* webkit_thread_loop); | 42 base::MessageLoopProxy* webkit_thread_loop); |
| 41 | 43 |
| 42 const FilePath& data_path() const { return data_path_; } | 44 const FilePath& data_path() const { return data_path_; } |
| 43 bool is_incognito() const { return is_incognito_; } | 45 bool is_incognito() const { return is_incognito_; } |
| 44 | 46 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // True if the destructors of context objects should delete their files. | 90 // True if the destructors of context objects should delete their files. |
| 89 bool clear_local_state_on_exit_; | 91 bool clear_local_state_on_exit_; |
| 90 | 92 |
| 91 scoped_ptr<DOMStorageContext> dom_storage_context_; | 93 scoped_ptr<DOMStorageContext> dom_storage_context_; |
| 92 scoped_refptr<IndexedDBContext> indexed_db_context_; | 94 scoped_refptr<IndexedDBContext> indexed_db_context_; |
| 93 | 95 |
| 94 DISALLOW_IMPLICIT_CONSTRUCTORS(WebKitContext); | 96 DISALLOW_IMPLICIT_CONSTRUCTORS(WebKitContext); |
| 95 }; | 97 }; |
| 96 | 98 |
| 97 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_ | 99 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_ |
| OLD | NEW |