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 { ...@@ -485,13 +485,13 @@ bool IDBCursor::IsDeleted() const {
WebIDBCursorDirection IDBCursor::StringToDirection( WebIDBCursorDirection IDBCursor::StringToDirection(
const String& direction_string) { const String& direction_string) {
if (direction_string == IndexedDBNames::next) if (direction_string == indexed_db_names::kNext)
return kWebIDBCursorDirectionNext; return kWebIDBCursorDirectionNext;
if (direction_string == IndexedDBNames::nextunique) if (direction_string == indexed_db_names::kNextunique)
return kWebIDBCursorDirectionNextNoDuplicate; return kWebIDBCursorDirectionNextNoDuplicate;
if (direction_string == IndexedDBNames::prev) if (direction_string == indexed_db_names::kPrev)
return kWebIDBCursorDirectionPrev; return kWebIDBCursorDirectionPrev;
if (direction_string == IndexedDBNames::prevunique) if (direction_string == indexed_db_names::kPrevunique)
return kWebIDBCursorDirectionPrevNoDuplicate; return kWebIDBCursorDirectionPrevNoDuplicate;
NOTREACHED(); NOTREACHED();
...@@ -501,20 +501,20 @@ WebIDBCursorDirection IDBCursor::StringToDirection( ...@@ -501,20 +501,20 @@ WebIDBCursorDirection IDBCursor::StringToDirection(
const String& IDBCursor::direction() const { const String& IDBCursor::direction() const {
switch (direction_) { switch (direction_) {
case kWebIDBCursorDirectionNext: case kWebIDBCursorDirectionNext:
return IndexedDBNames::next; return indexed_db_names::kNext;
case kWebIDBCursorDirectionNextNoDuplicate: case kWebIDBCursorDirectionNextNoDuplicate:
return IndexedDBNames::nextunique; return indexed_db_names::kNextunique;
case kWebIDBCursorDirectionPrev: case kWebIDBCursorDirectionPrev:
return IndexedDBNames::prev; return indexed_db_names::kPrev;
case kWebIDBCursorDirectionPrevNoDuplicate: case kWebIDBCursorDirectionPrevNoDuplicate:
return IndexedDBNames::prevunique; return indexed_db_names::kPrevunique;
default: default:
NOTREACHED(); NOTREACHED();
return IndexedDBNames::next; return indexed_db_names::kNext;
} }
} }
......
...@@ -76,7 +76,7 @@ class WebIDBGetDBNamesCallbacksImpl : public WebIDBCallbacks { ...@@ -76,7 +76,7 @@ class WebIDBGetDBNamesCallbacksImpl : public WebIDBCallbacks {
: promise_resolver_(promise_resolver) { : promise_resolver_(promise_resolver) {
probe::AsyncTaskScheduled( probe::AsyncTaskScheduled(
ExecutionContext::From(promise_resolver_->GetScriptState()), ExecutionContext::From(promise_resolver_->GetScriptState()),
IndexedDBNames::IndexedDB, this); indexed_db_names::kIndexedDB, this);
} }
~WebIDBGetDBNamesCallbacksImpl() override { ~WebIDBGetDBNamesCallbacksImpl() override {
......
...@@ -32,13 +32,13 @@ ScriptValue IDBObservation::value(ScriptState* script_state) { ...@@ -32,13 +32,13 @@ ScriptValue IDBObservation::value(ScriptState* script_state) {
} }
WebIDBOperationType IDBObservation::StringToOperationType(const String& type) { WebIDBOperationType IDBObservation::StringToOperationType(const String& type) {
if (type == IndexedDBNames::add) if (type == indexed_db_names::kAdd)
return kWebIDBAdd; return kWebIDBAdd;
if (type == IndexedDBNames::put) if (type == indexed_db_names::kPut)
return kWebIDBPut; return kWebIDBPut;
if (type == IndexedDBNames::kDelete) if (type == indexed_db_names::kDelete)
return kWebIDBDelete; return kWebIDBDelete;
if (type == IndexedDBNames::clear) if (type == indexed_db_names::kClear)
return kWebIDBClear; return kWebIDBClear;
NOTREACHED(); NOTREACHED();
...@@ -48,20 +48,20 @@ WebIDBOperationType IDBObservation::StringToOperationType(const String& type) { ...@@ -48,20 +48,20 @@ WebIDBOperationType IDBObservation::StringToOperationType(const String& type) {
const String& IDBObservation::type() const { const String& IDBObservation::type() const {
switch (operation_type_) { switch (operation_type_) {
case kWebIDBAdd: case kWebIDBAdd:
return IndexedDBNames::add; return indexed_db_names::kAdd;
case kWebIDBPut: case kWebIDBPut:
return IndexedDBNames::put; return indexed_db_names::kPut;
case kWebIDBDelete: case kWebIDBDelete:
return IndexedDBNames::kDelete; return indexed_db_names::kDelete;
case kWebIDBClear: case kWebIDBClear:
return IndexedDBNames::clear; return indexed_db_names::kClear;
default: default:
NOTREACHED(); NOTREACHED();
return IndexedDBNames::add; return indexed_db_names::kAdd;
} }
} }
......
...@@ -58,13 +58,13 @@ void IDBObserver::observe(IDBDatabase* database, ...@@ -58,13 +58,13 @@ void IDBObserver::observe(IDBDatabase* database,
std::bitset<kWebIDBOperationTypeCount> types; std::bitset<kWebIDBOperationTypeCount> types;
for (const auto& operation_type : options->operationTypes()) { for (const auto& operation_type : options->operationTypes()) {
if (operation_type == IndexedDBNames::add) { if (operation_type == indexed_db_names::kAdd) {
types[kWebIDBAdd] = true; types[kWebIDBAdd] = true;
} else if (operation_type == IndexedDBNames::put) { } else if (operation_type == indexed_db_names::kPut) {
types[kWebIDBPut] = true; types[kWebIDBPut] = true;
} else if (operation_type == IndexedDBNames::kDelete) { } else if (operation_type == indexed_db_names::kDelete) {
types[kWebIDBDelete] = true; types[kWebIDBDelete] = true;
} else if (operation_type == IndexedDBNames::clear) { } else if (operation_type == indexed_db_names::kClear) {
types[kWebIDBClear] = true; types[kWebIDBClear] = true;
} else { } else {
exception_state.ThrowTypeError( exception_state.ThrowTypeError(
......
...@@ -200,9 +200,9 @@ const String& IDBRequest::readyState() const { ...@@ -200,9 +200,9 @@ const String& IDBRequest::readyState() const {
DCHECK(ready_state_ == PENDING || ready_state_ == DONE); DCHECK(ready_state_ == PENDING || ready_state_ == DONE);
if (ready_state_ == PENDING) 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() { std::unique_ptr<WebIDBCallbacks> IDBRequest::CreateWebCallbacks() {
......
...@@ -453,11 +453,11 @@ bool IDBTransaction::HasPendingActivity() const { ...@@ -453,11 +453,11 @@ bool IDBTransaction::HasPendingActivity() const {
} }
WebIDBTransactionMode IDBTransaction::StringToMode(const String& mode_string) { WebIDBTransactionMode IDBTransaction::StringToMode(const String& mode_string) {
if (mode_string == IndexedDBNames::readonly) if (mode_string == indexed_db_names::kReadonly)
return kWebIDBTransactionModeReadOnly; return kWebIDBTransactionModeReadOnly;
if (mode_string == IndexedDBNames::readwrite) if (mode_string == indexed_db_names::kReadwrite)
return kWebIDBTransactionModeReadWrite; return kWebIDBTransactionModeReadWrite;
if (mode_string == IndexedDBNames::versionchange) if (mode_string == indexed_db_names::kVersionchange)
return kWebIDBTransactionModeVersionChange; return kWebIDBTransactionModeVersionChange;
NOTREACHED(); NOTREACHED();
return kWebIDBTransactionModeReadOnly; return kWebIDBTransactionModeReadOnly;
...@@ -470,17 +470,17 @@ WebIDBDatabase* IDBTransaction::BackendDB() const { ...@@ -470,17 +470,17 @@ WebIDBDatabase* IDBTransaction::BackendDB() const {
const String& IDBTransaction::mode() const { const String& IDBTransaction::mode() const {
switch (mode_) { switch (mode_) {
case kWebIDBTransactionModeReadOnly: case kWebIDBTransactionModeReadOnly:
return IndexedDBNames::readonly; return indexed_db_names::kReadonly;
case kWebIDBTransactionModeReadWrite: case kWebIDBTransactionModeReadWrite:
return IndexedDBNames::readwrite; return indexed_db_names::kReadwrite;
case kWebIDBTransactionModeVersionChange: case kWebIDBTransactionModeVersionChange:
return IndexedDBNames::versionchange; return indexed_db_names::kVersionchange;
} }
NOTREACHED(); NOTREACHED();
return IndexedDBNames::readonly; return indexed_db_names::kReadonly;
} }
DOMStringList* IDBTransaction::objectStoreNames() const { DOMStringList* IDBTransaction::objectStoreNames() const {
......
...@@ -63,8 +63,8 @@ unsigned long long IDBVersionChangeEvent::newVersion(bool& is_null) const { ...@@ -63,8 +63,8 @@ unsigned long long IDBVersionChangeEvent::newVersion(bool& is_null) const {
const AtomicString& IDBVersionChangeEvent::dataLoss() const { const AtomicString& IDBVersionChangeEvent::dataLoss() const {
if (data_loss_ == kWebIDBDataLossTotal) if (data_loss_ == kWebIDBDataLossTotal)
return IndexedDBNames::total; return indexed_db_names::kTotal;
return IndexedDBNames::none; return indexed_db_names::kNone;
} }
const AtomicString& IDBVersionChangeEvent::InterfaceName() const { const AtomicString& IDBVersionChangeEvent::InterfaceName() const {
......
{ {
metadata: { metadata: {
namespace: "IndexedDB", namespace: "indexed_db_names",
}, },
data: [ data: [
...@@ -30,10 +30,7 @@ ...@@ -30,10 +30,7 @@
// https://github.com/WICG/indexed-db-observers/blob/gh-pages/EXPLAINER.md//records // https://github.com/WICG/indexed-db-observers/blob/gh-pages/EXPLAINER.md//records
"add", "add",
"put", "put",
{ "delete",
name: "delete",
Symbol: "kDelete",
},
"clear", "clear",
], ],
} }
...@@ -354,7 +354,7 @@ IDBTransaction* TransactionForDatabase( ...@@ -354,7 +354,7 @@ IDBTransaction* TransactionForDatabase(
ScriptState* script_state, ScriptState* script_state,
IDBDatabase* idb_database, IDBDatabase* idb_database,
const String& object_store_name, const String& object_store_name,
const String& mode = IndexedDBNames::readonly) { const String& mode = indexed_db_names::kReadonly) {
DummyExceptionStateForTesting exception_state; DummyExceptionStateForTesting exception_state;
StringOrStringSequence scope; StringOrStringSequence scope;
scope.SetString(object_store_name); scope.SetString(object_store_name);
...@@ -911,7 +911,7 @@ class DeleteObjectStoreEntries final ...@@ -911,7 +911,7 @@ class DeleteObjectStoreEntries final
void Execute(IDBDatabase* idb_database, ScriptState* script_state) override { void Execute(IDBDatabase* idb_database, ScriptState* script_state) override {
IDBTransaction* idb_transaction = IDBTransaction* idb_transaction =
TransactionForDatabase(script_state, idb_database, object_store_name_, TransactionForDatabase(script_state, idb_database, object_store_name_,
IndexedDBNames::readwrite); indexed_db_names::kReadwrite);
if (!idb_transaction) { if (!idb_transaction) {
request_callback_->sendFailure( request_callback_->sendFailure(
Response::Error("Could not get transaction")); Response::Error("Could not get transaction"));
...@@ -1013,7 +1013,7 @@ class ClearObjectStore final ...@@ -1013,7 +1013,7 @@ class ClearObjectStore final
void Execute(IDBDatabase* idb_database, ScriptState* script_state) override { void Execute(IDBDatabase* idb_database, ScriptState* script_state) override {
IDBTransaction* idb_transaction = IDBTransaction* idb_transaction =
TransactionForDatabase(script_state, idb_database, object_store_name_, TransactionForDatabase(script_state, idb_database, object_store_name_,
IndexedDBNames::readwrite); indexed_db_names::kReadwrite);
if (!idb_transaction) { if (!idb_transaction) {
request_callback_->sendFailure( request_callback_->sendFailure(
Response::Error("Could not get transaction")); Response::Error("Could not get transaction"));
......
...@@ -67,7 +67,7 @@ std::unique_ptr<WebIDBCallbacksImpl> WebIDBCallbacksImpl::Create( ...@@ -67,7 +67,7 @@ std::unique_ptr<WebIDBCallbacksImpl> WebIDBCallbacksImpl::Create(
WebIDBCallbacksImpl::WebIDBCallbacksImpl(IDBRequest* request) WebIDBCallbacksImpl::WebIDBCallbacksImpl(IDBRequest* request)
: request_(request) { : request_(request) {
probe::AsyncTaskScheduled(request_->GetExecutionContext(), probe::AsyncTaskScheduled(request_->GetExecutionContext(),
IndexedDBNames::IndexedDB, this); indexed_db_names::kIndexedDB, this);
} }
WebIDBCallbacksImpl::~WebIDBCallbacksImpl() { WebIDBCallbacksImpl::~WebIDBCallbacksImpl() {
......
...@@ -100,14 +100,14 @@ void ModulesInitializer::Initialize() { ...@@ -100,14 +100,14 @@ void ModulesInitializer::Initialize() {
// Strings must be initialized before calling CoreInitializer::init(). // Strings must be initialized before calling CoreInitializer::init().
const unsigned kModulesStaticStringsCount = const unsigned kModulesStaticStringsCount =
event_interface_names::kModulesNamesCount + event_interface_names::kModulesNamesCount +
event_target_names::kModulesNamesCount + IndexedDBNames::kNamesCount; event_target_names::kModulesNamesCount + indexed_db_names::kNamesCount;
StringImpl::ReserveStaticStringsCapacityForSize(kModulesStaticStringsCount); StringImpl::ReserveStaticStringsCapacityForSize(kModulesStaticStringsCount);
event_interface_names::initModules(); event_interface_names::initModules();
event_target_names::initModules(); event_target_names::initModules();
Document::RegisterEventFactory(EventModulesFactory::Create()); Document::RegisterEventFactory(EventModulesFactory::Create());
ModuleBindingsInitializer::Init(); ModuleBindingsInitializer::Init();
IndexedDBNames::init(); indexed_db_names::init();
AXObjectCache::Init(AXObjectCacheImpl::Create); AXObjectCache::Init(AXObjectCacheImpl::Create);
DraggedIsolatedFileSystem::Init( DraggedIsolatedFileSystem::Init(
DraggedIsolatedFileSystemImpl::PrepareForDataObject); 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