Index: content/browser/in_process_webkit/dom_storage_message_filter.cc |
diff --git a/content/browser/in_process_webkit/dom_storage_message_filter.cc b/content/browser/in_process_webkit/dom_storage_message_filter.cc |
index 52a3c0e7dcad98e8b8c50143b90c8372eb596cfb..fff8fab40774747fa7dd9b72d90c550b648027a1 100644 |
--- a/content/browser/in_process_webkit/dom_storage_message_filter.cc |
+++ b/content/browser/in_process_webkit/dom_storage_message_filter.cc |
@@ -10,6 +10,8 @@ |
#include "content/browser/in_process_webkit/dom_storage_context.h" |
#include "content/browser/in_process_webkit/dom_storage_namespace.h" |
#include "content/common/dom_storage_messages.h" |
+#include "content/public/browser/notification_service.h" |
+#include "content/public/browser/notification_types.h" |
#include "content/public/browser/browser_thread.h" |
#include "googleurl/src/gurl.h" |
@@ -109,16 +111,38 @@ void DOMStorageMessageFilter::OverrideThreadForMessage( |
*thread = BrowserThread::WEBKIT; |
} |
+void DOMStorageMessageFilter::NotifyOnUIThread( |
+ int64 namespace_id, |
+ const FilePath& session_storage_directory) { |
+ DOMStorageNamespaceCreatedDetails details; |
+ details.id = namespace_id; |
+ details.session_storage_directory = session_storage_directory; |
+ content::NotificationService::current()->Notify( |
+ content::NOTIFICATION_DOM_STORAGE_NAMESPACE_CREATED, |
+ content::Source<DOMStorageMessageFilter>(this), |
+ content::Details<DOMStorageNamespaceCreatedDetails>(&details)); |
+} |
+ |
void DOMStorageMessageFilter::OnStorageAreaId(int64 namespace_id, |
const string16& origin, |
int64* storage_area_id) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
DOMStorageNamespace* storage_namespace = |
- Context()->GetStorageNamespace(namespace_id, true); |
+ Context()->GetStorageNamespace(namespace_id, false); |
if (!storage_namespace) { |
- *storage_area_id = DOMStorageContext::kInvalidStorageId; |
- return; |
+ storage_namespace = |
+ Context()->GetStorageNamespace(namespace_id, true); |
+ if (!storage_namespace) { |
+ *storage_area_id = DOMStorageContext::kInvalidStorageId; |
+ return; |
+ } |
+ |
+ BrowserThread::PostTask( |
+ BrowserThread::UI, FROM_HERE, |
+ base::Bind(&DOMStorageMessageFilter::NotifyOnUIThread, this, |
michaeln
2011/12/13 20:40:03
Is the intent to only send this notification for s
marja
2012/01/11 15:17:53
Fixed this.
|
+ namespace_id, |
+ storage_namespace->session_storage_directory())); |
} |
DOMStorageArea* storage_area = storage_namespace->GetStorageArea(origin); |
*storage_area_id = storage_area->id(); |