Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(968)

Side by Side Diff: Source/web/StorageAreaProxy.cpp

Issue 24469004: Amusingly deprecate the generic version of 'ExceptionState::throwDOMException'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/SharedWorkerRepository.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All Rights Reserved. 2 * Copyright (C) 2009 Google Inc. All Rights Reserved.
3 * (C) 2008 Apple Inc. 3 * (C) 2008 Apple Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 void StorageAreaProxy::setItem(const String& key, const String& value, Exception State& es, Frame* frame) 93 void StorageAreaProxy::setItem(const String& key, const String& value, Exception State& es, Frame* frame)
94 { 94 {
95 if (!canAccessStorage(frame)) { 95 if (!canAccessStorage(frame)) {
96 es.throwSecurityError(ExceptionMessages::failedToExecute("setItem", "Sto rage", "access is denied for this document.")); 96 es.throwSecurityError(ExceptionMessages::failedToExecute("setItem", "Sto rage", "access is denied for this document."));
97 return; 97 return;
98 } 98 }
99 WebKit::WebStorageArea::Result result = WebKit::WebStorageArea::ResultOK; 99 WebKit::WebStorageArea::Result result = WebKit::WebStorageArea::ResultOK;
100 m_storageArea->setItem(key, value, frame->document()->url(), result); 100 m_storageArea->setItem(key, value, frame->document()->url(), result);
101 if (result != WebKit::WebStorageArea::ResultOK) 101 if (result != WebKit::WebStorageArea::ResultOK)
102 es.throwDOMException(QuotaExceededError); 102 es.throwUninformativeAndGenericDOMException(QuotaExceededError);
103 } 103 }
104 104
105 void StorageAreaProxy::removeItem(const String& key, ExceptionState& es, Frame* frame) 105 void StorageAreaProxy::removeItem(const String& key, ExceptionState& es, Frame* frame)
106 { 106 {
107 if (!canAccessStorage(frame)) { 107 if (!canAccessStorage(frame)) {
108 es.throwSecurityError(ExceptionMessages::failedToExecute("removeItem", " Storage", "access is denied for this document.")); 108 es.throwSecurityError(ExceptionMessages::failedToExecute("removeItem", " Storage", "access is denied for this document."));
109 return; 109 return;
110 } 110 }
111 m_storageArea->removeItem(key, frame->document()->url()); 111 m_storageArea->removeItem(key, frame->document()->url());
112 } 112 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 } 193 }
194 194
195 bool StorageAreaProxy::isEventSource(Storage* storage, WebKit::WebStorageArea* s ourceAreaInstance) 195 bool StorageAreaProxy::isEventSource(Storage* storage, WebKit::WebStorageArea* s ourceAreaInstance)
196 { 196 {
197 ASSERT(storage); 197 ASSERT(storage);
198 StorageAreaProxy* areaProxy = static_cast<StorageAreaProxy*>(storage->area() ); 198 StorageAreaProxy* areaProxy = static_cast<StorageAreaProxy*>(storage->area() );
199 return areaProxy->m_storageArea == sourceAreaInstance; 199 return areaProxy->m_storageArea == sourceAreaInstance;
200 } 200 }
201 201
202 } // namespace WebCore 202 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/web/SharedWorkerRepository.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698