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

Unified Diff: chrome/browser/in_process_webkit/session_storage_namespace.h

Issue 3325012: Fix SessionStorage (Closed)
Patch Set: kill the last (new) dcheck Created 10 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/in_process_webkit/session_storage_namespace.h
diff --git a/chrome/browser/in_process_webkit/session_storage_namespace.h b/chrome/browser/in_process_webkit/session_storage_namespace.h
new file mode 100644
index 0000000000000000000000000000000000000000..364882a7c36358a9a04caa398b15e0495b2f5707
--- /dev/null
+++ b/chrome/browser/in_process_webkit/session_storage_namespace.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_IN_PROCESS_WEBKIT_SESSION_STORAGE_NAMESPACE_H_
+#define CHROME_BROWSER_IN_PROCESS_WEBKIT_SESSION_STORAGE_NAMESPACE_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/ref_counted.h"
+
+class Profile;
+class WebKitContext;
+
+// This is a ref-counted class that represents a SessionStorageNamespace.
+// On destruction it ensures that the storage namespace is destroyed.
+// NOTE: That if we're shutting down, we don't strictly need to do this, but
+// it keeps valgrind happy.
+class SessionStorageNamespace
+ : public base::RefCountedThreadSafe<SessionStorageNamespace> {
+ public:
+ explicit SessionStorageNamespace(Profile* profile);
+
+ int64 id() const { return id_; }
+
+ // The session storage namespace parameter allows multiple render views and
+ // tab contentses to share the same session storage (part of the WebStorage
+ // spec) space. Passing in NULL simply allocates a new one which is often the
+ // correct thing to do (especially in tests.
+ SessionStorageNamespace* Clone();
+
+ private:
+ SessionStorageNamespace(WebKitContext* webkit_context, int64 id);
+
+ friend class base::RefCountedThreadSafe<SessionStorageNamespace>;
+ ~SessionStorageNamespace();
+
+ scoped_refptr<WebKitContext> webkit_context_;
+
+ // The session storage namespace id.
+ int64 id_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(SessionStorageNamespace);
+};
+
+#endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_SESSION_STORAGE_NAMESPACE_H_
« no previous file with comments | « chrome/browser/gtk/html_dialog_gtk.cc ('k') | chrome/browser/in_process_webkit/session_storage_namespace.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698