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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 m_state->setBoolean(DOMStorageAgentState::domStorageAgentEnabled, true); | 99 m_state->setBoolean(DOMStorageAgentState::domStorageAgentEnabled, true); |
100 m_instrumentingAgents->setInspectorDOMStorageAgent(this); | 100 m_instrumentingAgents->setInspectorDOMStorageAgent(this); |
101 } | 101 } |
102 | 102 |
103 void InspectorDOMStorageAgent::disable(ErrorString*) | 103 void InspectorDOMStorageAgent::disable(ErrorString*) |
104 { | 104 { |
105 m_instrumentingAgents->setInspectorDOMStorageAgent(0); | 105 m_instrumentingAgents->setInspectorDOMStorageAgent(0); |
106 m_state->setBoolean(DOMStorageAgentState::domStorageAgentEnabled, false); | 106 m_state->setBoolean(DOMStorageAgentState::domStorageAgentEnabled, false); |
107 } | 107 } |
108 | 108 |
| 109 void InspectorDOMStorageAgent::getDOMStorageItemValue(ErrorString* errorString,
const RefPtr<JSONObject>& storageId, const String& key, TypeBuilder::OptOutput<W
TF::String>* value) |
| 110 { |
| 111 Frame* frame; |
| 112 OwnPtr<StorageArea> storageArea = findStorageArea(errorString, storageId, fr
ame); |
| 113 if (!storageArea) |
| 114 return; |
| 115 |
| 116 ExceptionCode ec = 0; |
| 117 bool keyPresent = storageArea->contains(key, ec, frame); |
| 118 if (hadException(ec, errorString) || !keyPresent) |
| 119 return; |
| 120 |
| 121 *value = storageArea->getItem(key, ec, frame); |
| 122 hadException(ec, errorString); |
| 123 } |
| 124 |
109 void InspectorDOMStorageAgent::getDOMStorageItems(ErrorString* errorString, cons
t RefPtr<JSONObject>& storageId, RefPtr<TypeBuilder::Array<TypeBuilder::Array<St
ring> > >& items) | 125 void InspectorDOMStorageAgent::getDOMStorageItems(ErrorString* errorString, cons
t RefPtr<JSONObject>& storageId, RefPtr<TypeBuilder::Array<TypeBuilder::Array<St
ring> > >& items) |
110 { | 126 { |
111 Frame* frame; | 127 Frame* frame; |
112 OwnPtr<StorageArea> storageArea = findStorageArea(errorString, storageId, fr
ame); | 128 OwnPtr<StorageArea> storageArea = findStorageArea(errorString, storageId, fr
ame); |
113 if (!storageArea) | 129 if (!storageArea) |
114 return; | 130 return; |
115 | 131 |
116 RefPtr<TypeBuilder::Array<TypeBuilder::Array<String> > > storageItems = Type
Builder::Array<TypeBuilder::Array<String> >::create(); | 132 RefPtr<TypeBuilder::Array<TypeBuilder::Array<String> > > storageItems = Type
Builder::Array<TypeBuilder::Array<String> >::create(); |
117 | 133 |
118 ExceptionCode ec = 0; | 134 ExceptionCode ec = 0; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 } | 239 } |
224 targetFrame = frame; | 240 targetFrame = frame; |
225 | 241 |
226 if (isLocalStorage) | 242 if (isLocalStorage) |
227 return StorageNamespace::localStorageArea(frame->document()->securityOri
gin()); | 243 return StorageNamespace::localStorageArea(frame->document()->securityOri
gin()); |
228 return m_pageAgent->page()->sessionStorage()->storageArea(frame->document()-
>securityOrigin()); | 244 return m_pageAgent->page()->sessionStorage()->storageArea(frame->document()-
>securityOrigin()); |
229 } | 245 } |
230 | 246 |
231 } // namespace WebCore | 247 } // namespace WebCore |
232 | 248 |
OLD | NEW |