OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_IN_PROCESS_WEBKIT_DOM_STORAGE_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_MESSAGE_FILTER_H_ |
6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_MESSAGE_FILTER_H_ | 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_MESSAGE_FILTER_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 "base/message_loop_helpers.h" |
10 #include "base/process.h" | 11 #include "base/process.h" |
11 #include "content/browser/in_process_webkit/dom_storage_area.h" | 12 #include "content/browser/in_process_webkit/dom_storage_area.h" |
12 #include "content/browser/in_process_webkit/webkit_context.h" | 13 #include "content/browser/in_process_webkit/webkit_context.h" |
13 #include "content/common/dom_storage_common.h" | 14 #include "content/common/dom_storage_common.h" |
14 #include "content/public/browser/browser_message_filter.h" | 15 #include "content/public/browser/browser_message_filter.h" |
15 | 16 |
16 class DOMStorageContext; | 17 class DOMStorageContext; |
17 class GURL; | 18 class GURL; |
18 struct DOMStorageMsg_Event_Params; | 19 struct DOMStorageMsg_Event_Params; |
19 | 20 |
(...skipping 14 matching lines...) Expand all Loading... |
34 bool* message_was_ok) OVERRIDE; | 35 bool* message_was_ok) OVERRIDE; |
35 virtual void OnDestruct() const OVERRIDE; | 36 virtual void OnDestruct() const OVERRIDE; |
36 | 37 |
37 // Only call on the WebKit thread. | 38 // Only call on the WebKit thread. |
38 static void DispatchStorageEvent(const NullableString16& key, | 39 static void DispatchStorageEvent(const NullableString16& key, |
39 const NullableString16& old_value, const NullableString16& new_value, | 40 const NullableString16& old_value, const NullableString16& new_value, |
40 const string16& origin, const GURL& url, bool is_local_storage); | 41 const string16& origin, const GURL& url, bool is_local_storage); |
41 | 42 |
42 private: | 43 private: |
43 friend class content::BrowserThread; | 44 friend class content::BrowserThread; |
44 friend class DeleteTask<DOMStorageMessageFilter>; | 45 friend class base::DeleteHelper<DOMStorageMessageFilter>; |
45 virtual ~DOMStorageMessageFilter(); | 46 virtual ~DOMStorageMessageFilter(); |
46 | 47 |
47 // Message Handlers. | 48 // Message Handlers. |
48 void OnStorageAreaId(int64 namespace_id, const string16& origin, | 49 void OnStorageAreaId(int64 namespace_id, const string16& origin, |
49 int64* storage_area_id); | 50 int64* storage_area_id); |
50 void OnLength(int64 storage_area_id, unsigned* length); | 51 void OnLength(int64 storage_area_id, unsigned* length); |
51 void OnKey(int64 storage_area_id, unsigned index, NullableString16* key); | 52 void OnKey(int64 storage_area_id, unsigned index, NullableString16* key); |
52 void OnGetItem(int64 storage_area_id, const string16& key, | 53 void OnGetItem(int64 storage_area_id, const string16& key, |
53 NullableString16* value); | 54 NullableString16* value); |
54 void OnSetItem(int64 storage_area_id, const string16& key, | 55 void OnSetItem(int64 storage_area_id, const string16& key, |
(...skipping 28 matching lines...) Expand all Loading... |
83 // Data shared between renderer processes with the same browser context. | 84 // Data shared between renderer processes with the same browser context. |
84 scoped_refptr<WebKitContext> webkit_context_; | 85 scoped_refptr<WebKitContext> webkit_context_; |
85 | 86 |
86 // Used to dispatch messages to the correct view host. | 87 // Used to dispatch messages to the correct view host. |
87 int process_id_; | 88 int process_id_; |
88 | 89 |
89 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageMessageFilter); | 90 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageMessageFilter); |
90 }; | 91 }; |
91 | 92 |
92 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_MESSAGE_FILTER_H_ | 93 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_MESSAGE_FILTER_H_ |
OLD | NEW |