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

Side by Side Diff: third_party/WebKit/Source/modules/webdatabase/Database.cpp

Issue 2668903003: Replace WTF::emptyString{16Bit}() with a static global (Closed)
Patch Set: Replace WTF::emptyString{16Bit}() with a static global 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) 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 m_sqliteDatabase.setBusyTimeout(maxSqliteBusyWaitTime); 453 m_sqliteDatabase.setBusyTimeout(maxSqliteBusyWaitTime);
454 454
455 String currentVersion; 455 String currentVersion;
456 { 456 {
457 SafePointAwareMutexLocker locker(guidMutex()); 457 SafePointAwareMutexLocker locker(guidMutex());
458 458
459 GuidVersionMap::iterator entry = guidToVersionMap().find(m_guid); 459 GuidVersionMap::iterator entry = guidToVersionMap().find(m_guid);
460 if (entry != guidToVersionMap().end()) { 460 if (entry != guidToVersionMap().end()) {
461 // Map null string to empty string (see updateGuidVersionMap()). 461 // Map null string to empty string (see updateGuidVersionMap()).
462 currentVersion = 462 currentVersion =
463 entry->value.isNull() ? emptyString() : entry->value.isolatedCopy(); 463 entry->value.isNull() ? emptyString : entry->value.isolatedCopy();
464 STORAGE_DVLOG(1) << "Current cached version for guid " << m_guid << " is " 464 STORAGE_DVLOG(1) << "Current cached version for guid " << m_guid << " is "
465 << currentVersion; 465 << currentVersion;
466 466
467 // Note: In multi-process browsers the cached value may be 467 // Note: In multi-process browsers the cached value may be
468 // inaccurate, but we cannot read the actual version from the 468 // inaccurate, but we cannot read the actual version from the
469 // database without potentially inducing a form of deadlock, a 469 // database without potentially inducing a form of deadlock, a
470 // busytimeout error when trying to access the database. So we'll 470 // busytimeout error when trying to access the database. So we'll
471 // use the cached value if we're unable to read the value from the 471 // use the cached value if we're unable to read the value from the
472 // database file without waiting. 472 // database file without waiting.
473 // FIXME: Add an async openDatabase method to the DatabaseAPI. 473 // FIXME: Add an async openDatabase method to the DatabaseAPI.
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 if (getDatabaseContext()->databaseThread()->isDatabaseThread()) 946 if (getDatabaseContext()->databaseThread()->isDatabaseThread())
947 return m_databaseThreadSecurityOrigin.get(); 947 return m_databaseThreadSecurityOrigin.get();
948 return nullptr; 948 return nullptr;
949 } 949 }
950 950
951 bool Database::opened() { 951 bool Database::opened() {
952 return static_cast<bool>(acquireLoad(&m_opened)); 952 return static_cast<bool>(acquireLoad(&m_opened));
953 } 953 }
954 954
955 } // namespace blink 955 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698