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

Side by Side Diff: Source/core/html/PublicURLManager.cpp

Issue 152883002: (Concept patch) Simplify WTF::HashTable::add() return value for size and performance (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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 Motorola Mobility Inc. 2 * Copyright (C) 2012 Motorola Mobility Inc.
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 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 : ActiveDOMObject(context) 44 : ActiveDOMObject(context)
45 , m_isStopped(false) 45 , m_isStopped(false)
46 { 46 {
47 } 47 }
48 48
49 void PublicURLManager::registerURL(SecurityOrigin* origin, const KURL& url, URLR egistrable* registrable) 49 void PublicURLManager::registerURL(SecurityOrigin* origin, const KURL& url, URLR egistrable* registrable)
50 { 50 {
51 if (m_isStopped) 51 if (m_isStopped)
52 return; 52 return;
53 53
54 RegistryURLMap::iterator found = m_registryToURL.add(&registrable->registry( ), URLSet()).iterator; 54 RegistryURLMap::ValueType* found = m_registryToURL.add(&registrable->registr y(), URLSet()).iterator;
55 found->key->registerURL(origin, url, registrable); 55 found->key->registerURL(origin, url, registrable);
56 found->value.add(url.string()); 56 found->value.add(url.string());
57 } 57 }
58 58
59 void PublicURLManager::revoke(const KURL& url) 59 void PublicURLManager::revoke(const KURL& url)
60 { 60 {
61 for (RegistryURLMap::iterator i = m_registryToURL.begin(); i != m_registryTo URL.end(); ++i) { 61 for (RegistryURLMap::iterator i = m_registryToURL.begin(); i != m_registryTo URL.end(); ++i) {
62 if (i->value.contains(url.string())) { 62 if (i->value.contains(url.string())) {
63 i->key->unregisterURL(url); 63 i->key->unregisterURL(url);
64 i->value.remove(url.string()); 64 i->value.remove(url.string());
(...skipping 10 matching lines...) Expand all
75 m_isStopped = true; 75 m_isStopped = true;
76 for (RegistryURLMap::iterator i = m_registryToURL.begin(); i != m_registryTo URL.end(); ++i) { 76 for (RegistryURLMap::iterator i = m_registryToURL.begin(); i != m_registryTo URL.end(); ++i) {
77 for (URLSet::iterator j = i->value.begin(); j != i->value.end(); ++j) 77 for (URLSet::iterator j = i->value.begin(); j != i->value.end(); ++j)
78 i->key->unregisterURL(KURL(ParsedURLString, *j)); 78 i->key->unregisterURL(KURL(ParsedURLString, *j));
79 } 79 }
80 80
81 m_registryToURL.clear(); 81 m_registryToURL.clear();
82 } 82 }
83 83
84 } 84 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698