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

Side by Side Diff: third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp

Issue 2759703002: Migrate WTF::HashMap::remove() to ::erase() (Closed)
Patch Set: rebase, fix one platform-specific reference Created 3 years, 9 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) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. 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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * 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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 *snapshotId = String::number(++s_lastSnapshotId); 405 *snapshotId = String::number(++s_lastSnapshotId);
406 bool newEntry = m_snapshotById.insert(*snapshotId, snapshot).isNewEntry; 406 bool newEntry = m_snapshotById.insert(*snapshotId, snapshot).isNewEntry;
407 DCHECK(newEntry); 407 DCHECK(newEntry);
408 return Response::OK(); 408 return Response::OK();
409 } 409 }
410 410
411 Response InspectorLayerTreeAgent::releaseSnapshot(const String& snapshotId) { 411 Response InspectorLayerTreeAgent::releaseSnapshot(const String& snapshotId) {
412 SnapshotById::iterator it = m_snapshotById.find(snapshotId); 412 SnapshotById::iterator it = m_snapshotById.find(snapshotId);
413 if (it == m_snapshotById.end()) 413 if (it == m_snapshotById.end())
414 return Response::Error("Snapshot not found"); 414 return Response::Error("Snapshot not found");
415 m_snapshotById.remove(it); 415 m_snapshotById.erase(it);
416 return Response::OK(); 416 return Response::OK();
417 } 417 }
418 418
419 Response InspectorLayerTreeAgent::snapshotById(const String& snapshotId, 419 Response InspectorLayerTreeAgent::snapshotById(const String& snapshotId,
420 const PictureSnapshot*& result) { 420 const PictureSnapshot*& result) {
421 SnapshotById::iterator it = m_snapshotById.find(snapshotId); 421 SnapshotById::iterator it = m_snapshotById.find(snapshotId);
422 if (it == m_snapshotById.end()) 422 if (it == m_snapshotById.end())
423 return Response::Error("Snapshot not found"); 423 return Response::Error("Snapshot not found");
424 result = it->value.get(); 424 result = it->value.get();
425 return Response::OK(); 425 return Response::OK();
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 } 500 }
501 501
502 void InspectorLayerTreeAgent::didRemovePageOverlay(const GraphicsLayer* layer) { 502 void InspectorLayerTreeAgent::didRemovePageOverlay(const GraphicsLayer* layer) {
503 size_t index = m_pageOverlayLayerIds.find(layer->platformLayer()->id()); 503 size_t index = m_pageOverlayLayerIds.find(layer->platformLayer()->id());
504 if (index == WTF::kNotFound) 504 if (index == WTF::kNotFound)
505 return; 505 return;
506 m_pageOverlayLayerIds.remove(index); 506 m_pageOverlayLayerIds.remove(index);
507 } 507 }
508 508
509 } // namespace blink 509 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698