Changeset 113213 in webkit
- Timestamp:
- Apr 4, 2012 10:43:27 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r113208 r113213 1 2012-04-04 Peter Rybin <peter.rybin@gmail.com> 2 3 Web Inspector: CodeGeneratorInspector.py: switch IndexedDB, DOMStorage, ApplicationCache domains to typed API 4 https://bugs.webkit.org/show_bug.cgi?id=83039 5 6 Reviewed by Pavel Feldman. 7 8 Client code is switched to typed API (all InspectorObject and InspectorArray types are 9 replaced with generated types from TypeBuilder according to Inspector.json). 10 11 Missing array of array specialization is added. Inspector.json is fixed to comform 12 with actual behavior of InspectorDOMStorageAgent. 13 14 Output parameter initialization is assured. 15 16 * inspector/CodeGeneratorInspector.py: 17 * inspector/Inspector.json: 18 * inspector/InspectorApplicationCacheAgent.cpp: 19 (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests): 20 (WebCore::InspectorApplicationCacheAgent::getApplicationCacheForFrame): 21 (WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCache): 22 * inspector/InspectorApplicationCacheAgent.h: 23 (InspectorApplicationCacheAgent): 24 * inspector/InspectorDOMStorageAgent.cpp: 25 (WebCore::InspectorDOMStorageAgent::getDOMStorageEntries): 26 (WebCore::InspectorDOMStorageAgent::setDOMStorageItem): 27 (WebCore::InspectorDOMStorageAgent::removeDOMStorageItem): 28 * inspector/InspectorDOMStorageAgent.h: 29 (InspectorDOMStorageAgent): 30 * inspector/InspectorDOMStorageResource.cpp: 31 (WebCore::InspectorDOMStorageResource::bind): 32 1 33 2012-04-04 Tony Chang <tony@chromium.org> 2 34 -
trunk/Source/WebCore/inspector/CodeGeneratorInspector.py
r113157 r113213 62 62 STRICT_ENABLED_DOMAINS = ["Console", "DOMDebugger", 63 63 "CSS", "Debugger", "DOM", "Network", "Page", "Runtime", 64 "Inspector", "Memory", "Database"] 64 "Inspector", "Memory", "Database", 65 "IndexedDB", "DOMStorage", "ApplicationCache"] 65 66 66 67 … … 2289 2290 }; 2290 2291 2292 template<typename T> 2293 struct ArrayItemHelper<TypeBuilder::Array<T> > { 2294 struct Traits { 2295 static void pushRefPtr(InspectorArray* array, PassRefPtr<TypeBuilder::Array<T> > value) 2296 { 2297 array->pushArray(value); 2298 } 2299 }; 2300 }; 2301 2291 2302 ${forwards} 2292 2303 -
trunk/Source/WebCore/inspector/Inspector.json
r113013 r113213 1132 1132 { "name": "id", "$ref": "StorageId", "description": "Entry id for further reference." } 1133 1133 ] 1134 }, 1135 { 1136 "id": "Item", 1137 "type": "array", 1138 "description": "DOM Storage item.", 1139 "hidden": true, 1140 "items": { "type": "string" } 1134 1141 } 1135 1142 ], … … 1149 1156 ], 1150 1157 "returns": [ 1151 { "name": "entries", "type": "array", "items": { "$ref": " Entry"} }1158 { "name": "entries", "type": "array", "items": { "$ref": "Item" } } 1152 1159 ] 1153 1160 }, -
trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp
r110854 r113213 105 105 } 106 106 107 void InspectorApplicationCacheAgent::getFramesWithManifests(ErrorString*, RefPtr< InspectorArray>& result)108 { 109 result = InspectorArray::create();107 void InspectorApplicationCacheAgent::getFramesWithManifests(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::ApplicationCache::FrameWithManifest> >& result) 108 { 109 result = TypeBuilder::Array<TypeBuilder::ApplicationCache::FrameWithManifest>::create(); 110 110 111 111 Frame* mainFrame = m_pageAgent->mainFrame(); … … 119 119 String manifestURL = info.m_manifest.string(); 120 120 if (!manifestURL.isEmpty()) { 121 RefPtr< InspectorObject> value = InspectorObject::create();122 value->setString("frameId", m_pageAgent->frameId(frame));123 value->setString("manifestURL", manifestURL);124 value->setNumber("status",host->status());125 result-> pushObject(value);121 RefPtr<TypeBuilder::ApplicationCache::FrameWithManifest> value = TypeBuilder::ApplicationCache::FrameWithManifest::create() 122 .setFrameId(m_pageAgent->frameId(frame)) 123 .setManifestURL(manifestURL) 124 .setStatus(host->status()); 125 result->addItem(value); 126 126 } 127 127 } … … 147 147 } 148 148 149 void InspectorApplicationCacheAgent::getApplicationCacheForFrame(ErrorString* errorString, const String& frameId, RefPtr< InspectorObject>& applicationCache)149 void InspectorApplicationCacheAgent::getApplicationCacheForFrame(ErrorString* errorString, const String& frameId, RefPtr<TypeBuilder::ApplicationCache::ApplicationCache>& applicationCache) 150 150 { 151 151 DocumentLoader* documentLoader = assertFrameWithDocumentLoader(errorString, frameId); … … 162 162 } 163 163 164 PassRefPtr<InspectorObject> InspectorApplicationCacheAgent::buildObjectForApplicationCache(const ApplicationCacheHost::ResourceInfoList& applicationCacheResources, const ApplicationCacheHost::CacheInfo& applicationCacheInfo) 165 { 166 RefPtr<InspectorObject> value = InspectorObject::create(); 167 value->setNumber("size", applicationCacheInfo.m_size); 168 value->setString("manifestURL", applicationCacheInfo.m_manifest.string()); 169 value->setNumber("creationTime", applicationCacheInfo.m_creationTime); 170 value->setNumber("updateTime", applicationCacheInfo.m_updateTime); 171 value->setArray("resources", buildArrayForApplicationCacheResources(applicationCacheResources)); 172 return value; 164 PassRefPtr<TypeBuilder::ApplicationCache::ApplicationCache> InspectorApplicationCacheAgent::buildObjectForApplicationCache(const ApplicationCacheHost::ResourceInfoList& applicationCacheResources, const ApplicationCacheHost::CacheInfo& applicationCacheInfo) 165 { 166 return TypeBuilder::ApplicationCache::ApplicationCache::create() 167 .setManifestURL(applicationCacheInfo.m_manifest.string()) 168 .setSize(applicationCacheInfo.m_size) 169 .setCreationTime(applicationCacheInfo.m_creationTime) 170 .setUpdateTime(applicationCacheInfo.m_updateTime) 171 .setResources(buildArrayForApplicationCacheResources(applicationCacheResources)); 173 172 } 174 173 -
trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.h
r106777 r113213 70 70 // ApplicationCache API for InspectorFrontend 71 71 virtual void enable(ErrorString*); 72 virtual void getFramesWithManifests(ErrorString*, RefPtr< InspectorArray>& result);72 virtual void getFramesWithManifests(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::ApplicationCache::FrameWithManifest> >& result); 73 73 virtual void getManifestForFrame(ErrorString*, const String& frameId, String* manifestURL); 74 virtual void getApplicationCacheForFrame(ErrorString*, const String& frameId, RefPtr< InspectorObject>& applicationCache);74 virtual void getApplicationCacheForFrame(ErrorString*, const String& frameId, RefPtr<TypeBuilder::ApplicationCache::ApplicationCache>&); 75 75 76 76 private: 77 77 InspectorApplicationCacheAgent(InstrumentingAgents*, InspectorState*, InspectorPageAgent*); 78 PassRefPtr< InspectorObject> buildObjectForApplicationCache(const ApplicationCacheHost::ResourceInfoList&, const ApplicationCacheHost::CacheInfo&);78 PassRefPtr<TypeBuilder::ApplicationCache::ApplicationCache> buildObjectForApplicationCache(const ApplicationCacheHost::ResourceInfoList&, const ApplicationCacheHost::CacheInfo&); 79 79 PassRefPtr<InspectorArray> buildArrayForApplicationCacheResources(const ApplicationCacheHost::ResourceInfoList&); 80 80 PassRefPtr<InspectorObject> buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo&); -
trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp
r113013 r113213 109 109 } 110 110 111 void InspectorDOMStorageAgent::getDOMStorageEntries(ErrorString*, const String& storageId, RefPtr<InspectorArray>& entries) 112 { 111 void InspectorDOMStorageAgent::getDOMStorageEntries(ErrorString*, const String& storageId, RefPtr<TypeBuilder::Array<TypeBuilder::Array<String> > >& entries) 112 { 113 // FIXME: consider initializing this array after 2 checks below. The checks should return error messages in this case. 114 entries = TypeBuilder::Array<TypeBuilder::Array<String> >::create(); 115 113 116 InspectorDOMStorageResource* storageResource = getDOMStorageResourceForId(storageId); 114 117 if (!storageResource) … … 123 126 String name(storageArea->key(i, frame)); 124 127 String value(storageArea->getItem(name, frame)); 125 RefPtr< InspectorArray> entry = InspectorArray::create();126 entry-> pushString(name);127 entry-> pushString(value);128 entries-> pushArray(entry);128 RefPtr<TypeBuilder::Array<String> > entry = TypeBuilder::Array<String>::create(); 129 entry->addItem(name); 130 entry->addItem(value); 131 entries->addItem(entry); 129 132 } 130 133 } … … 137 140 storageResource->storageArea()->setItem(key, value, exception, storageResource->frame()); 138 141 *success = !exception; 139 } 142 } else 143 *success = false; 140 144 } 141 145 … … 146 150 storageResource->storageArea()->removeItem(key, storageResource->frame()); 147 151 *success = true; 148 } 152 } else 153 *success = false; 149 154 } 150 155 -
trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.h
r113013 r113213 65 65 virtual void enable(ErrorString*); 66 66 virtual void disable(ErrorString*); 67 virtual void getDOMStorageEntries(ErrorString*, const String& storageId, RefPtr< InspectorArray>& entries);67 virtual void getDOMStorageEntries(ErrorString*, const String& storageId, RefPtr<TypeBuilder::Array<TypeBuilder::Array<String> > >& entries); 68 68 virtual void setDOMStorageItem(ErrorString*, const String& storageId, const String& key, const String& value, bool* success); 69 69 virtual void removeDOMStorageItem(ErrorString*, const String& storageId, const String& key, bool* success); -
trunk/Source/WebCore/inspector/InspectorDOMStorageResource.cpp
r113013 r113213 73 73 m_frontend = frontend->domstorage(); 74 74 75 RefPtr< InspectorObject> jsonObject = InspectorObject::create();76 jsonObject->setString("host", m_frame->document()->securityOrigin()->host());77 jsonObject->setBoolean("isLocalStorage", m_isLocalStorage);78 jsonObject->setString("id",m_id);75 RefPtr<TypeBuilder::DOMStorage::Entry> jsonObject = TypeBuilder::DOMStorage::Entry::create() 76 .setHost(m_frame->document()->securityOrigin()->host()) 77 .setIsLocalStorage(m_isLocalStorage) 78 .setId(m_id); 79 79 m_frontend->addDOMStorage(jsonObject); 80 80 }
Note: See TracChangeset
for help on using the changeset viewer.