OLD | NEW |
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_DOM_STORAGE_DISPATCHER_HOST_H_ | 5 #ifndef CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_DISPATCHER_HOST_H_ |
6 #define CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_DISPATCHER_HOST_H_ | 6 #define CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_DISPATCHER_HOST_H_ |
7 | 7 |
8 #include "base/hash_tables.h" | 8 #include "base/hash_tables.h" |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
11 #include "ipc/ipc_message.h" | 11 #include "ipc/ipc_message.h" |
12 | 12 |
13 class WebKitContext; | 13 class WebKitContext; |
14 class WebKitThread; | 14 class WebKitThread; |
15 | 15 |
16 namespace WebKit { | 16 namespace WebKit { |
17 class WebStorageArea; | 17 class WebStorageArea; |
18 class WebStorageNamespace; | 18 class WebStorageNamespace; |
| 19 class WebString; |
19 } | 20 } |
20 | 21 |
21 // This class handles the logistics of DOM Storage within the browser process. | 22 // This class handles the logistics of DOM Storage within the browser process. |
22 // It mostly ferries information between IPCs and the WebKit implementations, | 23 // It mostly ferries information between IPCs and the WebKit implementations, |
23 // but it also handles some special cases like when renderer processes die. | 24 // but it also handles some special cases like when renderer processes die. |
24 class DOMStorageDispatcherHost : | 25 class DOMStorageDispatcherHost : |
25 public base::RefCountedThreadSafe<DOMStorageDispatcherHost> { | 26 public base::RefCountedThreadSafe<DOMStorageDispatcherHost> { |
26 public: | 27 public: |
27 // Only call the constructor from the UI thread. | 28 // Only call the constructor from the UI thread. |
28 DOMStorageDispatcherHost(IPC::Message::Sender* message_sender, | 29 DOMStorageDispatcherHost(IPC::Message::Sender* message_sender, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 WebKit::WebStorageArea* GetStorageArea(int64 id); | 63 WebKit::WebStorageArea* GetStorageArea(int64 id); |
63 WebKit::WebStorageNamespace* GetStorageNamespace(int64 id); | 64 WebKit::WebStorageNamespace* GetStorageNamespace(int64 id); |
64 | 65 |
65 // Add a WebStorageNamespace or WebStorageArea and get a new unique ID for | 66 // Add a WebStorageNamespace or WebStorageArea and get a new unique ID for |
66 // it. Only call on the WebKit thread. | 67 // it. Only call on the WebKit thread. |
67 int64 AddStorageArea(WebKit::WebStorageArea* new_storage_area); | 68 int64 AddStorageArea(WebKit::WebStorageArea* new_storage_area); |
68 int64 AddStorageNamespace(WebKit::WebStorageNamespace* new_namespace); | 69 int64 AddStorageNamespace(WebKit::WebStorageNamespace* new_namespace); |
69 | 70 |
70 // Get the path to the LocalStorage directory. Calculate it if we haven't | 71 // Get the path to the LocalStorage directory. Calculate it if we haven't |
71 // already. Only call on the WebKit thread. | 72 // already. Only call on the WebKit thread. |
72 string16 GetLocalStoragePath(); | 73 WebKit::WebString GetLocalStoragePath(); |
73 | 74 |
74 // Data shared between renderer processes with the same profile. | 75 // Data shared between renderer processes with the same profile. |
75 scoped_refptr<WebKitContext> webkit_context_; | 76 scoped_refptr<WebKitContext> webkit_context_; |
76 | 77 |
77 // ResourceDispatcherHost takes care of destruction. Immutable. | 78 // ResourceDispatcherHost takes care of destruction. Immutable. |
78 WebKitThread* webkit_thread_; | 79 WebKitThread* webkit_thread_; |
79 | 80 |
80 // Only set on the IO thread. | 81 // Only set on the IO thread. |
81 IPC::Message::Sender* message_sender_; | 82 IPC::Message::Sender* message_sender_; |
82 | 83 |
(...skipping 20 matching lines...) Expand all Loading... |
103 | 104 |
104 // This is set once the Shutdown routine runs on the WebKit thread. Once | 105 // This is set once the Shutdown routine runs on the WebKit thread. Once |
105 // set, we should not process any more messages because storage_area_map_ | 106 // set, we should not process any more messages because storage_area_map_ |
106 // and storage_namespace_map_ contain pointers to deleted objects. | 107 // and storage_namespace_map_ contain pointers to deleted objects. |
107 bool shutdown_; | 108 bool shutdown_; |
108 | 109 |
109 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageDispatcherHost); | 110 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageDispatcherHost); |
110 }; | 111 }; |
111 | 112 |
112 #endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_DISPATCHER_HOST_H_ | 113 #endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_DISPATCHER_HOST_H_ |
OLD | NEW |