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