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

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

Issue 2671933002: Migrate WTF::HashMap::add() to ::insert() (Closed)
Patch Set: rebase, add TODOs Created 3 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 String PublicURLManager::registerURL(ExecutionContext* context, 46 String PublicURLManager::registerURL(ExecutionContext* context,
47 URLRegistrable* registrable, 47 URLRegistrable* registrable,
48 const String& uuid) { 48 const String& uuid) {
49 SecurityOrigin* origin = context->getSecurityOrigin(); 49 SecurityOrigin* origin = context->getSecurityOrigin();
50 const KURL& url = BlobURL::createPublicURL(origin); 50 const KURL& url = BlobURL::createPublicURL(origin);
51 DCHECK(!url.isEmpty()); 51 DCHECK(!url.isEmpty());
52 const String& urlString = url.getString(); 52 const String& urlString = url.getString();
53 53
54 if (!m_isStopped) { 54 if (!m_isStopped) {
55 RegistryURLMap::ValueType* found = 55 RegistryURLMap::ValueType* found =
56 m_registryToURL.add(&registrable->registry(), URLMap()).storedValue; 56 m_registryToURL.insert(&registrable->registry(), URLMap()).storedValue;
57 found->key->registerURL(origin, url, registrable); 57 found->key->registerURL(origin, url, registrable);
58 found->value.add(urlString, uuid); 58 found->value.insert(urlString, uuid);
59 } 59 }
60 60
61 return urlString; 61 return urlString;
62 } 62 }
63 63
64 void PublicURLManager::revoke(const KURL& url) { 64 void PublicURLManager::revoke(const KURL& url) {
65 for (auto& registryUrl : m_registryToURL) { 65 for (auto& registryUrl : m_registryToURL) {
66 if (registryUrl.value.contains(url.getString())) { 66 if (registryUrl.value.contains(url.getString())) {
67 registryUrl.key->unregisterURL(url); 67 registryUrl.key->unregisterURL(url);
68 registryUrl.value.erase(url.getString()); 68 registryUrl.value.erase(url.getString());
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 103
104 m_registryToURL.clear(); 104 m_registryToURL.clear();
105 } 105 }
106 106
107 DEFINE_TRACE(PublicURLManager) { 107 DEFINE_TRACE(PublicURLManager) {
108 ContextLifecycleObserver::trace(visitor); 108 ContextLifecycleObserver::trace(visitor);
109 } 109 }
110 110
111 } // namespace blink 111 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698