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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 return; | 257 return; |
258 } | 258 } |
259 | 259 |
260 ScopedStorageEventContext scope(this, &url); | 260 ScopedStorageEventContext scope(this, &url); |
261 WebStorageArea::Result result; | 261 WebStorageArea::Result result; |
262 NullableString16 old_value = storage_area->SetItem(key, value, &result, this); | 262 NullableString16 old_value = storage_area->SetItem(key, value, &result, this); |
263 | 263 |
264 // If content was blocked, tell the UI to display the blocked content icon. | 264 // If content was blocked, tell the UI to display the blocked content icon. |
265 if (reply_msg->routing_id() == MSG_ROUTING_CONTROL) { | 265 if (reply_msg->routing_id() == MSG_ROUTING_CONTROL) { |
266 DLOG(WARNING) << "setItem was not given a proper routing id"; | 266 DLOG(WARNING) << "setItem was not given a proper routing id"; |
267 } else if (result == WebKit::WebStorageArea::ResultBlockedByPolicy) { | 267 } else { |
268 CallRenderViewHostContentSettingsDelegate( | 268 CallRenderViewHostContentSettingsDelegate( |
269 process_id_, reply_msg->routing_id(), | 269 process_id_, reply_msg->routing_id(), |
270 &RenderViewHostDelegate::ContentSettings::OnContentBlocked, | 270 &RenderViewHostDelegate::ContentSettings::OnLocalStorageAccessed, |
271 CONTENT_SETTINGS_TYPE_COOKIES); | 271 url, result == WebStorageArea::ResultBlockedByPolicy); |
272 } | 272 } |
273 | 273 |
274 ViewHostMsg_DOMStorageSetItem::WriteReplyParams(reply_msg, result, old_value); | 274 ViewHostMsg_DOMStorageSetItem::WriteReplyParams(reply_msg, result, old_value); |
275 Send(reply_msg); | 275 Send(reply_msg); |
276 } | 276 } |
277 | 277 |
278 void DOMStorageDispatcherHost::OnRemoveItem( | 278 void DOMStorageDispatcherHost::OnRemoveItem( |
279 int64 storage_area_id, const string16& key, const GURL& url, | 279 int64 storage_area_id, const string16& key, const GURL& url, |
280 IPC::Message* reply_msg) { | 280 IPC::Message* reply_msg) { |
281 if (ChromeThread::CurrentlyOn(ChromeThread::IO)) { | 281 if (ChromeThread::CurrentlyOn(ChromeThread::IO)) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 const DOMStorageContext::DispatcherHostSet* set = | 328 const DOMStorageContext::DispatcherHostSet* set = |
329 Context()->GetDispatcherHostSet(); | 329 Context()->GetDispatcherHostSet(); |
330 DOMStorageContext::DispatcherHostSet::const_iterator cur = set->begin(); | 330 DOMStorageContext::DispatcherHostSet::const_iterator cur = set->begin(); |
331 while (cur != set->end()) { | 331 while (cur != set->end()) { |
332 // The renderer that generates the event handles it itself. | 332 // The renderer that generates the event handles it itself. |
333 if (*cur != this) | 333 if (*cur != this) |
334 (*cur)->Send(new ViewMsg_DOMStorageEvent(params)); | 334 (*cur)->Send(new ViewMsg_DOMStorageEvent(params)); |
335 ++cur; | 335 ++cur; |
336 } | 336 } |
337 } | 337 } |
OLD | NEW |