| OLD | NEW |
| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // A linear scan; revoking by UUID is assumed rare. | 77 // A linear scan; revoking by UUID is assumed rare. |
| 78 Vector<String> urlsToRemove; | 78 Vector<String> urlsToRemove; |
| 79 for (auto& registryUrl : m_registryToURL) { | 79 for (auto& registryUrl : m_registryToURL) { |
| 80 URLRegistry* registry = registryUrl.key; | 80 URLRegistry* registry = registryUrl.key; |
| 81 URLMap& registeredURLs = registryUrl.value; | 81 URLMap& registeredURLs = registryUrl.value; |
| 82 for (auto& registeredUrl : registeredURLs) { | 82 for (auto& registeredUrl : registeredURLs) { |
| 83 if (uuid == registeredUrl.value) { | 83 if (uuid == registeredUrl.value) { |
| 84 KURL url(ParsedURLString, registeredUrl.key); | 84 KURL url(ParsedURLString, registeredUrl.key); |
| 85 getExecutionContext()->removeURLFromMemoryCache(url); | 85 getExecutionContext()->removeURLFromMemoryCache(url); |
| 86 registry->unregisterURL(url); | 86 registry->unregisterURL(url); |
| 87 urlsToRemove.append(registeredUrl.key); | 87 urlsToRemove.push_back(registeredUrl.key); |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 for (const auto& url : urlsToRemove) | 90 for (const auto& url : urlsToRemove) |
| 91 registeredURLs.remove(url); | 91 registeredURLs.remove(url); |
| 92 urlsToRemove.clear(); | 92 urlsToRemove.clear(); |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 | 95 |
| 96 void PublicURLManager::contextDestroyed() { | 96 void PublicURLManager::contextDestroyed() { |
| 97 if (m_isStopped) | 97 if (m_isStopped) |
| 98 return; | 98 return; |
| 99 | 99 |
| 100 m_isStopped = true; | 100 m_isStopped = true; |
| 101 for (auto& registryUrl : m_registryToURL) { | 101 for (auto& registryUrl : m_registryToURL) { |
| 102 for (auto& url : registryUrl.value) | 102 for (auto& url : registryUrl.value) |
| 103 registryUrl.key->unregisterURL(KURL(ParsedURLString, url.key)); | 103 registryUrl.key->unregisterURL(KURL(ParsedURLString, url.key)); |
| 104 } | 104 } |
| 105 | 105 |
| 106 m_registryToURL.clear(); | 106 m_registryToURL.clear(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 DEFINE_TRACE(PublicURLManager) { | 109 DEFINE_TRACE(PublicURLManager) { |
| 110 SuspendableObject::trace(visitor); | 110 SuspendableObject::trace(visitor); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace blink | 113 } // namespace blink |
| OLD | NEW |