Index: third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.cpp |
diff --git a/third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.cpp b/third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.cpp |
index 47dbb0eeb1627548a49ebcff65bb0c6b49033241..af13deb943622b21ca604864d58e89b6b3e2e648 100644 |
--- a/third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.cpp |
+++ b/third_party/WebKit/Source/modules/webdatabase/SQLTransactionClient.cpp |
@@ -46,17 +46,11 @@ namespace blink { |
namespace { |
-void databaseModified(const WebSecurityOrigin& origin, |
- const String& databaseName) { |
- if (Platform::current()->databaseObserver()) |
- Platform::current()->databaseObserver()->databaseModified(origin, |
- databaseName); |
-} |
- |
-void databaseModifiedCrossThread(const String& originString, |
- const String& databaseName) { |
- databaseModified(WebSecurityOrigin::createFromString(originString), |
- databaseName); |
+void databaseModified(SecurityOrigin* origin, const String& databaseName) { |
+ if (Platform::current()->databaseObserver()) { |
+ Platform::current()->databaseObserver()->databaseModified( |
+ WebSecurityOrigin(origin), databaseName); |
+ } |
} |
} // namespace |
@@ -66,22 +60,22 @@ void SQLTransactionClient::didCommitWriteTransaction(Database* database) { |
ExecutionContext* executionContext = |
database->getDatabaseContext()->getExecutionContext(); |
if (!executionContext->isContextThread()) { |
+ // TODO(csharrison): Is using crossThreadUnretained safe here? |
executionContext->postTask( |
TaskType::DatabaseAccess, BLINK_FROM_HERE, |
createCrossThreadTask( |
- &databaseModifiedCrossThread, |
- executionContext->getSecurityOrigin()->toRawString(), |
+ &databaseModified, |
+ crossThreadUnretained(executionContext->getSecurityOrigin()), |
databaseName)); |
} else { |
- databaseModified(WebSecurityOrigin(executionContext->getSecurityOrigin()), |
- databaseName); |
+ databaseModified(executionContext->getSecurityOrigin(), databaseName); |
} |
} |
bool SQLTransactionClient::didExceedQuota(Database* database) { |
// Chromium does not allow users to manually change the quota for an origin |
// (for now, at least). Don't do anything. |
- ASSERT( |
+ DCHECK( |
database->getDatabaseContext()->getExecutionContext()->isContextThread()); |
return false; |
} |