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

Side by Side Diff: webkit/dom_storage/dom_storage_session.h

Issue 10546167: Create and store persistent unique ids for sessionStorage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased 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 WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ 5 #ifndef WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_
6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ 6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string>
10
9 #include "base/basictypes.h" 11 #include "base/basictypes.h"
10 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
11 13
12 namespace dom_storage { 14 namespace dom_storage {
13 15
14 class DomStorageContext; 16 class DomStorageContext;
15 17
16 // This refcounted class determines the lifetime of a session 18 // This refcounted class determines the lifetime of a session
17 // storage namespace and provides an interface to Clone() an 19 // storage namespace and provides an interface to Clone() an
18 // existing session storage namespace. It may be used on any thread. 20 // existing session storage namespace. It may be used on any thread.
19 // See class comments for DomStorageContext for a larger overview. 21 // See class comments for DomStorageContext for a larger overview.
20 class DomStorageSession 22 class DomStorageSession
21 : public base::RefCountedThreadSafe<DomStorageSession> { 23 : public base::RefCountedThreadSafe<DomStorageSession> {
22 public: 24 public:
23 explicit DomStorageSession(DomStorageContext* context); 25 explicit DomStorageSession(DomStorageContext* context);
michaeln 2012/06/14 22:53:48 The constructors for this are not so obvious (here
marja 2012/06/15 09:17:43 Done. (In the header.)
26 DomStorageSession(DomStorageContext* context,
27 const std::string& persistent_namespace_id);
24 int64 namespace_id() const { return namespace_id_; } 28 int64 namespace_id() const { return namespace_id_; }
29 std::string persistent_namespace_id() const {
michaeln 2012/06/14 22:53:48 ditto const ref question
marja 2012/06/15 09:17:43 Done.
30 return persistent_namespace_id_;
31 }
25 DomStorageSession* Clone(); 32 DomStorageSession* Clone();
26 33
27 static DomStorageSession* CloneFrom(DomStorageContext* context, 34 static DomStorageSession* CloneFrom(DomStorageContext* context,
28 int64 namepace_id_to_clone); 35 int64 namepace_id_to_clone);
29 36
30 private: 37 private:
31 friend class base::RefCountedThreadSafe<DomStorageSession>; 38 friend class base::RefCountedThreadSafe<DomStorageSession>;
32 39
33 DomStorageSession(DomStorageContext* context, int64 namespace_id); 40 DomStorageSession(DomStorageContext* context,
41 int64 namespace_id,
42 const std::string& persistent_namespace_id);
34 ~DomStorageSession(); 43 ~DomStorageSession();
35 44
36 scoped_refptr<DomStorageContext> context_; 45 scoped_refptr<DomStorageContext> context_;
37 int64 namespace_id_; 46 int64 namespace_id_;
47 std::string persistent_namespace_id_;
38 48
39 DISALLOW_IMPLICIT_CONSTRUCTORS(DomStorageSession); 49 DISALLOW_IMPLICIT_CONSTRUCTORS(DomStorageSession);
40 }; 50 };
41 51
42 } // namespace dom_storage 52 } // namespace dom_storage
43 53
44 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_ 54 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698