Advertisement
Guest User

Untitled

a guest
Jan 29th, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 22.35 KB | None | 0 0
  1. Index: /home/user/workspace/chromium/src/third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispatcher.h
  2. ===================================================================
  3. --- /home/user/workspace/chromium/src/third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispatcher.h (revision 140854)
  4. +++ /home/user/workspace/chromium/src/third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispatcher.h (working copy)
  5. @@ -43,6 +43,7 @@
  6.  public:
  7.      // Dispatch a local storage event to appropiate documents.
  8.      WEBKIT_EXPORT static void dispatchLocalStorageEvent(
  9. +            int storageAction,
  10.              const WebString& key, const WebString& oldValue,
  11.              const WebString& newValue, const WebURL& origin,
  12.              const WebURL& pageUrl, WebStorageArea* sourceAreaInstance,
  13. @@ -50,6 +51,7 @@
  14.  
  15.      // Dispatch a session storage event to appropiate documents.
  16.      WEBKIT_EXPORT static void dispatchSessionStorageEvent(
  17. +            int storageAction,
  18.              const WebString& key, const WebString& oldValue,
  19.              const WebString& newValue, const WebURL& origin,
  20.              const WebURL& pageUrl, const WebStorageNamespace&,
  21. Index: /home/user/workspace/chromium/src/third_party/WebKit/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
  22. ===================================================================
  23. --- /home/user/workspace/chromium/src/third_party/WebKit/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp  (revision 140854)
  24. +++ /home/user/workspace/chromium/src/third_party/WebKit/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp  (working copy)
  25. @@ -41,6 +41,7 @@
  26.  namespace WebKit {
  27.  
  28.  void WebStorageEventDispatcher::dispatchLocalStorageEvent(
  29. +        int storageAction,
  30.          const WebString& key, const WebString& oldValue,
  31.          const WebString& newValue, const WebURL& origin,
  32.          const WebURL& pageURL, WebStorageArea* sourceAreaInstance,
  33. @@ -48,11 +49,12 @@
  34.  {
  35.      RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::create(origin);
  36.      WebCore::StorageAreaProxy::dispatchLocalStorageEvent(
  37. -            WebViewImpl::defaultPageGroup(), key, oldValue, newValue, securityOrigin.get(), pageURL,
  38. +            WebViewImpl::defaultPageGroup(), storageAction, key, oldValue, newValue, securityOrigin.get(), pageURL,
  39.              sourceAreaInstance, originatedInProcess);
  40.  }
  41.  
  42.  void WebStorageEventDispatcher::dispatchSessionStorageEvent(
  43. +        int storageAction,
  44.          const WebString& key, const WebString& oldValue,
  45.          const WebString& newValue, const WebURL& origin,
  46.          const WebURL& pageURL, const WebStorageNamespace& sessionNamespace,
  47. @@ -60,7 +62,7 @@
  48.  {
  49.      RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::create(origin);
  50.      WebCore::StorageAreaProxy::dispatchSessionStorageEvent(
  51. -            WebViewImpl::defaultPageGroup(), key, oldValue, newValue, securityOrigin.get(), pageURL,
  52. +            WebViewImpl::defaultPageGroup(), storageAction, key, oldValue, newValue, securityOrigin.get(), pageURL,
  53.              sessionNamespace, sourceAreaInstance, originatedInProcess);
  54.  }
  55.  
  56. Index: /home/user/workspace/chromium/src/third_party/WebKit/Source/WebKit/chromium/src/StorageAreaProxy.h
  57. ===================================================================
  58. --- /home/user/workspace/chromium/src/third_party/WebKit/Source/WebKit/chromium/src/StorageAreaProxy.h (revision 140854)
  59. +++ /home/user/workspace/chromium/src/third_party/WebKit/Source/WebKit/chromium/src/StorageAreaProxy.h (working copy)
  60. @@ -61,10 +61,10 @@
  61.      virtual size_t memoryBytesUsedByCache() const;
  62.  
  63.      static void dispatchLocalStorageEvent(
  64. -            PageGroup*, const String& key, const String& oldValue, const String& newValue,
  65. +            PageGroup*, int storageAction, const String& key, const String& oldValue, const String& newValue,
  66.              SecurityOrigin*, const KURL& pageURL, WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess);
  67.      static void dispatchSessionStorageEvent(
  68. -            PageGroup*, const String& key, const String& oldValue, const String& newValue,
  69. +            PageGroup*, int storageAction, const String& key, const String& oldValue, const String& newValue,
  70.              SecurityOrigin*, const KURL& pageURL, const WebKit::WebStorageNamespace&,
  71.              WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess);
  72.  
  73. Index: /home/user/workspace/chromium/src/third_party/WebKit/Source/WebKit/chromium/src/StorageAreaProxy.cpp
  74. ===================================================================
  75. --- /home/user/workspace/chromium/src/third_party/WebKit/Source/WebKit/chromium/src/StorageAreaProxy.cpp (revision 140854)
  76. +++ /home/user/workspace/chromium/src/third_party/WebKit/Source/WebKit/chromium/src/StorageAreaProxy.cpp (working copy)
  77. @@ -151,9 +151,21 @@
  78.      return m_storageArea->memoryBytesUsedByCache();
  79.  }
  80.  
  81. -void StorageAreaProxy::dispatchLocalStorageEvent(PageGroup* pageGroup, const String& key, const String& oldValue, const String& newValue,
  82. +void StorageAreaProxy::dispatchLocalStorageEvent(PageGroup* pageGroup, int action, const String& key, const String& oldValue, const String& newValue,
  83.                                                   SecurityOrigin* securityOrigin, const KURL& pageURL, WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess)
  84.  {
  85. +    String storageAction;
  86. +    switch(action) {
  87. +    case 0:
  88. +        storageAction = "ItemSet";
  89. +        break;
  90. +    case 1:
  91. +        storageAction = "ItemRemoved";
  92. +        break;
  93. +    case 2:
  94. +        storageAction = "ItemsCleared";
  95. +        break;
  96. +    }
  97.      const HashSet<Page*>& pages = pageGroup->pages();
  98.      for (HashSet<Page*>::const_iterator it = pages.begin(); it != pages.end(); ++it) {
  99.          for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
  100. @@ -161,7 +173,8 @@
  101.              if (storage && frame->document()->securityOrigin()->equal(securityOrigin) && !isEventSource(storage, sourceAreaInstance))
  102.                  frame->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, pageURL, storage));
  103.          }
  104. -        InspectorInstrumentation::didDispatchDOMStorageEvent(key, oldValue, newValue, LocalStorage, securityOrigin, *it);
  105. +
  106. +        InspectorInstrumentation::didDispatchDOMStorageEvent(storageAction, key, oldValue, newValue, LocalStorage, securityOrigin, *it);
  107.      }
  108.  }
  109.  
  110. @@ -177,7 +190,7 @@
  111.      return 0;
  112.  }
  113.  
  114. -void StorageAreaProxy::dispatchSessionStorageEvent(PageGroup* pageGroup, const String& key, const String& oldValue, const String& newValue,
  115. +void StorageAreaProxy::dispatchSessionStorageEvent(PageGroup* pageGroup, int action, const String& key, const String& oldValue, const String& newValue,
  116.                                                     SecurityOrigin* securityOrigin, const KURL& pageURL, const WebKit::WebStorageNamespace& sessionNamespace,
  117.                                                     WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess)
  118.  {
  119. @@ -185,12 +198,25 @@
  120.      if (!page)
  121.          return;
  122.  
  123. +    String storageAction;
  124. +    switch(action) {
  125. +    case 0:
  126. +        storageAction = "ItemSet";
  127. +        break;
  128. +    case 1:
  129. +        storageAction = "ItemRemoved";
  130. +        break;
  131. +    case 2:
  132. +        storageAction = "ItemsCleared";
  133. +        break;
  134. +    }
  135. +
  136.      for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
  137.          Storage* storage = frame->document()->domWindow()->optionalSessionStorage();
  138.          if (storage && frame->document()->securityOrigin()->equal(securityOrigin) && !isEventSource(storage, sourceAreaInstance))
  139.              frame->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, pageURL, storage));
  140.      }
  141. -    InspectorInstrumentation::didDispatchDOMStorageEvent(key, oldValue, newValue, SessionStorage, securityOrigin, page);
  142. +    InspectorInstrumentation::didDispatchDOMStorageEvent(storageAction, key, oldValue, newValue, SessionStorage, securityOrigin, page);
  143.  }
  144.  
  145.  bool StorageAreaProxy::isEventSource(Storage* storage, WebKit::WebStorageArea* sourceAreaInstance)
  146. Index: /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp
  147. ===================================================================
  148. --- /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp (revision 140854)
  149. +++ /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp (working copy)
  150. @@ -205,7 +205,7 @@
  151.          resource->bind(m_frontend);
  152.  }
  153.  
  154. -void InspectorDOMStorageAgent::didDispatchDOMStorageEvent(const String&, const String&, const String&, StorageType storageType, SecurityOrigin* securityOrigin, Page*)
  155. +void InspectorDOMStorageAgent::didDispatchDOMStorageEvent(const String& storageAction, const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin, Page*)
  156.  {
  157.      if (!m_frontend || !m_enabled)
  158.          return;
  159. @@ -215,7 +215,7 @@
  160.      if (id.isEmpty())
  161.          return;
  162.  
  163. -    m_frontend->domstorage()->domStorageUpdated(id);
  164. +    m_frontend->domstorage()->domStorageUpdated(id, storageAction, key, oldValue, newValue);
  165.  }
  166.  
  167.  void InspectorDOMStorageAgent::clearResources()
  168. Index: /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/InspectorDOMStorageAgent.h
  169. ===================================================================
  170. --- /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/InspectorDOMStorageAgent.h (revision 140854)
  171. +++ /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/InspectorDOMStorageAgent.h (working copy)
  172. @@ -76,7 +76,7 @@
  173.  
  174.      // Called from InspectorInstrumentation
  175.      void didUseDOMStorage(StorageArea*, bool isLocalStorage, Frame*);
  176. -    void didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
  177. +    void didDispatchDOMStorageEvent(const String& storageAction, const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
  178.  
  179.      virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
  180.  
  181. Index: /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/front-end/DOMStorage.js
  182. ===================================================================
  183. --- /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/front-end/DOMStorage.js  (revision 140854)
  184. +++ /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/front-end/DOMStorage.js  (working copy)
  185. @@ -166,8 +166,10 @@
  186.      /**
  187.       * @param {string} storageId
  188.       */
  189. -    domStorageUpdated: function(storageId)
  190. +    domStorageUpdated: function(storageId, storageAction, key, oldValue, newValue)
  191.      {
  192. +        var expression = "console.log(\""+storageAction+" " +key+" " + oldValue +" "+newValue +"\");";
  193. +        WebInspector.evaluateInConsole(expression, true);
  194.          this._model._domStorageUpdated(storageId);
  195.      }
  196.  }
  197. Index: /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/InspectorInstrumentation.cpp
  198. ===================================================================
  199. --- /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/InspectorInstrumentation.cpp (revision 140854)
  200. +++ /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/InspectorInstrumentation.cpp (working copy)
  201. @@ -1111,10 +1111,10 @@
  202.          domStorageAgent->didUseDOMStorage(storageArea, isLocalStorage, frame);
  203.  }
  204.  
  205. -void InspectorInstrumentation::didDispatchDOMStorageEventImpl(InstrumentingAgents* instrumentingAgents, const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin, Page* page)
  206. +void InspectorInstrumentation::didDispatchDOMStorageEventImpl(InstrumentingAgents* instrumentingAgents, const String& storageAction, const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin, Page* page)
  207.  {
  208.      if (InspectorDOMStorageAgent* domStorageAgent = instrumentingAgents->inspectorDOMStorageAgent())
  209. -        domStorageAgent->didDispatchDOMStorageEvent(key, oldValue, newValue, storageType, securityOrigin, page);
  210. +        domStorageAgent->didDispatchDOMStorageEvent(storageAction, key, oldValue, newValue, storageType, securityOrigin, page);
  211.  }
  212.  
  213.  #if ENABLE(WORKERS)
  214. Index: /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/Inspector.json
  215. ===================================================================
  216. --- /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/Inspector.json (revision 140854)
  217. +++ /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/Inspector.json (working copy)
  218. @@ -1473,7 +1473,11 @@
  219.              {
  220.                  "name": "domStorageUpdated",
  221.                  "parameters": [
  222. -                    { "name": "storageId",  "$ref": "StorageId" }
  223. +                    { "name": "storageId",  "$ref": "StorageId" },
  224. +                    { "name": "storageAction", "type": "string" },
  225. +                    { "name": "key", "type": "string" },
  226. +                    { "name": "oldValue", "type": "string" },
  227. +                    { "name": "newValue", "type": "string" }
  228.                  ]
  229.              }
  230.          ]
  231. Index: /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/InspectorInstrumentation.h
  232. ===================================================================
  233. --- /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/InspectorInstrumentation.h (revision 140854)
  234. +++ /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/inspector/InspectorInstrumentation.h (working copy)
  235. @@ -251,7 +251,7 @@
  236.  #endif
  237.  
  238.      static void didUseDOMStorage(Page*, StorageArea*, bool isLocalStorage, Frame*);
  239. -    static void didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
  240. +    static void didDispatchDOMStorageEvent(const String& storageAction, const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
  241.  
  242.  #if ENABLE(WORKERS)
  243.      static bool shouldPauseDedicatedWorkerOnStart(ScriptExecutionContext*);
  244. @@ -451,7 +451,7 @@
  245.  #endif
  246.  
  247.      static void didUseDOMStorageImpl(InstrumentingAgents*, StorageArea*, bool isLocalStorage, Frame*);
  248. -    static void didDispatchDOMStorageEventImpl(InstrumentingAgents*, const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
  249. +    static void didDispatchDOMStorageEventImpl(InstrumentingAgents*, const String& storageAction, const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
  250.  
  251.  #if ENABLE(WORKERS)
  252.      static bool shouldPauseDedicatedWorkerOnStartImpl(InstrumentingAgents*);
  253. @@ -1761,13 +1761,14 @@
  254.  #endif
  255.  }
  256.  
  257. -inline void InspectorInstrumentation::didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin, Page* page)
  258. +inline void InspectorInstrumentation::didDispatchDOMStorageEvent(const String& storageAction, const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin, Page* page)
  259.  {
  260.  #if ENABLE(INSPECTOR)
  261.      FAST_RETURN_IF_NO_FRONTENDS(void());
  262.      if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
  263. -        didDispatchDOMStorageEventImpl(instrumentingAgents, key, oldValue, newValue, storageType, securityOrigin, page);
  264. +        didDispatchDOMStorageEventImpl(instrumentingAgents, storageAction, key, oldValue, newValue, storageType, securityOrigin, page);
  265.  #else
  266. +    UNUSED_PARAM(storageAction);
  267.      UNUSED_PARAM(key);
  268.      UNUSED_PARAM(oldValue);
  269.      UNUSED_PARAM(newValue);
  270. Index: /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/storage/StorageAreaImpl.cpp
  271. ===================================================================
  272. --- /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/storage/StorageAreaImpl.cpp  (revision 140854)
  273. +++ /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/storage/StorageAreaImpl.cpp  (working copy)
  274. @@ -61,8 +61,8 @@
  275.      ASSERT(isMainThread());
  276.      ASSERT(m_securityOrigin);
  277.      ASSERT(m_storageMap);
  278. -    
  279. -    // Accessing the shared global StorageTracker when a StorageArea is created
  280. +
  281. +    // Accessing the shared global StorageTracker when a StorageArea is created
  282.      // ensures that the tracker is properly initialized before anyone actually needs to use it.
  283.      StorageTracker::tracker();
  284.  }
  285. @@ -199,7 +199,7 @@
  286.  
  287.      if (m_storageAreaSync)
  288.          m_storageAreaSync->scheduleItemForSync(key, value);
  289. -    StorageEventDispatcher::dispatch(key, oldValue, value, m_storageType, m_securityOrigin.get(), frame);
  290. +    StorageEventDispatcher::dispatch(StorageEventDispatcher::ItemSet, key, oldValue, value, m_storageType, m_securityOrigin.get(), frame);
  291.  }
  292.  
  293.  void StorageAreaImpl::removeItem(const String& key, ExceptionCode& ec, Frame* frame)
  294. @@ -226,7 +226,7 @@
  295.  
  296.      if (m_storageAreaSync)
  297.          m_storageAreaSync->scheduleItemForSync(key, String());
  298. -    StorageEventDispatcher::dispatch(key, oldValue, String(), m_storageType, m_securityOrigin.get(), frame);
  299. +    StorageEventDispatcher::dispatch(StorageEventDispatcher::ItemRemoved, key, oldValue, String(), m_storageType, m_securityOrigin.get(), frame);
  300.  }
  301.  
  302.  void StorageAreaImpl::clear(ExceptionCode& ec, Frame* frame)
  303. @@ -251,7 +251,7 @@
  304.  
  305.      if (m_storageAreaSync)
  306.          m_storageAreaSync->scheduleClear();
  307. -    StorageEventDispatcher::dispatch(String(), String(), String(), m_storageType, m_securityOrigin.get(), frame);
  308. +    StorageEventDispatcher::dispatch(StorageEventDispatcher::ItemsCleared, String(), String(), String(), m_storageType, m_securityOrigin.get(), frame);
  309.  }
  310.  
  311.  bool StorageAreaImpl::contains(const String& key, ExceptionCode& ec, Frame* frame) const
  312. @@ -290,7 +290,7 @@
  313.  {
  314.      ASSERT(!m_isShutdown);
  315.      blockUntilImportComplete();
  316. -    
  317. +
  318.      if (m_storageMap->length()) {
  319.          unsigned quota = m_storageMap->quota();
  320.          m_storageMap = StorageMap::create(quota);
  321. @@ -301,12 +301,12 @@
  322.          m_storageAreaSync->scheduleCloseDatabase();
  323.      }
  324.  }
  325. -    
  326. +
  327.  void StorageAreaImpl::sync()
  328.  {
  329.      ASSERT(!m_isShutdown);
  330.      blockUntilImportComplete();
  331. -    
  332. +
  333.      if (m_storageAreaSync)
  334.          m_storageAreaSync->scheduleSync();
  335.  }
  336. Index: /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/storage/StorageEventDispatcher.h
  337. ===================================================================
  338. --- /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/storage/StorageEventDispatcher.h (revision 140854)
  339. +++ /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/storage/StorageEventDispatcher.h (working copy)
  340. @@ -37,8 +37,15 @@
  341.  
  342.      class StorageEventDispatcher {
  343.      public:
  344. -        static void dispatch(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Frame* sourceFrame);
  345. +        typedef enum {
  346. +            ItemSet,
  347. +            ItemRemoved,
  348. +            ItemsCleared
  349.  
  350. +        } StorageAction;
  351. +
  352. +        static void dispatch(StorageEventDispatcher::StorageAction action, const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Frame* sourceFrame);
  353. +
  354.      private:
  355.          // Do not instantiate.
  356.          StorageEventDispatcher();
  357. Index: /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/storage/StorageEventDispatcher.cpp
  358. ===================================================================
  359. --- /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/storage/StorageEventDispatcher.cpp (revision 140854)
  360. +++ /home/user/workspace/chromium/src/third_party/WebKit/Source/WebCore/storage/StorageEventDispatcher.cpp (working copy)
  361. @@ -38,12 +38,25 @@
  362.  
  363.  namespace WebCore {
  364.  
  365. -void StorageEventDispatcher::dispatch(const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin, Frame* sourceFrame)
  366. +void StorageEventDispatcher::dispatch(StorageEventDispatcher::StorageAction action, const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin, Frame* sourceFrame)
  367.  {
  368.      Page* page = sourceFrame->page();
  369.      if (!page)
  370.          return;
  371.  
  372. +    String stoageAction;
  373. +    switch(action) {
  374. +    case ItemSet:
  375. +        storageAction = "ItemSet";
  376. +        break;
  377. +    case ItemRemoved:
  378. +        storageAction = "ItemRemoved";
  379. +        break;
  380. +    case ItemsCleared:
  381. +        storageAction = "ItemsCleared";
  382. +        break;
  383. +    }
  384. +
  385.      // We need to copy all relevant frames from every page to a vector since sending the event to one frame might mutate the frame tree
  386.      // of any given page in the group or mutate the page group itself.
  387.      Vector<RefPtr<Frame> > frames;
  388. @@ -53,7 +66,7 @@
  389.              if (sourceFrame != frame && frame->document()->securityOrigin()->equal(securityOrigin))
  390.                  frames.append(frame);
  391.          }
  392. -        InspectorInstrumentation::didDispatchDOMStorageEvent(key, oldValue, newValue, storageType, securityOrigin, page);
  393. +        InspectorInstrumentation::didDispatchDOMStorageEvent(storageAction, key, oldValue, newValue, storageType, securityOrigin, page);
  394.  
  395.          for (unsigned i = 0; i < frames.size(); ++i) {
  396.              ExceptionCode ec = 0;
  397. @@ -70,7 +83,7 @@
  398.                  if (sourceFrame != frame && frame->document()->securityOrigin()->equal(securityOrigin))
  399.                      frames.append(frame);
  400.              }
  401. -            InspectorInstrumentation::didDispatchDOMStorageEvent(key, oldValue, newValue, storageType, securityOrigin, *it);
  402. +            InspectorInstrumentation::didDispatchDOMStorageEvent(storageAction, key, oldValue, newValue, storageType, securityOrigin, *it);
  403.          }
  404.  
  405.          for (unsigned i = 0; i < frames.size(); ++i) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement