| 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/process.h" | 8 #include "base/process.h" |
| 9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "base/tracked.h" | 10 #include "base/tracked.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 void OnClear(int64 storage_area_id, const GURL& url); | 69 void OnClear(int64 storage_area_id, const GURL& url); |
| 70 | 70 |
| 71 // Only call on the IO thread. | 71 // Only call on the IO thread. |
| 72 void OnStorageEvent(const ViewMsg_DOMStorageEvent_Params& params); | 72 void OnStorageEvent(const ViewMsg_DOMStorageEvent_Params& params); |
| 73 | 73 |
| 74 // A shortcut for accessing our context. | 74 // A shortcut for accessing our context. |
| 75 DOMStorageContext* Context() { | 75 DOMStorageContext* Context() { |
| 76 return webkit_context_->dom_storage_context(); | 76 return webkit_context_->dom_storage_context(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 // Posts a task to the WebKit thread, initializing it if necessary. | |
| 80 void PostTaskToWebKitThread( | |
| 81 const tracked_objects::Location& from_here, Task* task); | |
| 82 | |
| 83 // Use whenever there's a chance OnStorageEvent will be called. | 79 // Use whenever there's a chance OnStorageEvent will be called. |
| 84 class ScopedStorageEventContext { | 80 class ScopedStorageEventContext { |
| 85 public: | 81 public: |
| 86 ScopedStorageEventContext(DOMStorageDispatcherHost* dispatcher_host, | 82 ScopedStorageEventContext(DOMStorageDispatcherHost* dispatcher_host, |
| 87 const GURL* url); | 83 const GURL* url); |
| 88 ~ScopedStorageEventContext(); | 84 ~ScopedStorageEventContext(); |
| 89 }; | 85 }; |
| 90 | 86 |
| 91 // Only access on the WebKit thread! Used for storage events. | 87 // Only access on the WebKit thread! Used for storage events. |
| 92 static DOMStorageDispatcherHost* storage_event_host_; | 88 static DOMStorageDispatcherHost* storage_event_host_; |
| 93 static const GURL* storage_event_url_; | 89 static const GURL* storage_event_url_; |
| 94 | 90 |
| 95 // Data shared between renderer processes with the same profile. | 91 // Data shared between renderer processes with the same profile. |
| 96 scoped_refptr<WebKitContext> webkit_context_; | 92 scoped_refptr<WebKitContext> webkit_context_; |
| 97 | 93 |
| 98 // ResourceDispatcherHost takes care of destruction. Immutable. | 94 // ResourceDispatcherHost takes care of destruction. Immutable. |
| 99 WebKitThread* webkit_thread_; | 95 WebKitThread* webkit_thread_; |
| 100 | 96 |
| 101 // Only set on the IO thread. | 97 // Only set on the IO thread. |
| 102 IPC::Message::Sender* message_sender_; | 98 IPC::Message::Sender* message_sender_; |
| 103 | 99 |
| 104 // If we get a corrupt message from a renderer, we need to kill it using this | 100 // If we get a corrupt message from a renderer, we need to kill it using this |
| 105 // handle. | 101 // handle. |
| 106 base::ProcessHandle process_handle_; | 102 base::ProcessHandle process_handle_; |
| 107 | 103 |
| 108 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageDispatcherHost); | 104 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageDispatcherHost); |
| 109 }; | 105 }; |
| 110 | 106 |
| 111 #endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_DISPATCHER_HOST_H_ | 107 #endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_DISPATCHER_HOST_H_ |
| OLD | NEW |