| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h" | 5 #include "chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h" |
| 6 | 6 |
| 7 #include "base/nullable_string16.h" | 7 #include "base/nullable_string16.h" |
| 8 #include "chrome/browser/browser_thread.h" | 8 #include "chrome/browser/browser_thread.h" |
| 9 #include "chrome/browser/in_process_webkit/dom_storage_area.h" | 9 #include "chrome/browser/in_process_webkit/dom_storage_area.h" |
| 10 #include "chrome/browser/in_process_webkit/dom_storage_context.h" | 10 #include "chrome/browser/in_process_webkit/dom_storage_context.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 } | 146 } |
| 147 | 147 |
| 148 void DOMStorageDispatcherHost::OnStorageAreaId(int64 namespace_id, | 148 void DOMStorageDispatcherHost::OnStorageAreaId(int64 namespace_id, |
| 149 const string16& origin, | 149 const string16& origin, |
| 150 IPC::Message* reply_msg) { | 150 IPC::Message* reply_msg) { |
| 151 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 151 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 152 ChromeURLRequestContext* url_request_context = | 152 ChromeURLRequestContext* url_request_context = |
| 153 resource_message_filter_->GetRequestContextForURL(GURL(origin)); | 153 resource_message_filter_->GetRequestContextForURL(GURL(origin)); |
| 154 BrowserThread::PostTask(BrowserThread::WEBKIT, FROM_HERE, NewRunnableMethod( | 154 BrowserThread::PostTask(BrowserThread::WEBKIT, FROM_HERE, NewRunnableMethod( |
| 155 this, &DOMStorageDispatcherHost::OnStorageAreaIdWebKit, namespace_id, | 155 this, &DOMStorageDispatcherHost::OnStorageAreaIdWebKit, namespace_id, |
| 156 origin, reply_msg, url_request_context->host_content_settings_map())); | 156 origin, reply_msg, |
| 157 make_scoped_refptr(url_request_context->host_content_settings_map()))); |
| 157 } | 158 } |
| 158 | 159 |
| 159 void DOMStorageDispatcherHost::OnStorageAreaIdWebKit( | 160 void DOMStorageDispatcherHost::OnStorageAreaIdWebKit( |
| 160 int64 namespace_id, const string16& origin, IPC::Message* reply_msg, | 161 int64 namespace_id, const string16& origin, IPC::Message* reply_msg, |
| 161 HostContentSettingsMap* host_content_settings_map) { | 162 HostContentSettingsMap* host_content_settings_map) { |
| 162 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); | 163 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
| 163 DOMStorageNamespace* storage_namespace = | 164 DOMStorageNamespace* storage_namespace = |
| 164 Context()->GetStorageNamespace(namespace_id, true); | 165 Context()->GetStorageNamespace(namespace_id, true); |
| 165 if (!storage_namespace) { | 166 if (!storage_namespace) { |
| 166 BrowserRenderProcessHost::BadMessageTerminateProcess( | 167 BrowserRenderProcessHost::BadMessageTerminateProcess( |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 const DOMStorageContext::DispatcherHostSet* set = | 332 const DOMStorageContext::DispatcherHostSet* set = |
| 332 Context()->GetDispatcherHostSet(); | 333 Context()->GetDispatcherHostSet(); |
| 333 DOMStorageContext::DispatcherHostSet::const_iterator cur = set->begin(); | 334 DOMStorageContext::DispatcherHostSet::const_iterator cur = set->begin(); |
| 334 while (cur != set->end()) { | 335 while (cur != set->end()) { |
| 335 // The renderer that generates the event handles it itself. | 336 // The renderer that generates the event handles it itself. |
| 336 if (*cur != this) | 337 if (*cur != this) |
| 337 (*cur)->Send(new ViewMsg_DOMStorageEvent(params)); | 338 (*cur)->Send(new ViewMsg_DOMStorageEvent(params)); |
| 338 ++cur; | 339 ++cur; |
| 339 } | 340 } |
| 340 } | 341 } |
| OLD | NEW |