diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-29 19:21:31 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-29 19:21:31 +0000 |
commit | 8275835e508fb36328dd79c338d31bbf98eadf56 (patch) | |
tree | f78d6d976f6bad03de09a82d550943068db096a3 /webkit/support | |
parent | 460d2fd0876fddb9e6a2a17cba9c70beb93dfa03 (diff) | |
download | chromium_src-8275835e508fb36328dd79c338d31bbf98eadf56.zip chromium_src-8275835e508fb36328dd79c338d31bbf98eadf56.tar.gz chromium_src-8275835e508fb36328dd79c338d31bbf98eadf56.tar.bz2 |
Replace string16 with base::string16 in src/webkit
BUG=
Review URL: https://codereview.chromium.org/13219005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191421 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/support')
-rw-r--r-- | webkit/support/platform_support_android.cc | 2 | ||||
-rw-r--r-- | webkit/support/platform_support_linux.cc | 2 | ||||
-rw-r--r-- | webkit/support/platform_support_mac.mm | 8 | ||||
-rw-r--r-- | webkit/support/platform_support_win.cc | 4 | ||||
-rw-r--r-- | webkit/support/simple_database_system.cc | 60 | ||||
-rw-r--r-- | webkit/support/simple_database_system.h | 45 | ||||
-rw-r--r-- | webkit/support/test_webkit_platform_support.h | 2 |
7 files changed, 65 insertions, 58 deletions
diff --git a/webkit/support/platform_support_android.cc b/webkit/support/platform_support_android.cc index 0acc1ab..d192ce9 100644 --- a/webkit/support/platform_support_android.cc +++ b/webkit/support/platform_support_android.cc @@ -91,7 +91,7 @@ void AfterShutdown() { } // namespace webkit_support -string16 TestWebKitPlatformSupport::GetLocalizedString(int message_id) { +base::string16 TestWebKitPlatformSupport::GetLocalizedString(int message_id) { return ResourceBundle::GetSharedInstance().GetLocalizedString(message_id); } diff --git a/webkit/support/platform_support_linux.cc b/webkit/support/platform_support_linux.cc index ce622ea..2b6d0b5 100644 --- a/webkit/support/platform_support_linux.cc +++ b/webkit/support/platform_support_linux.cc @@ -38,7 +38,7 @@ void AfterShutdown() { } // namespace webkit_support -string16 TestWebKitPlatformSupport::GetLocalizedString(int message_id) { +base::string16 TestWebKitPlatformSupport::GetLocalizedString(int message_id) { return ResourceBundle::GetSharedInstance().GetLocalizedString(message_id); } diff --git a/webkit/support/platform_support_mac.mm b/webkit/support/platform_support_mac.mm index 2681cb4..80317d1 100644 --- a/webkit/support/platform_support_mac.mm +++ b/webkit/support/platform_support_mac.mm @@ -173,24 +173,24 @@ void AfterShutdown() { } // namespace webkit_support -string16 TestWebKitPlatformSupport::GetLocalizedString(int message_id) { +base::string16 TestWebKitPlatformSupport::GetLocalizedString(int message_id) { // |g_resource_data_pack| is null on unit tests. // But som unit tests reach GetLocalizedString(). if (!g_resource_data_pack) - return string16(); + return base::string16(); base::StringPiece res; if (!g_resource_data_pack->GetStringPiece(message_id, &res)) { LOG(FATAL) << "failed to load webkit string with id " << message_id; } // Data packs hold strings as either UTF8 or UTF16. - string16 msg; + base::string16 msg; switch (g_resource_data_pack->GetTextEncodingType()) { case ui::DataPack::UTF8: msg = UTF8ToUTF16(res); break; case ui::DataPack::UTF16: - msg = string16(reinterpret_cast<const char16*>(res.data()), + msg = base::string16(reinterpret_cast<const char16*>(res.data()), res.length() / 2); break; case ui::DataPack::BINARY: diff --git a/webkit/support/platform_support_win.cc b/webkit/support/platform_support_win.cc index f5d03aa..01bf814 100644 --- a/webkit/support/platform_support_win.cc +++ b/webkit/support/platform_support_win.cc @@ -69,7 +69,7 @@ void AfterShutdown() { } // namespace webkit_support -string16 TestWebKitPlatformSupport::GetLocalizedString(int message_id) { +base::string16 TestWebKitPlatformSupport::GetLocalizedString(int message_id) { wchar_t localized[MAX_LOADSTRING]; int length = ::LoadString(::GetModuleHandle(NULL), message_id, localized, MAX_LOADSTRING); @@ -77,7 +77,7 @@ string16 TestWebKitPlatformSupport::GetLocalizedString(int message_id) { NOTREACHED(); return L"No string for this identifier!"; } - return string16(localized, length); + return base::string16(localized, length); } base::StringPiece TestWebKitPlatformSupport::GetDataResource( diff --git a/webkit/support/simple_database_system.cc b/webkit/support/simple_database_system.cc index 88e088c..db20ebe 100644 --- a/webkit/support/simple_database_system.cc +++ b/webkit/support/simple_database_system.cc @@ -56,8 +56,9 @@ SimpleDatabaseSystem::~SimpleDatabaseSystem() { } void SimpleDatabaseSystem::databaseOpened(const WebKit::WebDatabase& database) { - string16 origin_identifier = database.securityOrigin().databaseIdentifier(); - string16 database_name = database.name(); + base::string16 origin_identifier = + database.securityOrigin().databaseIdentifier(); + base::string16 database_name = database.name(); open_connections_->AddOpenConnection(origin_identifier, database_name); db_thread_proxy_->PostTask( FROM_HERE, @@ -79,8 +80,9 @@ void SimpleDatabaseSystem::databaseModified( } void SimpleDatabaseSystem::databaseClosed(const WebKit::WebDatabase& database) { - string16 origin_identifier = database.securityOrigin().databaseIdentifier(); - string16 database_name = database.name(); + base::string16 origin_identifier = + database.securityOrigin().databaseIdentifier(); + base::string16 database_name = database.name(); db_thread_proxy_->PostTask( FROM_HERE, base::Bind(&SimpleDatabaseSystem::DatabaseClosed, @@ -88,7 +90,7 @@ void SimpleDatabaseSystem::databaseClosed(const WebKit::WebDatabase& database) { } base::PlatformFile SimpleDatabaseSystem::OpenFile( - const string16& vfs_file_name, int desired_flags) { + const base::string16& vfs_file_name, int desired_flags) { base::PlatformFile result = base::kInvalidPlatformFileValue; base::WaitableEvent done_event(false, false); db_thread_proxy_->PostTask( @@ -102,7 +104,7 @@ base::PlatformFile SimpleDatabaseSystem::OpenFile( } int SimpleDatabaseSystem::DeleteFile( - const string16& vfs_file_name, bool sync_dir) { + const base::string16& vfs_file_name, bool sync_dir) { int result = SQLITE_OK; base::WaitableEvent done_event(false, false); db_thread_proxy_->PostTask( @@ -115,7 +117,8 @@ int SimpleDatabaseSystem::DeleteFile( return result; } -uint32 SimpleDatabaseSystem::GetFileAttributes(const string16& vfs_file_name) { +uint32 SimpleDatabaseSystem::GetFileAttributes( + const base::string16& vfs_file_name) { uint32 result = 0; base::WaitableEvent done_event(false, false); db_thread_proxy_->PostTask( @@ -126,7 +129,7 @@ uint32 SimpleDatabaseSystem::GetFileAttributes(const string16& vfs_file_name) { return result; } -int64 SimpleDatabaseSystem::GetFileSize(const string16& vfs_file_name) { +int64 SimpleDatabaseSystem::GetFileSize(const base::string16& vfs_file_name) { int64 result = 0; base::WaitableEvent done_event(false, false); db_thread_proxy_->PostTask( @@ -138,7 +141,7 @@ int64 SimpleDatabaseSystem::GetFileSize(const string16& vfs_file_name) { } int64 SimpleDatabaseSystem::GetSpaceAvailable( - const string16& origin_identifier) { + const base::string16& origin_identifier) { int64 result = 0; base::WaitableEvent done_event(false, false); db_thread_proxy_->PostTask( @@ -168,10 +171,11 @@ void SimpleDatabaseSystem::SetDatabaseQuota(int64 quota) { quota_per_origin_ = quota; } -void SimpleDatabaseSystem::DatabaseOpened(const string16& origin_identifier, - const string16& database_name, - const string16& description, - int64 estimated_size) { +void SimpleDatabaseSystem::DatabaseOpened( + const base::string16& origin_identifier, + const base::string16& database_name, + const base::string16& description, + int64 estimated_size) { DCHECK(db_thread_proxy_->BelongsToCurrentThread()); int64 database_size = 0; db_tracker_->DatabaseOpened( @@ -181,22 +185,24 @@ void SimpleDatabaseSystem::DatabaseOpened(const string16& origin_identifier, database_size); } -void SimpleDatabaseSystem::DatabaseModified(const string16& origin_identifier, - const string16& database_name) { +void SimpleDatabaseSystem::DatabaseModified( + const base::string16& origin_identifier, + const base::string16& database_name) { DCHECK(db_thread_proxy_->BelongsToCurrentThread()); db_tracker_->DatabaseModified(origin_identifier, database_name); } -void SimpleDatabaseSystem::DatabaseClosed(const string16& origin_identifier, - const string16& database_name) { +void SimpleDatabaseSystem::DatabaseClosed( + const base::string16& origin_identifier, + const base::string16& database_name) { DCHECK(db_thread_proxy_->BelongsToCurrentThread()); db_tracker_->DatabaseClosed(origin_identifier, database_name); open_connections_->RemoveOpenConnection(origin_identifier, database_name); } void SimpleDatabaseSystem::OnDatabaseSizeChanged( - const string16& origin_identifier, - const string16& database_name, + const base::string16& origin_identifier, + const base::string16& database_name, int64 database_size) { DCHECK(db_thread_proxy_->BelongsToCurrentThread()); // We intentionally call into webkit on our background db_thread_ @@ -207,8 +213,8 @@ void SimpleDatabaseSystem::OnDatabaseSizeChanged( } void SimpleDatabaseSystem::OnDatabaseScheduledForDeletion( - const string16& origin_identifier, - const string16& database_name) { + const base::string16& origin_identifier, + const base::string16& database_name) { DCHECK(db_thread_proxy_->BelongsToCurrentThread()); // We intentionally call into webkit on our background db_thread_ // to better emulate what happens in chrome where this method is @@ -218,7 +224,7 @@ void SimpleDatabaseSystem::OnDatabaseScheduledForDeletion( } void SimpleDatabaseSystem::VfsOpenFile( - const string16& vfs_file_name, int desired_flags, + const base::string16& vfs_file_name, int desired_flags, base::PlatformFile* file_handle, base::WaitableEvent* done_event ) { DCHECK(db_thread_proxy_->BelongsToCurrentThread()); base::FilePath file_name = GetFullFilePathForVfsFile(vfs_file_name); @@ -232,7 +238,7 @@ void SimpleDatabaseSystem::VfsOpenFile( } void SimpleDatabaseSystem::VfsDeleteFile( - const string16& vfs_file_name, bool sync_dir, + const base::string16& vfs_file_name, bool sync_dir, int* result, base::WaitableEvent* done_event) { DCHECK(db_thread_proxy_->BelongsToCurrentThread()); // We try to delete the file multiple times, because that's what the default @@ -254,7 +260,7 @@ void SimpleDatabaseSystem::VfsDeleteFile( } void SimpleDatabaseSystem::VfsGetFileAttributes( - const string16& vfs_file_name, + const base::string16& vfs_file_name, uint32* result, base::WaitableEvent* done_event) { DCHECK(db_thread_proxy_->BelongsToCurrentThread()); *result = VfsBackend::GetFileAttributes( @@ -263,7 +269,7 @@ void SimpleDatabaseSystem::VfsGetFileAttributes( } void SimpleDatabaseSystem::VfsGetFileSize( - const string16& vfs_file_name, + const base::string16& vfs_file_name, int64* result, base::WaitableEvent* done_event) { DCHECK(db_thread_proxy_->BelongsToCurrentThread()); *result = VfsBackend::GetFileSize(GetFullFilePathForVfsFile(vfs_file_name)); @@ -271,7 +277,7 @@ void SimpleDatabaseSystem::VfsGetFileSize( } void SimpleDatabaseSystem::VfsGetSpaceAvailable( - const string16& origin_identifier, + const base::string16& origin_identifier, int64* result, base::WaitableEvent* done_event) { DCHECK(db_thread_proxy_->BelongsToCurrentThread()); // This method isn't actually part of the "vfs" interface, but it is @@ -288,7 +294,7 @@ void SimpleDatabaseSystem::VfsGetSpaceAvailable( } base::FilePath SimpleDatabaseSystem::GetFullFilePathForVfsFile( - const string16& vfs_file_name) { + const base::string16& vfs_file_name) { DCHECK(db_thread_proxy_->BelongsToCurrentThread()); if (vfs_file_name.empty()) // temp file, used for vacuuming return base::FilePath(); diff --git a/webkit/support/simple_database_system.h b/webkit/support/simple_database_system.h index 8a40c3f..000ff9c 100644 --- a/webkit/support/simple_database_system.h +++ b/webkit/support/simple_database_system.h @@ -39,11 +39,12 @@ class SimpleDatabaseSystem : public webkit_database::DatabaseTracker::Observer, // SQLite VFS related methods, these are called on webcore's // background database threads via the WebKitPlatformSupport impl. - base::PlatformFile OpenFile(const string16& vfs_file_name, int desired_flags); - int DeleteFile(const string16& vfs_file_name, bool sync_dir); - uint32 GetFileAttributes(const string16& vfs_file_name); - int64 GetFileSize(const string16& vfs_file_name); - int64 GetSpaceAvailable(const string16& origin_identifier); + base::PlatformFile OpenFile(const base::string16& vfs_file_name, + int desired_flags); + int DeleteFile(const base::string16& vfs_file_name, bool sync_dir); + uint32 GetFileAttributes(const base::string16& vfs_file_name); + int64 GetFileSize(const base::string16& vfs_file_name); + int64 GetSpaceAvailable(const base::string16& origin_identifier); // For use by testRunner, called on the main thread. void ClearAllDatabases(); @@ -51,36 +52,36 @@ class SimpleDatabaseSystem : public webkit_database::DatabaseTracker::Observer, private: // Used by our WebDatabaseObserver impl, only called on the db_thread - void DatabaseOpened(const string16& origin_identifier, - const string16& database_name, - const string16& description, + void DatabaseOpened(const base::string16& origin_identifier, + const base::string16& database_name, + const base::string16& description, int64 estimated_size); - void DatabaseModified(const string16& origin_identifier, - const string16& database_name); - void DatabaseClosed(const string16& origin_identifier, - const string16& database_name); + void DatabaseModified(const base::string16& origin_identifier, + const base::string16& database_name); + void DatabaseClosed(const base::string16& origin_identifier, + const base::string16& database_name); // DatabaseTracker::Observer implementation - virtual void OnDatabaseSizeChanged(const string16& origin_identifier, - const string16& database_name, + virtual void OnDatabaseSizeChanged(const base::string16& origin_identifier, + const base::string16& database_name, int64 database_size) OVERRIDE; virtual void OnDatabaseScheduledForDeletion( - const string16& origin_identifier, - const string16& database_name) OVERRIDE; + const base::string16& origin_identifier, + const base::string16& database_name) OVERRIDE; // Used by our public SQLite VFS methods, only called on the db_thread. - void VfsOpenFile(const string16& vfs_file_name, int desired_flags, + void VfsOpenFile(const base::string16& vfs_file_name, int desired_flags, base::PlatformFile* result, base::WaitableEvent* done_event); - void VfsDeleteFile(const string16& vfs_file_name, bool sync_dir, + void VfsDeleteFile(const base::string16& vfs_file_name, bool sync_dir, int* result, base::WaitableEvent* done_event); - void VfsGetFileAttributes(const string16& vfs_file_name, + void VfsGetFileAttributes(const base::string16& vfs_file_name, uint32* result, base::WaitableEvent* done_event); - void VfsGetFileSize(const string16& vfs_file_name, + void VfsGetFileSize(const base::string16& vfs_file_name, int64* result, base::WaitableEvent* done_event); - void VfsGetSpaceAvailable(const string16& origin_identifier, + void VfsGetSpaceAvailable(const base::string16& origin_identifier, int64* result, base::WaitableEvent* done_event); - base::FilePath GetFullFilePathForVfsFile(const string16& vfs_file_name); + base::FilePath GetFullFilePathForVfsFile(const base::string16& vfs_file_name); void ResetTracker(); void ThreadCleanup(base::WaitableEvent* done_event); diff --git a/webkit/support/test_webkit_platform_support.h b/webkit/support/test_webkit_platform_support.h index 38f1210..cefc62c 100644 --- a/webkit/support/test_webkit_platform_support.h +++ b/webkit/support/test_webkit_platform_support.h @@ -119,7 +119,7 @@ class TestWebKitPlatformSupport : virtual void sampleGamepads(WebKit::WebGamepads& data); void setGamepadData(const WebKit::WebGamepads& data); - virtual string16 GetLocalizedString(int message_id) OVERRIDE; + virtual base::string16 GetLocalizedString(int message_id) OVERRIDE; virtual base::StringPiece GetDataResource( int resource_id, ui::ScaleFactor scale_factor) OVERRIDE; |