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

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

Issue 319043004: DevTools: Remove InspectorDOMAgent::m_idToNodesMap entries correctly. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 return id; 339 return id;
340 } 340 }
341 341
342 void InspectorDOMAgent::unbind(Node* node, NodeToIdMap* nodesMap) 342 void InspectorDOMAgent::unbind(Node* node, NodeToIdMap* nodesMap)
343 { 343 {
344 int id = nodesMap->get(node); 344 int id = nodesMap->get(node);
345 if (!id) 345 if (!id)
346 return; 346 return;
347 347
348 m_idToNode.remove(id); 348 m_idToNode.remove(id);
349 m_idToNodesMap.remove(id);
349 350
350 if (node->isFrameOwnerElement()) { 351 if (node->isFrameOwnerElement()) {
351 Document* contentDocument = toHTMLFrameOwnerElement(node)->contentDocume nt(); 352 Document* contentDocument = toHTMLFrameOwnerElement(node)->contentDocume nt();
352 if (m_domListener) 353 if (m_domListener)
353 m_domListener->didRemoveDocument(contentDocument); 354 m_domListener->didRemoveDocument(contentDocument);
354 if (contentDocument) 355 if (contentDocument)
355 unbind(contentDocument, nodesMap); 356 unbind(contentDocument, nodesMap);
356 } 357 }
357 358
358 for (ShadowRoot* root = node->youngestShadowRoot(); root; root = root->older ShadowRoot()) 359 for (ShadowRoot* root = node->youngestShadowRoot(); root; root = root->older ShadowRoot())
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 m_frontend->setChildNodes(nodeId, children.release()); 551 m_frontend->setChildNodes(nodeId, children.release());
551 } 552 }
552 553
553 void InspectorDOMAgent::discardFrontendBindings() 554 void InspectorDOMAgent::discardFrontendBindings()
554 { 555 {
555 if (m_history) 556 if (m_history)
556 m_history->reset(); 557 m_history->reset();
557 m_searchResults.clear(); 558 m_searchResults.clear();
558 m_documentNodeToIdMap.clear(); 559 m_documentNodeToIdMap.clear();
559 m_idToNode.clear(); 560 m_idToNode.clear();
561 m_idToNodesMap.clear();
560 releaseDanglingNodes(); 562 releaseDanglingNodes();
561 m_childrenRequested.clear(); 563 m_childrenRequested.clear();
562 m_cachedChildCount.clear(); 564 m_cachedChildCount.clear();
563 if (m_revalidateStyleAttrTask) 565 if (m_revalidateStyleAttrTask)
564 m_revalidateStyleAttrTask->reset(); 566 m_revalidateStyleAttrTask->reset();
565 } 567 }
566 568
567 Node* InspectorDOMAgent::nodeForId(int id) 569 Node* InspectorDOMAgent::nodeForId(int id)
568 { 570 {
569 if (!id) 571 if (!id)
(...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after
2092 if (!m_documentNodeToIdMap.contains(m_document)) { 2094 if (!m_documentNodeToIdMap.contains(m_document)) {
2093 RefPtr<TypeBuilder::DOM::Node> root; 2095 RefPtr<TypeBuilder::DOM::Node> root;
2094 getDocument(errorString, root); 2096 getDocument(errorString, root);
2095 return errorString->isEmpty(); 2097 return errorString->isEmpty();
2096 } 2098 }
2097 return true; 2099 return true;
2098 } 2100 }
2099 2101
2100 } // namespace WebCore 2102 } // namespace WebCore
2101 2103
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698