| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
| 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 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 PassOwnPtrWillBeRawPtr<StorageArea> InspectorDOMStorageAgent::findStorageArea(Er
rorString* errorString, const RefPtr<JSONObject>& storageId, Frame*& targetFrame
) | 194 PassOwnPtrWillBeRawPtr<StorageArea> InspectorDOMStorageAgent::findStorageArea(Er
rorString* errorString, const RefPtr<JSONObject>& storageId, Frame*& targetFrame
) |
| 195 { | 195 { |
| 196 String securityOrigin; | 196 String securityOrigin; |
| 197 bool isLocalStorage = false; | 197 bool isLocalStorage = false; |
| 198 bool success = storageId->getString("securityOrigin", &securityOrigin); | 198 bool success = storageId->getString("securityOrigin", &securityOrigin); |
| 199 if (success) | 199 if (success) |
| 200 success = storageId->getBoolean("isLocalStorage", &isLocalStorage); | 200 success = storageId->getBoolean("isLocalStorage", &isLocalStorage); |
| 201 if (!success) { | 201 if (!success) { |
| 202 if (errorString) | 202 if (errorString) |
| 203 *errorString = "Invalid storageId format"; | 203 *errorString = "Invalid storageId format"; |
| 204 return nullptr; | 204 return 0; |
| 205 } | 205 } |
| 206 | 206 |
| 207 Frame* frame = m_pageAgent->findFrameWithSecurityOrigin(securityOrigin); | 207 Frame* frame = m_pageAgent->findFrameWithSecurityOrigin(securityOrigin); |
| 208 if (!frame) { | 208 if (!frame) { |
| 209 if (errorString) | 209 if (errorString) |
| 210 *errorString = "Frame not found for the given security origin"; | 210 *errorString = "Frame not found for the given security origin"; |
| 211 return nullptr; | 211 return 0; |
| 212 } | 212 } |
| 213 targetFrame = frame; | 213 targetFrame = frame; |
| 214 | 214 |
| 215 if (isLocalStorage) | 215 if (isLocalStorage) |
| 216 return StorageNamespace::localStorageArea(frame->document()->securityOri
gin()); | 216 return StorageNamespace::localStorageArea(frame->document()->securityOri
gin()); |
| 217 return m_pageAgent->page()->sessionStorage()->storageArea(frame->document()-
>securityOrigin()); | 217 return m_pageAgent->page()->sessionStorage()->storageArea(frame->document()-
>securityOrigin()); |
| 218 } | 218 } |
| 219 | 219 |
| 220 } // namespace WebCore | 220 } // namespace WebCore |
| 221 | 221 |
| OLD | NEW |