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

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

Issue 9726022: Revert 127573 - DOMStorageContextImpl that's implemented in terms of the new dom_storage classes. A… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_
6 #define CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_
7 #pragma once
8
9 #include "base/file_path.h"
10 #include "base/memory/ref_counted.h"
11 #include "base/string16.h"
12 #include "base/time.h"
13 #include "content/public/browser/dom_storage_context.h"
14 #include "webkit/dom_storage/dom_storage_types.h"
15
16 #ifdef ENABLE_NEW_DOM_STORAGE_BACKEND
17
18 namespace dom_storage {
19 class DomStorageContext;
20 }
21
22 namespace quota {
23 class SpecialStoragePolicy;
24 }
25
26 // This is owned by BrowserContext (aka Profile) and encapsulates all
27 // per-profile dom storage state.
28 class CONTENT_EXPORT DOMStorageContextImpl :
29 NON_EXPORTED_BASE(public content::DOMStorageContext),
30 public base::RefCountedThreadSafe<DOMStorageContextImpl> {
31 public:
32 // If |data_path| is empty, nothing will be saved to disk.
33 DOMStorageContextImpl(const FilePath& data_path,
34 quota::SpecialStoragePolicy* special_storage_policy);
35
36 // DOMStorageContext implementation.
37 virtual void GetAllStorageFiles(
38 const GetAllStorageFilesCallback& callback) OVERRIDE;
39 virtual FilePath GetFilePath(const string16& origin_id) const OVERRIDE;
40 virtual void DeleteForOrigin(const string16& origin_id) OVERRIDE;
41 virtual void DeleteLocalStorageFile(const FilePath& file_path) OVERRIDE;
42 virtual void DeleteDataModifiedSince(const base::Time& cutoff) OVERRIDE;
43
44 // Called to free up memory that's not strictly needed.
45 void PurgeMemory();
46
47 // Used by content settings to alter the behavior around
48 // what data to keep and what data to discard at shutdown.
49 // The policy is not so straight forward to describe, see
50 // the implementation for details.
51 void SetClearLocalState(bool clear_local_state);
52 void SaveSessionState();
53
54 // Called when the BrowserContext/Profile is going away.
55 void Shutdown();
56
57 // See render_message_filter.cc for details.
58 // TODO(michaeln): Remove this method when that bug is fixed.
59 int64 LeakyCloneSessionStorage(int64 existing_namespace_id);
60
61 private:
62 friend class DOMStorageMessageFilter; // for access to context()
63 friend class SessionStorageNamespaceImpl; // ditto
64 friend class base::RefCountedThreadSafe<DOMStorageContextImpl>;
65
66 virtual ~DOMStorageContextImpl();
67 dom_storage::DomStorageContext* context() const { return context_.get(); }
68
69 scoped_refptr<dom_storage::DomStorageContext> context_;
70
71 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextImpl);
72 };
73
74 #endif // ENABLE_NEW_DOM_STORAGE_BACKEND
75 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/browser_context.cc ('k') | content/browser/dom_storage/dom_storage_context_impl_new.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698