Commit a1b6371a authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Rename blink::IndexedDBNames namespace to blink::indexed_db_names

https://google.github.io/styleguide/cppguide.html#Namespace_Names
> Namespace names are all lower-case.

This CL has no behavior changes.

Bug: 889726
Change-Id: Ie763396344fb7b76a698636353e8a54c0bab3898
Reviewed-on: https://chromium-review.googlesource.com/c/1317296Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605234}
parent 3b60422d
......@@ -485,13 +485,13 @@ bool IDBCursor::IsDeleted() const {
WebIDBCursorDirection IDBCursor::StringToDirection(
const String& direction_string) {
if (direction_string == IndexedDBNames::next)
if (direction_string == indexed_db_names::kNext)
return kWebIDBCursorDirectionNext;
if (direction_string == IndexedDBNames::nextunique)
if (direction_string == indexed_db_names::kNextunique)
return kWebIDBCursorDirectionNextNoDuplicate;
if (direction_string == IndexedDBNames::prev)
if (direction_string == indexed_db_names::kPrev)
return kWebIDBCursorDirectionPrev;
if (direction_string == IndexedDBNames::prevunique)
if (direction_string == indexed_db_names::kPrevunique)
return kWebIDBCursorDirectionPrevNoDuplicate;
NOTREACHED();
......@@ -501,20 +501,20 @@ WebIDBCursorDirection IDBCursor::StringToDirection(
const String& IDBCursor::direction() const {
switch (direction_) {
case kWebIDBCursorDirectionNext:
return IndexedDBNames::next;
return indexed_db_names::kNext;
case kWebIDBCursorDirectionNextNoDuplicate:
return IndexedDBNames::nextunique;
return indexed_db_names::kNextunique;
case kWebIDBCursorDirectionPrev:
return IndexedDBNames::prev;
return indexed_db_names::kPrev;
case kWebIDBCursorDirectionPrevNoDuplicate:
return IndexedDBNames::prevunique;
return indexed_db_names::kPrevunique;
default:
NOTREACHED();
return IndexedDBNames::next;
return indexed_db_names::kNext;
}
}
......
......@@ -76,7 +76,7 @@ class WebIDBGetDBNamesCallbacksImpl : public WebIDBCallbacks {
: promise_resolver_(promise_resolver) {
probe::AsyncTaskScheduled(
ExecutionContext::From(promise_resolver_->GetScriptState()),
IndexedDBNames::IndexedDB, this);
indexed_db_names::kIndexedDB, this);
}
~WebIDBGetDBNamesCallbacksImpl() override {
......
......@@ -32,13 +32,13 @@ ScriptValue IDBObservation::value(ScriptState* script_state) {
}
WebIDBOperationType IDBObservation::StringToOperationType(const String& type) {
if (type == IndexedDBNames::add)
if (type == indexed_db_names::kAdd)
return kWebIDBAdd;
if (type == IndexedDBNames::put)
if (type == indexed_db_names::kPut)
return kWebIDBPut;
if (type == IndexedDBNames::kDelete)
if (type == indexed_db_names::kDelete)
return kWebIDBDelete;
if (type == IndexedDBNames::clear)
if (type == indexed_db_names::kClear)
return kWebIDBClear;
NOTREACHED();
......@@ -48,20 +48,20 @@ WebIDBOperationType IDBObservation::StringToOperationType(const String& type) {
const String& IDBObservation::type() const {
switch (operation_type_) {
case kWebIDBAdd:
return IndexedDBNames::add;
return indexed_db_names::kAdd;
case kWebIDBPut:
return IndexedDBNames::put;
return indexed_db_names::kPut;
case kWebIDBDelete:
return IndexedDBNames::kDelete;
return indexed_db_names::kDelete;
case kWebIDBClear:
return IndexedDBNames::clear;
return indexed_db_names::kClear;
default:
NOTREACHED();
return IndexedDBNames::add;
return indexed_db_names::kAdd;
}
}
......
......@@ -58,13 +58,13 @@ void IDBObserver::observe(IDBDatabase* database,
std::bitset<kWebIDBOperationTypeCount> types;
for (const auto& operation_type : options->operationTypes()) {
if (operation_type == IndexedDBNames::add) {
if (operation_type == indexed_db_names::kAdd) {
types[kWebIDBAdd] = true;
} else if (operation_type == IndexedDBNames::put) {
} else if (operation_type == indexed_db_names::kPut) {
types[kWebIDBPut] = true;
} else if (operation_type == IndexedDBNames::kDelete) {
} else if (operation_type == indexed_db_names::kDelete) {
types[kWebIDBDelete] = true;
} else if (operation_type == IndexedDBNames::clear) {
} else if (operation_type == indexed_db_names::kClear) {
types[kWebIDBClear] = true;
} else {
exception_state.ThrowTypeError(
......
......@@ -200,9 +200,9 @@ const String& IDBRequest::readyState() const {
DCHECK(ready_state_ == PENDING || ready_state_ == DONE);
if (ready_state_ == PENDING)
return IndexedDBNames::pending;
return indexed_db_names::kPending;
return IndexedDBNames::done;
return indexed_db_names::kDone;
}
std::unique_ptr<WebIDBCallbacks> IDBRequest::CreateWebCallbacks() {
......
......@@ -453,11 +453,11 @@ bool IDBTransaction::HasPendingActivity() const {
}
WebIDBTransactionMode IDBTransaction::StringToMode(const String& mode_string) {
if (mode_string == IndexedDBNames::readonly)
if (mode_string == indexed_db_names::kReadonly)
return kWebIDBTransactionModeReadOnly;
if (mode_string == IndexedDBNames::readwrite)
if (mode_string == indexed_db_names::kReadwrite)
return kWebIDBTransactionModeReadWrite;
if (mode_string == IndexedDBNames::versionchange)
if (mode_string == indexed_db_names::kVersionchange)
return kWebIDBTransactionModeVersionChange;
NOTREACHED();
return kWebIDBTransactionModeReadOnly;
......@@ -470,17 +470,17 @@ WebIDBDatabase* IDBTransaction::BackendDB() const {
const String& IDBTransaction::mode() const {
switch (mode_) {
case kWebIDBTransactionModeReadOnly:
return IndexedDBNames::readonly;
return indexed_db_names::kReadonly;
case kWebIDBTransactionModeReadWrite:
return IndexedDBNames::readwrite;
return indexed_db_names::kReadwrite;
case kWebIDBTransactionModeVersionChange:
return IndexedDBNames::versionchange;
return indexed_db_names::kVersionchange;
}
NOTREACHED();
return IndexedDBNames::readonly;
return indexed_db_names::kReadonly;
}
DOMStringList* IDBTransaction::objectStoreNames() const {
......
......@@ -63,8 +63,8 @@ unsigned long long IDBVersionChangeEvent::newVersion(bool& is_null) const {
const AtomicString& IDBVersionChangeEvent::dataLoss() const {
if (data_loss_ == kWebIDBDataLossTotal)
return IndexedDBNames::total;
return IndexedDBNames::none;
return indexed_db_names::kTotal;
return indexed_db_names::kNone;
}
const AtomicString& IDBVersionChangeEvent::InterfaceName() const {
......
{
metadata: {
namespace: "IndexedDB",
namespace: "indexed_db_names",
},
data: [
......@@ -30,10 +30,7 @@
// https://github.com/WICG/indexed-db-observers/blob/gh-pages/EXPLAINER.md//records
"add",
"put",
{
name: "delete",
Symbol: "kDelete",
},
"delete",
"clear",
],
}
......@@ -354,7 +354,7 @@ IDBTransaction* TransactionForDatabase(
ScriptState* script_state,
IDBDatabase* idb_database,
const String& object_store_name,
const String& mode = IndexedDBNames::readonly) {
const String& mode = indexed_db_names::kReadonly) {
DummyExceptionStateForTesting exception_state;
StringOrStringSequence scope;
scope.SetString(object_store_name);
......@@ -911,7 +911,7 @@ class DeleteObjectStoreEntries final
void Execute(IDBDatabase* idb_database, ScriptState* script_state) override {
IDBTransaction* idb_transaction =
TransactionForDatabase(script_state, idb_database, object_store_name_,
IndexedDBNames::readwrite);
indexed_db_names::kReadwrite);
if (!idb_transaction) {
request_callback_->sendFailure(
Response::Error("Could not get transaction"));
......@@ -1013,7 +1013,7 @@ class ClearObjectStore final
void Execute(IDBDatabase* idb_database, ScriptState* script_state) override {
IDBTransaction* idb_transaction =
TransactionForDatabase(script_state, idb_database, object_store_name_,
IndexedDBNames::readwrite);
indexed_db_names::kReadwrite);
if (!idb_transaction) {
request_callback_->sendFailure(
Response::Error("Could not get transaction"));
......
......@@ -67,7 +67,7 @@ std::unique_ptr<WebIDBCallbacksImpl> WebIDBCallbacksImpl::Create(
WebIDBCallbacksImpl::WebIDBCallbacksImpl(IDBRequest* request)
: request_(request) {
probe::AsyncTaskScheduled(request_->GetExecutionContext(),
IndexedDBNames::IndexedDB, this);
indexed_db_names::kIndexedDB, this);
}
WebIDBCallbacksImpl::~WebIDBCallbacksImpl() {
......
......@@ -100,14 +100,14 @@ void ModulesInitializer::Initialize() {
// Strings must be initialized before calling CoreInitializer::init().
const unsigned kModulesStaticStringsCount =
event_interface_names::kModulesNamesCount +
event_target_names::kModulesNamesCount + IndexedDBNames::kNamesCount;
event_target_names::kModulesNamesCount + indexed_db_names::kNamesCount;
StringImpl::ReserveStaticStringsCapacityForSize(kModulesStaticStringsCount);
event_interface_names::initModules();
event_target_names::initModules();
Document::RegisterEventFactory(EventModulesFactory::Create());
ModuleBindingsInitializer::Init();
IndexedDBNames::init();
indexed_db_names::init();
AXObjectCache::Init(AXObjectCacheImpl::Create);
DraggedIsolatedFileSystem::Init(
DraggedIsolatedFileSystemImpl::PrepareForDataObject);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment