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

Side by Side Diff: content/browser/in_process_webkit/webkit_context.h

Issue 7053030: Initial IndexedDBQuotaClient implementation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make webkit thread outlive IndexedDBContext Created 9 years, 6 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
OLDNEW
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 {
19 class MessageLoopProxy;
20 }
21
18 namespace quota { 22 namespace quota {
23 class QuotaManagerProxy;
19 class SpecialStoragePolicy; 24 class SpecialStoragePolicy;
20 } 25 }
21 26
22 // There's one WebKitContext per profile. Various DispatcherHost classes 27 // There's one WebKitContext per profile. Various DispatcherHost classes
23 // have a pointer to the Context to store shared state. Unfortunately, this 28 // have a pointer to the Context to store shared state. Unfortunately, this
24 // class has become a bit of a dumping ground for calls made on the UI thread 29 // class has become a bit of a dumping ground for calls made on the UI thread
25 // that need to be proxied over to the WebKit thread. 30 // that need to be proxied over to the WebKit thread.
26 // 31 //
27 // 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
28 // threads. 33 // threads.
29 class WebKitContext : public base::RefCountedThreadSafe<WebKitContext> { 34 class WebKitContext : public base::RefCountedThreadSafe<WebKitContext> {
30 public: 35 public:
31 WebKitContext(bool is_incognito, const FilePath& data_path, 36 WebKitContext(bool is_incognito, const FilePath& data_path,
32 quota::SpecialStoragePolicy* special_storage_policy, 37 quota::SpecialStoragePolicy* special_storage_policy,
33 bool clear_local_state_on_exit); 38 bool clear_local_state_on_exit,
39 quota::QuotaManagerProxy* quota_manager_proxy,
40 base::MessageLoopProxy* webkit_thread_loop);
34 41
35 const FilePath& data_path() const { return data_path_; } 42 const FilePath& data_path() const { return data_path_; }
36 bool is_incognito() const { return is_incognito_; } 43 bool is_incognito() const { return is_incognito_; }
37 44
38 DOMStorageContext* dom_storage_context() { 45 DOMStorageContext* dom_storage_context() {
39 return dom_storage_context_.get(); 46 return dom_storage_context_.get();
40 } 47 }
41 48
42 IndexedDBContext* indexed_db_context() { 49 IndexedDBContext* indexed_db_context() {
43 return indexed_db_context_.get(); 50 return indexed_db_context_.get();
(...skipping 27 matching lines...) Expand all
71 virtual ~WebKitContext(); 78 virtual ~WebKitContext();
72 79
73 // Copies of profile data that can be accessed on any thread. 80 // Copies of profile data that can be accessed on any thread.
74 const FilePath data_path_; 81 const FilePath data_path_;
75 const bool is_incognito_; 82 const bool is_incognito_;
76 83
77 // True if the destructors of context objects should delete their files. 84 // True if the destructors of context objects should delete their files.
78 bool clear_local_state_on_exit_; 85 bool clear_local_state_on_exit_;
79 86
80 scoped_ptr<DOMStorageContext> dom_storage_context_; 87 scoped_ptr<DOMStorageContext> dom_storage_context_;
81 scoped_ptr<IndexedDBContext> indexed_db_context_; 88 scoped_refptr<IndexedDBContext> indexed_db_context_;
82 89
83 DISALLOW_IMPLICIT_CONSTRUCTORS(WebKitContext); 90 DISALLOW_IMPLICIT_CONSTRUCTORS(WebKitContext);
84 }; 91 };
85 92
86 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_ 93 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698