Commit 2588a9f5 authored by tfarina@chromium.org's avatar tfarina@chromium.org

Cleanup namespace usage in modules/.

BUG=None
TEST=blink_tests
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/454353002

git-svn-id: svn://svn.chromium.org/blink/trunk@179981 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent a3a894a1
...@@ -33,8 +33,7 @@ ...@@ -33,8 +33,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
using namespace blink; namespace blink {
namespace { namespace {
void checkKeyPath(const String& keyPath, const Vector<String>& expected, int parserError) void checkKeyPath(const String& keyPath, const Vector<String>& expected, int parserError)
...@@ -126,3 +125,4 @@ TEST(IDBKeyPathTest, InvalidKeyPath5) ...@@ -126,3 +125,4 @@ TEST(IDBKeyPathTest, InvalidKeyPath5)
} }
} // namespace } // namespace
} // namespace blink
...@@ -46,9 +46,7 @@ ...@@ -46,9 +46,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <v8.h> #include <v8.h>
using blink::WebBlobInfo; namespace blink {
using namespace blink;
namespace { namespace {
class IDBRequestTest : public testing::Test { class IDBRequestTest : public testing::Test {
...@@ -107,7 +105,7 @@ TEST_F(IDBRequestTest, AbortErrorAfterAbort) ...@@ -107,7 +105,7 @@ TEST_F(IDBRequestTest, AbortErrorAfterAbort)
request->onError(DOMError::create(AbortError, "Description goes here.")); request->onError(DOMError::create(AbortError, "Description goes here."));
} }
class MockWebIDBDatabase : public blink::WebIDBDatabase { class MockWebIDBDatabase : public WebIDBDatabase {
public: public:
static PassOwnPtr<MockWebIDBDatabase> create() static PassOwnPtr<MockWebIDBDatabase> create()
{ {
...@@ -147,7 +145,7 @@ TEST_F(IDBRequestTest, ConnectionsAfterStopping) ...@@ -147,7 +145,7 @@ TEST_F(IDBRequestTest, ConnectionsAfterStopping)
EXPECT_EQ(request->readyState(), "pending"); EXPECT_EQ(request->readyState(), "pending");
executionContext()->stopActiveDOMObjects(); executionContext()->stopActiveDOMObjects();
request->onUpgradeNeeded(oldVersion, backend.release(), metadata, blink::WebIDBDataLossNone, String()); request->onUpgradeNeeded(oldVersion, backend.release(), metadata, WebIDBDataLossNone, String());
} }
{ {
...@@ -161,3 +159,4 @@ TEST_F(IDBRequestTest, ConnectionsAfterStopping) ...@@ -161,3 +159,4 @@ TEST_F(IDBRequestTest, ConnectionsAfterStopping)
} }
} // namespace } // namespace
} // namespace blink
...@@ -41,10 +41,7 @@ ...@@ -41,10 +41,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <v8.h> #include <v8.h>
using namespace blink; namespace blink {
using blink::WebIDBDatabase;
namespace { namespace {
class IDBTransactionTest : public testing::Test { class IDBTransactionTest : public testing::Test {
...@@ -70,7 +67,7 @@ private: ...@@ -70,7 +67,7 @@ private:
RefPtrWillBePersistent<ExecutionContext> m_executionContext; RefPtrWillBePersistent<ExecutionContext> m_executionContext;
}; };
class FakeWebIDBDatabase FINAL : public blink::WebIDBDatabase { class FakeWebIDBDatabase FINAL : public WebIDBDatabase {
public: public:
static PassOwnPtr<FakeWebIDBDatabase> create() { return adoptPtr(new FakeWebIDBDatabase()); } static PassOwnPtr<FakeWebIDBDatabase> create() { return adoptPtr(new FakeWebIDBDatabase()); }
...@@ -100,7 +97,7 @@ TEST_F(IDBTransactionTest, EnsureLifetime) ...@@ -100,7 +97,7 @@ TEST_F(IDBTransactionTest, EnsureLifetime)
const int64_t transactionId = 1234; const int64_t transactionId = 1234;
const Vector<String> transactionScope; const Vector<String> transactionScope;
Persistent<IDBTransaction> transaction = IDBTransaction::create(executionContext(), transactionId, transactionScope, blink::WebIDBTransactionModeReadOnly, db.get()); Persistent<IDBTransaction> transaction = IDBTransaction::create(executionContext(), transactionId, transactionScope, WebIDBTransactionModeReadOnly, db.get());
PersistentHeapHashSet<WeakMember<IDBTransaction> > set; PersistentHeapHashSet<WeakMember<IDBTransaction> > set;
set.add(transaction); set.add(transaction);
...@@ -130,7 +127,7 @@ TEST_F(IDBTransactionTest, TransactionFinish) ...@@ -130,7 +127,7 @@ TEST_F(IDBTransactionTest, TransactionFinish)
const int64_t transactionId = 1234; const int64_t transactionId = 1234;
const Vector<String> transactionScope; const Vector<String> transactionScope;
Persistent<IDBTransaction> transaction = IDBTransaction::create(executionContext(), transactionId, transactionScope, blink::WebIDBTransactionModeReadOnly, db.get()); Persistent<IDBTransaction> transaction = IDBTransaction::create(executionContext(), transactionId, transactionScope, WebIDBTransactionModeReadOnly, db.get());
PersistentHeapHashSet<WeakMember<IDBTransaction> > set; PersistentHeapHashSet<WeakMember<IDBTransaction> > set;
set.add(transaction); set.add(transaction);
...@@ -160,3 +157,4 @@ TEST_F(IDBTransactionTest, TransactionFinish) ...@@ -160,3 +157,4 @@ TEST_F(IDBTransactionTest, TransactionFinish)
} }
} // namespace } // namespace
} // namespace blink
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <v8.h> #include <v8.h>
using namespace blink; namespace blink {
namespace { namespace {
// Promise-related test support. // Promise-related test support.
...@@ -342,3 +341,4 @@ TEST_F(ServiceWorkerContainerTest, RegisterUnregister_NonHttpsSecureOriginDelega ...@@ -342,3 +341,4 @@ TEST_F(ServiceWorkerContainerTest, RegisterUnregister_NonHttpsSecureOriginDelega
} }
} // namespace } // namespace
} // namespace blink
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
using namespace blink;
// Defined in Chromium's codebase in third_party/sqlite/src/os_unix.c // Defined in Chromium's codebase in third_party/sqlite/src/os_unix.c
extern "C" { extern "C" {
void chromium_sqlite3_initialize_unix_sqlite3_file(sqlite3_file* file); void chromium_sqlite3_initialize_unix_sqlite3_file(sqlite3_file* file);
...@@ -49,6 +47,8 @@ void chromium_sqlite3_update_reusable_file_handle(sqlite3_file* file, int fd, in ...@@ -49,6 +47,8 @@ void chromium_sqlite3_update_reusable_file_handle(sqlite3_file* file, int fd, in
void chromium_sqlite3_destroy_reusable_file_handle(sqlite3_file* file); void chromium_sqlite3_destroy_reusable_file_handle(sqlite3_file* file);
} }
namespace blink {
// Chromium's Posix implementation of SQLite VFS // Chromium's Posix implementation of SQLite VFS
namespace { namespace {
...@@ -69,10 +69,10 @@ int chromiumOpen(sqlite3_vfs* vfs, const char* fileName, ...@@ -69,10 +69,10 @@ int chromiumOpen(sqlite3_vfs* vfs, const char* fileName,
return result; return result;
if (fd < 0) { if (fd < 0) {
fd = blink::Platform::current()->databaseOpenFile(String(fileName), desiredFlags); fd = Platform::current()->databaseOpenFile(String(fileName), desiredFlags);
if ((fd < 0) && (desiredFlags & SQLITE_OPEN_READWRITE)) { if ((fd < 0) && (desiredFlags & SQLITE_OPEN_READWRITE)) {
int newFlags = (desiredFlags & ~(SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)) | SQLITE_OPEN_READONLY; int newFlags = (desiredFlags & ~(SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)) | SQLITE_OPEN_READONLY;
fd = blink::Platform::current()->databaseOpenFile(String(fileName), newFlags); fd = Platform::current()->databaseOpenFile(String(fileName), newFlags);
} }
} }
if (fd < 0) { if (fd < 0) {
...@@ -103,7 +103,7 @@ int chromiumOpen(sqlite3_vfs* vfs, const char* fileName, ...@@ -103,7 +103,7 @@ int chromiumOpen(sqlite3_vfs* vfs, const char* fileName,
// should be synched after the file is deleted. // should be synched after the file is deleted.
int chromiumDelete(sqlite3_vfs*, const char* fileName, int syncDir) int chromiumDelete(sqlite3_vfs*, const char* fileName, int syncDir)
{ {
return blink::Platform::current()->databaseDeleteFile(String(fileName), syncDir); return Platform::current()->databaseDeleteFile(String(fileName), syncDir);
} }
// Check the existance and status of the given file. // Check the existance and status of the given file.
...@@ -114,7 +114,7 @@ int chromiumDelete(sqlite3_vfs*, const char* fileName, int syncDir) ...@@ -114,7 +114,7 @@ int chromiumDelete(sqlite3_vfs*, const char* fileName, int syncDir)
// res - the result. // res - the result.
int chromiumAccess(sqlite3_vfs*, const char* fileName, int flag, int* res) int chromiumAccess(sqlite3_vfs*, const char* fileName, int flag, int* res)
{ {
int attr = static_cast<int>(blink::Platform::current()->databaseGetFileAttributes(String(fileName))); int attr = static_cast<int>(Platform::current()->databaseGetFileAttributes(String(fileName)));
if (attr < 0) { if (attr < 0) {
*res = 0; *res = 0;
return SQLITE_OK; return SQLITE_OK;
...@@ -166,8 +166,6 @@ void* chromiumDlOpen(sqlite3_vfs*, const char*) ...@@ -166,8 +166,6 @@ void* chromiumDlOpen(sqlite3_vfs*, const char*)
} // namespace } // namespace
namespace blink {
void SQLiteFileSystem::registerSQLiteVFS() void SQLiteFileSystem::registerSQLiteVFS()
{ {
sqlite3_vfs* unix_vfs = sqlite3_vfs_find("unix"); sqlite3_vfs* unix_vfs = sqlite3_vfs_find("unix");
......
...@@ -35,13 +35,13 @@ ...@@ -35,13 +35,13 @@
#include <sqlite3.h> #include <sqlite3.h>
#include "public/platform/Platform.h" #include "public/platform/Platform.h"
using namespace blink;
// Defined in Chromium's codebase in third_party/sqlite/src/os_win.c // Defined in Chromium's codebase in third_party/sqlite/src/os_win.c
extern "C" { extern "C" {
int chromium_sqlite3_initialize_win_sqlite3_file(sqlite3_file* file, HANDLE handle); int chromium_sqlite3_initialize_win_sqlite3_file(sqlite3_file* file, HANDLE handle);
} }
namespace blink {
// Chromium's Windows implementation of SQLite VFS // Chromium's Windows implementation of SQLite VFS
namespace { namespace {
...@@ -55,7 +55,7 @@ namespace { ...@@ -55,7 +55,7 @@ namespace {
int chromiumOpen(sqlite3_vfs*, const char* fileName, int chromiumOpen(sqlite3_vfs*, const char* fileName,
sqlite3_file* id, int desiredFlags, int* usedFlags) sqlite3_file* id, int desiredFlags, int* usedFlags)
{ {
HANDLE h = blink::Platform::current()->databaseOpenFile(String(fileName), desiredFlags); HANDLE h = Platform::current()->databaseOpenFile(String(fileName), desiredFlags);
if (h == INVALID_HANDLE_VALUE) { if (h == INVALID_HANDLE_VALUE) {
if (desiredFlags & SQLITE_OPEN_READWRITE) { if (desiredFlags & SQLITE_OPEN_READWRITE) {
int newFlags = (desiredFlags | SQLITE_OPEN_READONLY) & ~SQLITE_OPEN_READWRITE; int newFlags = (desiredFlags | SQLITE_OPEN_READONLY) & ~SQLITE_OPEN_READWRITE;
...@@ -82,7 +82,7 @@ int chromiumOpen(sqlite3_vfs*, const char* fileName, ...@@ -82,7 +82,7 @@ int chromiumOpen(sqlite3_vfs*, const char* fileName,
// should be synched after the file is deleted. // should be synched after the file is deleted.
int chromiumDelete(sqlite3_vfs*, const char* fileName, int) int chromiumDelete(sqlite3_vfs*, const char* fileName, int)
{ {
return blink::Platform::current()->databaseDeleteFile(String(fileName), false); return Platform::current()->databaseDeleteFile(String(fileName), false);
} }
// Check the existance and status of the given file. // Check the existance and status of the given file.
...@@ -93,7 +93,7 @@ int chromiumDelete(sqlite3_vfs*, const char* fileName, int) ...@@ -93,7 +93,7 @@ int chromiumDelete(sqlite3_vfs*, const char* fileName, int)
// res - the result. // res - the result.
int chromiumAccess(sqlite3_vfs*, const char* fileName, int flag, int* res) int chromiumAccess(sqlite3_vfs*, const char* fileName, int flag, int* res)
{ {
DWORD attr = blink::Platform::current()->databaseGetFileAttributes(String(fileName)); DWORD attr = Platform::current()->databaseGetFileAttributes(String(fileName));
switch (flag) { switch (flag) {
case SQLITE_ACCESS_READ: case SQLITE_ACCESS_READ:
case SQLITE_ACCESS_EXISTS: case SQLITE_ACCESS_EXISTS:
...@@ -138,8 +138,6 @@ void* chromiumDlOpen(sqlite3_vfs*, const char*) ...@@ -138,8 +138,6 @@ void* chromiumDlOpen(sqlite3_vfs*, const char*)
} // namespace } // namespace
namespace blink {
void SQLiteFileSystem::registerSQLiteVFS() void SQLiteFileSystem::registerSQLiteVFS()
{ {
sqlite3_vfs* win32_vfs = sqlite3_vfs_find("win32"); sqlite3_vfs* win32_vfs = sqlite3_vfs_find("win32");
......
...@@ -29,8 +29,7 @@ ...@@ -29,8 +29,7 @@
#include "wtf/Vector.h" #include "wtf/Vector.h"
#include <gtest/gtest.h> #include <gtest/gtest.h>
using namespace blink; namespace blink {
namespace { namespace {
TEST(WebSocketDeflaterTest, TestCompressHello) TEST(WebSocketDeflaterTest, TestCompressHello)
...@@ -153,4 +152,5 @@ TEST(WebSocketDeflaterTest, TestLargeData) ...@@ -153,4 +152,5 @@ TEST(WebSocketDeflaterTest, TestLargeData)
EXPECT_EQ(0, memcmp(inputData.data(), inflater->data(), inflater->size())); EXPECT_EQ(0, memcmp(inputData.data(), inflater->data(), inflater->size()));
} }
} } // namespace
} // namespace blink
...@@ -32,8 +32,7 @@ ...@@ -32,8 +32,7 @@
#include "wtf/text/StringHash.h" #include "wtf/text/StringHash.h"
#include <gtest/gtest.h> #include <gtest/gtest.h>
using namespace blink; namespace blink {
namespace { namespace {
class WebSocketExtensionDispatcherTest; class WebSocketExtensionDispatcherTest;
...@@ -181,4 +180,5 @@ TEST_F(WebSocketExtensionDispatcherTest, TestInvalid) ...@@ -181,4 +180,5 @@ TEST_F(WebSocketExtensionDispatcherTest, TestInvalid)
} }
} }
} } // namespace
} // namespace blink
...@@ -36,8 +36,7 @@ ...@@ -36,8 +36,7 @@
#include "wtf/text/WTFString.h" #include "wtf/text/WTFString.h"
#include <gtest/gtest.h> #include <gtest/gtest.h>
using namespace blink; namespace blink {
namespace { namespace {
TEST(WebSocketExtensionParserTest, simpleExtension) TEST(WebSocketExtensionParserTest, simpleExtension)
...@@ -183,3 +182,4 @@ TEST(WebSocketExtensionParserTest, separatorInQuotedParameter) ...@@ -183,3 +182,4 @@ TEST(WebSocketExtensionParserTest, separatorInQuotedParameter)
} }
} // namespace } // namespace
} // namespace blink
...@@ -37,8 +37,7 @@ ...@@ -37,8 +37,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <iterator> #include <iterator>
using namespace blink; namespace blink {
namespace { namespace {
TEST(WebSocketPerMessageDeflateTest, TestDeflateHelloTakeOver) TEST(WebSocketPerMessageDeflateTest, TestDeflateHelloTakeOver)
...@@ -508,4 +507,6 @@ TEST(WebSocketPerMessageDeflateTest, TestNegotiationRequest) ...@@ -508,4 +507,6 @@ TEST(WebSocketPerMessageDeflateTest, TestNegotiationRequest)
String actual = WebSocketPerMessageDeflate().createExtensionProcessor()->handshakeString(); String actual = WebSocketPerMessageDeflate().createExtensionProcessor()->handshakeString();
EXPECT_EQ(String("permessage-deflate; client_max_window_bits"), actual); EXPECT_EQ(String("permessage-deflate; client_max_window_bits"), actual);
} }
} // namespace } // namespace
} // namespace blink
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