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

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

Issue 545054: Introduce all the plumbing for Session Storage. This mostly consists of crea... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_ 5 #ifndef CHROME_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_
6 #define CHROME_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_ 6 #define CHROME_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_
7 7
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/ref_counted.h" 9 #include "base/ref_counted.h"
10 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
11 #include "base/time.h" 11 #include "base/time.h"
12 #include "chrome/browser/in_process_webkit/dom_storage_context.h" 12 #include "chrome/browser/in_process_webkit/dom_storage_context.h"
13 13
14 class WebKitThread; 14 class WebKitThread;
15 15
16 // There's one WebKitContext per profile. Various DispatcherHost classes 16 // There's one WebKitContext per profile. Various DispatcherHost classes
17 // have a pointer to the Context to store shared state. 17 // have a pointer to the Context to store shared state. Unfortunately, this
18 // class has become a bit of a dumping ground for calls made on the UI thread
19 // that need to be proxied over to the WebKit thread.
18 // 20 //
19 // This class is created on the UI thread and accessed on the UI, IO, and WebKit 21 // This class is created on the UI thread and accessed on the UI, IO, and WebKit
20 // threads. 22 // threads.
21 class WebKitContext : public base::RefCountedThreadSafe<WebKitContext> { 23 class WebKitContext : public base::RefCountedThreadSafe<WebKitContext> {
22 public: 24 public:
23 WebKitContext(const FilePath& data_path, bool is_incognito); 25 WebKitContext(const FilePath& data_path, bool is_incognito);
24 26
25 const FilePath& data_path() const { return data_path_; } 27 const FilePath& data_path() const { return data_path_; }
26 bool is_incognito() const { return is_incognito_; } 28 bool is_incognito() const { return is_incognito_; }
27 DOMStorageContext* dom_storage_context() { 29 DOMStorageContext* dom_storage_context() {
28 return dom_storage_context_.get(); 30 return dom_storage_context_.get();
29 } 31 }
30 32
31 #ifdef UNIT_TEST 33 #ifdef UNIT_TEST
32 // For unit tests, allow specifying a DOMStorageContext directly so it can be 34 // For unit tests, allow specifying a DOMStorageContext directly so it can be
33 // mocked. 35 // mocked.
34 void set_dom_storage_context(DOMStorageContext* dom_storage_context) { 36 void set_dom_storage_context(DOMStorageContext* dom_storage_context) {
35 dom_storage_context_.reset(dom_storage_context); 37 dom_storage_context_.reset(dom_storage_context);
36 } 38 }
37 #endif 39 #endif
38 40
39 // Tells the DOMStorageContext to purge any memory it does not need. 41 // Tells the DOMStorageContext to purge any memory it does not need.
40 void PurgeMemory(); 42 void PurgeMemory();
41 43
42 // Tell all children (where applicable) to delete any objects that were 44 // Tell all children (where applicable) to delete any objects that were
43 // last modified on or after the following time. 45 // last modified on or after the following time.
44 void DeleteDataModifiedSince(const base::Time& cutoff); 46 void DeleteDataModifiedSince(const base::Time& cutoff);
45 47
48 // Delete the session storage namespace associated with this id. Called from
49 // the UI thread.
50 void DeleteSessionStorageNamespace(int64 session_storage_namespace_id);
51
46 private: 52 private:
47 friend class base::RefCountedThreadSafe<WebKitContext>; 53 friend class base::RefCountedThreadSafe<WebKitContext>;
48 ~WebKitContext(); 54 ~WebKitContext();
49 55
50 // Copies of profile data that can be accessed on any thread. 56 // Copies of profile data that can be accessed on any thread.
51 const FilePath data_path_; 57 const FilePath data_path_;
52 const bool is_incognito_; 58 const bool is_incognito_;
53 59
54 scoped_ptr<DOMStorageContext> dom_storage_context_; 60 scoped_ptr<DOMStorageContext> dom_storage_context_;
55 61
56 DISALLOW_IMPLICIT_CONSTRUCTORS(WebKitContext); 62 DISALLOW_IMPLICIT_CONSTRUCTORS(WebKitContext);
57 }; 63 };
58 64
59 #endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_ 65 #endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_WEBKIT_CONTEXT_H_
OLDNEW
« no previous file with comments | « chrome/browser/in_process_webkit/dom_storage_namespace.cc ('k') | chrome/browser/in_process_webkit/webkit_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698