| 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/chrome_thread.h" | 8 #include "chrome/browser/chrome_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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 else | 144 else |
| 145 resource_message_filter_->Send(message); | 145 resource_message_filter_->Send(message); |
| 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(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 151 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::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 ChromeThread::PostTask(ChromeThread::WEBKIT, FROM_HERE, NewRunnableMethod( | 154 ChromeThread::PostTask( |
| 155 this, &DOMStorageDispatcherHost::OnStorageAreaIdWebKit, namespace_id, | 155 ChromeThread::WEBKIT, |
| 156 origin, reply_msg, url_request_context->host_content_settings_map())); | 156 FROM_HERE, |
| 157 NewRunnableMethod( |
| 158 this, |
| 159 &DOMStorageDispatcherHost::OnStorageAreaIdWebKit, |
| 160 namespace_id, |
| 161 origin, |
| 162 reply_msg, |
| 163 make_scoped_refptr( |
| 164 url_request_context->host_content_settings_map()))); |
| 157 } | 165 } |
| 158 | 166 |
| 159 void DOMStorageDispatcherHost::OnStorageAreaIdWebKit( | 167 void DOMStorageDispatcherHost::OnStorageAreaIdWebKit( |
| 160 int64 namespace_id, const string16& origin, IPC::Message* reply_msg, | 168 int64 namespace_id, const string16& origin, IPC::Message* reply_msg, |
| 161 HostContentSettingsMap* host_content_settings_map) { | 169 HostContentSettingsMap* host_content_settings_map) { |
| 162 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); | 170 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); |
| 163 DOMStorageNamespace* storage_namespace = | 171 DOMStorageNamespace* storage_namespace = |
| 164 Context()->GetStorageNamespace(namespace_id, true); | 172 Context()->GetStorageNamespace(namespace_id, true); |
| 165 if (!storage_namespace) { | 173 if (!storage_namespace) { |
| 166 BrowserRenderProcessHost::BadMessageTerminateProcess( | 174 BrowserRenderProcessHost::BadMessageTerminateProcess( |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 const DOMStorageContext::DispatcherHostSet* set = | 339 const DOMStorageContext::DispatcherHostSet* set = |
| 332 Context()->GetDispatcherHostSet(); | 340 Context()->GetDispatcherHostSet(); |
| 333 DOMStorageContext::DispatcherHostSet::const_iterator cur = set->begin(); | 341 DOMStorageContext::DispatcherHostSet::const_iterator cur = set->begin(); |
| 334 while (cur != set->end()) { | 342 while (cur != set->end()) { |
| 335 // The renderer that generates the event handles it itself. | 343 // The renderer that generates the event handles it itself. |
| 336 if (*cur != this) | 344 if (*cur != this) |
| 337 (*cur)->Send(new ViewMsg_DOMStorageEvent(params)); | 345 (*cur)->Send(new ViewMsg_DOMStorageEvent(params)); |
| 338 ++cur; | 346 ++cur; |
| 339 } | 347 } |
| 340 } | 348 } |
| OLD | NEW |