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

Unified Diff: third_party/WebKit/Source/modules/webdatabase/QuotaTracker.cpp

Issue 1779413002: Remove Blink's DatabaseIdentifier implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded include Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webdatabase/QuotaTracker.cpp
diff --git a/third_party/WebKit/Source/modules/webdatabase/QuotaTracker.cpp b/third_party/WebKit/Source/modules/webdatabase/QuotaTracker.cpp
index 007cb539d8398c9fb5a99bf8e066ba456144ada1..d9e32f314722cb823ab5aa9a8b7db686ee9c32f2 100644
--- a/third_party/WebKit/Source/modules/webdatabase/QuotaTracker.cpp
+++ b/third_party/WebKit/Source/modules/webdatabase/QuotaTracker.cpp
@@ -30,7 +30,9 @@
#include "modules/webdatabase/QuotaTracker.h"
+#include "platform/weborigin/SecurityOrigin.h"
#include "public/platform/Platform.h"
+#include "public/platform/WebSecurityOrigin.h"
#include "wtf/StdLibExtras.h"
#include "wtf/Threading.h"
@@ -43,46 +45,46 @@ QuotaTracker& QuotaTracker::instance()
}
void QuotaTracker::getDatabaseSizeAndSpaceAvailableToOrigin(
- const String& originIdentifier, const String& databaseName,
+ SecurityOrigin* origin, const String& databaseName,
unsigned long long* databaseSize, unsigned long long* spaceAvailable)
{
// Extra scope to unlock prior to potentially calling Platform.
{
MutexLocker lockData(m_dataGuard);
- ASSERT(m_databaseSizes.contains(originIdentifier));
- HashMap<String, SizeMap>::const_iterator it = m_databaseSizes.find(originIdentifier);
+ ASSERT(m_databaseSizes.contains(origin->toString()));
+ HashMap<String, SizeMap>::const_iterator it = m_databaseSizes.find(origin->toString());
ASSERT(it->value.contains(databaseName));
*databaseSize = it->value.get(databaseName);
- if (m_spaceAvailableToOrigins.contains(originIdentifier)) {
- *spaceAvailable = m_spaceAvailableToOrigins.get(originIdentifier);
+ if (m_spaceAvailableToOrigins.contains(origin->toString())) {
+ *spaceAvailable = m_spaceAvailableToOrigins.get(origin->toString());
return;
}
}
// The embedder hasn't pushed this value to us, so we pull it as needed.
- *spaceAvailable = Platform::current()->databaseGetSpaceAvailableForOrigin(originIdentifier);
+ *spaceAvailable = Platform::current()->databaseGetSpaceAvailableForOrigin(WebSecurityOrigin(origin));
}
void QuotaTracker::updateDatabaseSize(
- const String& originIdentifier, const String& databaseName,
+ SecurityOrigin* origin, const String& databaseName,
unsigned long long databaseSize)
{
MutexLocker lockData(m_dataGuard);
- HashMap<String, SizeMap>::ValueType* it = m_databaseSizes.add(originIdentifier, SizeMap()).storedValue;
+ HashMap<String, SizeMap>::ValueType* it = m_databaseSizes.add(origin->toString(), SizeMap()).storedValue;
it->value.set(databaseName, databaseSize);
}
-void QuotaTracker::updateSpaceAvailableToOrigin(const String& originIdentifier, unsigned long long spaceAvailable)
+void QuotaTracker::updateSpaceAvailableToOrigin(SecurityOrigin* origin, unsigned long long spaceAvailable)
{
MutexLocker lockData(m_dataGuard);
- m_spaceAvailableToOrigins.set(originIdentifier, spaceAvailable);
+ m_spaceAvailableToOrigins.set(origin->toString(), spaceAvailable);
}
-void QuotaTracker::resetSpaceAvailableToOrigin(const String& originIdentifier)
+void QuotaTracker::resetSpaceAvailableToOrigin(SecurityOrigin* origin)
{
MutexLocker lockData(m_dataGuard);
- m_spaceAvailableToOrigins.remove(originIdentifier);
+ m_spaceAvailableToOrigins.remove(origin->toString());
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698