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

Side by Side Diff: content/browser/dom_storage/dom_storage_context_impl.h

Issue 10572015: Session restore: Store and restore persistent IDs for sessionStorage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ 5 #ifndef CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_
6 #define CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ 6 #define CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "content/public/browser/dom_storage_context.h" 10 #include "content/public/browser/dom_storage_context.h"
11 11
12 class FilePath; 12 class FilePath;
13 13
14 namespace content {
15 class SessionStorageNamespace;
michaeln 2012/06/20 04:01:59 since this is forward declared in content/public/b
marja 2012/06/20 16:54:32 Done.
16 }
17
14 namespace quota { 18 namespace quota {
15 class SpecialStoragePolicy; 19 class SpecialStoragePolicy;
16 } 20 }
17 21
18 // This is owned by BrowserContext (aka Profile) and encapsulates all 22 // This is owned by BrowserContext (aka Profile) and encapsulates all
19 // per-profile dom storage state. 23 // per-profile dom storage state.
20 class CONTENT_EXPORT DOMStorageContextImpl : 24 class CONTENT_EXPORT DOMStorageContextImpl :
21 NON_EXPORTED_BASE(public content::DOMStorageContext), 25 NON_EXPORTED_BASE(public content::DOMStorageContext),
22 public base::RefCountedThreadSafe<DOMStorageContextImpl> { 26 public base::RefCountedThreadSafe<DOMStorageContextImpl> {
23 public: 27 public:
24 // If |data_path| is empty, nothing will be saved to disk. 28 // If |data_path| is empty, nothing will be saved to disk.
25 DOMStorageContextImpl(const FilePath& data_path, 29 DOMStorageContextImpl(const FilePath& data_path,
26 quota::SpecialStoragePolicy* special_storage_policy); 30 quota::SpecialStoragePolicy* special_storage_policy);
27 31
28 // DOMStorageContext implementation. 32 // DOMStorageContext implementation.
29 virtual void GetUsageInfo(const GetUsageInfoCallback& callback) OVERRIDE; 33 virtual void GetUsageInfo(const GetUsageInfoCallback& callback) OVERRIDE;
30 virtual void DeleteOrigin(const GURL& origin) OVERRIDE; 34 virtual void DeleteOrigin(const GURL& origin) OVERRIDE;
35 virtual scoped_refptr<content::SessionStorageNamespace>
36 RecreateSessionStorage(const std::string& persistent_id) OVERRIDE;
31 37
32 // Called to free up memory that's not strictly needed. 38 // Called to free up memory that's not strictly needed.
33 void PurgeMemory(); 39 void PurgeMemory();
34 40
35 // Used by content settings to alter the behavior around 41 // Used by content settings to alter the behavior around
36 // what data to keep and what data to discard at shutdown. 42 // what data to keep and what data to discard at shutdown.
37 // The policy is not so straight forward to describe, see 43 // The policy is not so straight forward to describe, see
38 // the implementation for details. 44 // the implementation for details.
39 void SetForceKeepSessionState(); 45 void SetForceKeepSessionState();
40 46
41 // Called when the BrowserContext/Profile is going away. 47 // Called when the BrowserContext/Profile is going away.
42 void Shutdown(); 48 void Shutdown();
43 49
44 private: 50 private:
45 friend class DOMStorageMessageFilter; // for access to context() 51 friend class DOMStorageMessageFilter; // for access to context()
46 friend class SessionStorageNamespaceImpl; // ditto 52 friend class SessionStorageNamespaceImpl; // ditto
47 friend class base::RefCountedThreadSafe<DOMStorageContextImpl>; 53 friend class base::RefCountedThreadSafe<DOMStorageContextImpl>;
48 54
49 virtual ~DOMStorageContextImpl(); 55 virtual ~DOMStorageContextImpl();
50 dom_storage::DomStorageContext* context() const { return context_.get(); } 56 dom_storage::DomStorageContext* context() const { return context_.get(); }
51 57
52 scoped_refptr<dom_storage::DomStorageContext> context_; 58 scoped_refptr<dom_storage::DomStorageContext> context_;
53 59
54 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextImpl); 60 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextImpl);
55 }; 61 };
56 62
57 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ 63 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698