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

Side by Side Diff: Source/core/inspector/InspectorDOMStorageAgent.cpp

Issue 21163003: DevTools: Implement undo, redo operations for the DOMStorage views. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing after arv's changes for ExceptionState Created 7 years, 4 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
OLDNEW
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 m_state->setBoolean(DOMStorageAgentState::domStorageAgentEnabled, true); 100 m_state->setBoolean(DOMStorageAgentState::domStorageAgentEnabled, true);
101 m_instrumentingAgents->setInspectorDOMStorageAgent(this); 101 m_instrumentingAgents->setInspectorDOMStorageAgent(this);
102 } 102 }
103 103
104 void InspectorDOMStorageAgent::disable(ErrorString*) 104 void InspectorDOMStorageAgent::disable(ErrorString*)
105 { 105 {
106 m_instrumentingAgents->setInspectorDOMStorageAgent(0); 106 m_instrumentingAgents->setInspectorDOMStorageAgent(0);
107 m_state->setBoolean(DOMStorageAgentState::domStorageAgentEnabled, false); 107 m_state->setBoolean(DOMStorageAgentState::domStorageAgentEnabled, false);
108 } 108 }
109 109
110 void InspectorDOMStorageAgent::getValue(ErrorString* errorString, const RefPtr<J SONObject>& storageId, const String& key, TypeBuilder::OptOutput<WTF::String>* v alue)
111 {
112 Frame* frame;
113 OwnPtr<StorageArea> storageArea = findStorageArea(errorString, storageId, fr ame);
114 if (!storageArea)
115 return;
116
117 TrackExceptionState es;
118 bool keyPresent = storageArea->contains(key, es, frame);
119 if (hadException(es, errorString) || !keyPresent)
120 return;
121
122 *value = storageArea->getItem(key, es, frame);
123 hadException(es, errorString);
124 }
125
110 void InspectorDOMStorageAgent::getDOMStorageItems(ErrorString* errorString, cons t RefPtr<JSONObject>& storageId, RefPtr<TypeBuilder::Array<TypeBuilder::Array<St ring> > >& items) 126 void InspectorDOMStorageAgent::getDOMStorageItems(ErrorString* errorString, cons t RefPtr<JSONObject>& storageId, RefPtr<TypeBuilder::Array<TypeBuilder::Array<St ring> > >& items)
111 { 127 {
112 Frame* frame; 128 Frame* frame;
113 OwnPtr<StorageArea> storageArea = findStorageArea(errorString, storageId, fr ame); 129 OwnPtr<StorageArea> storageArea = findStorageArea(errorString, storageId, fr ame);
114 if (!storageArea) 130 if (!storageArea)
115 return; 131 return;
116 132
117 RefPtr<TypeBuilder::Array<TypeBuilder::Array<String> > > storageItems = Type Builder::Array<TypeBuilder::Array<String> >::create(); 133 RefPtr<TypeBuilder::Array<TypeBuilder::Array<String> > > storageItems = Type Builder::Array<TypeBuilder::Array<String> >::create();
118 134
119 TrackExceptionState es; 135 TrackExceptionState es;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 240 }
225 targetFrame = frame; 241 targetFrame = frame;
226 242
227 if (isLocalStorage) 243 if (isLocalStorage)
228 return StorageNamespace::localStorageArea(frame->document()->securityOri gin()); 244 return StorageNamespace::localStorageArea(frame->document()->securityOri gin());
229 return m_pageAgent->page()->sessionStorage()->storageArea(frame->document()- >securityOrigin()); 245 return m_pageAgent->page()->sessionStorage()->storageArea(frame->document()- >securityOrigin());
230 } 246 }
231 247
232 } // namespace WebCore 248 } // namespace WebCore
233 249
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorDOMStorageAgent.h ('k') | Source/devtools/front_end/DOMStorage.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698