diff options
author | Andras Becsi <andras.becsi@digia.com> | 2013-12-11 21:33:03 +0100 |
---|---|---|
committer | Andras Becsi <andras.becsi@digia.com> | 2013-12-13 12:34:07 +0100 |
commit | f2a33ff9cbc6d19943f1c7fbddd1f23d23975577 (patch) | |
tree | 0586a32aa390ade8557dfd6b4897f43a07449578 /chromium/webkit | |
parent | 5362912cdb5eea702b68ebe23702468d17c3017a (diff) | |
download | qtwebengine-chromium-f2a33ff9cbc6d19943f1c7fbddd1f23d23975577.tar.gz |
Update Chromium to branch 1650 (31.0.1650.63)
Change-Id: I57d8c832eaec1eb2364e0a8e7352a6dd354db99f
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'chromium/webkit')
267 files changed, 5170 insertions, 6280 deletions
diff --git a/chromium/webkit/browser/appcache/appcache_database.cc b/chromium/webkit/browser/appcache/appcache_database.cc index de7308425d0..68738d1dbee 100644 --- a/chromium/webkit/browser/appcache/appcache_database.cc +++ b/chromium/webkit/browser/appcache/appcache_database.cc @@ -21,8 +21,13 @@ namespace appcache { // Schema ------------------------------------------------------------------- namespace { +#if defined(APPCACHE_USE_SIMPLE_CACHE) +const int kCurrentVersion = 6; +const int kCompatibleVersion = 6; +#else const int kCurrentVersion = 5; const int kCompatibleVersion = 5; +#endif // A mechanism to run experiments that may affect in data being persisted // in different ways such that when the experiment is toggled on/off via @@ -1094,6 +1099,9 @@ bool AppCacheDatabase::CreateSchema() { } bool AppCacheDatabase::UpgradeSchema() { +#if defined(APPCACHE_USE_SIMPLE_CACHE) + return DeleteExistingAndCreateNewDatabase(); +#else if (meta_table_->GetVersionNumber() == 3) { // version 3 was pre 12/17/2011 DCHECK_EQ(strcmp(kNamespacesTable, kTables[3].table_name), 0); @@ -1170,6 +1178,7 @@ bool AppCacheDatabase::UpgradeSchema() { // If there is no upgrade path for the version on disk to the current // version, nuke everything and start over. return DeleteExistingAndCreateNewDatabase(); +#endif } void AppCacheDatabase::ResetConnectionAndTables() { diff --git a/chromium/webkit/browser/appcache/appcache_database_unittest.cc b/chromium/webkit/browser/appcache/appcache_database_unittest.cc index e67a68dafdb..9dc90808fec 100644 --- a/chromium/webkit/browser/appcache/appcache_database_unittest.cc +++ b/chromium/webkit/browser/appcache/appcache_database_unittest.cc @@ -668,6 +668,9 @@ TEST(AppCacheDatabaseTest, OriginUsage) { EXPECT_EQ(5000, usage_map[kOtherOrigin]); } +#if defined(APPCACHE_USE_SIMPLE_CACHE) +// There is no such upgrade path in this case. +#else TEST(AppCacheDatabaseTest, UpgradeSchema3to5) { // Real file on disk for this test. base::ScopedTempDir temp_dir; @@ -886,7 +889,11 @@ TEST(AppCacheDatabaseTest, UpgradeSchema3to5) { EXPECT_FALSE(fallbacks[i].namespace_.is_pattern); } } +#endif // !APPCACHE_USE_SIMPLE_CACHE +#if defined(APPCACHE_USE_SIMPLE_CACHE) +// There is no such upgrade path in this case. +#else TEST(AppCacheDatabaseTest, UpgradeSchema4to5) { // Real file on disk for this test. base::ScopedTempDir temp_dir; @@ -1124,5 +1131,6 @@ TEST(AppCacheDatabaseTest, UpgradeSchema4to5) { EXPECT_FALSE(whitelists[i].is_pattern); } } +#endif // !APPCACHE_USE_SIMPLE_CACHE } // namespace appcache diff --git a/chromium/webkit/browser/appcache/appcache_disk_cache.cc b/chromium/webkit/browser/appcache/appcache_disk_cache.cc index e486f1d7d6f..4aa3e8ef182 100644 --- a/chromium/webkit/browser/appcache/appcache_disk_cache.cc +++ b/chromium/webkit/browser/appcache/appcache_disk_cache.cc @@ -270,8 +270,13 @@ int AppCacheDiskCache::Init(net::CacheType cache_type, is_disabled_ = false; create_backend_callback_ = new CreateBackendCallbackShim(this); +#if defined(APPCACHE_USE_SIMPLE_CACHE) + const net::BackendType backend_type = net::CACHE_BACKEND_SIMPLE; +#else + const net::BackendType backend_type = net::CACHE_BACKEND_DEFAULT; +#endif int rv = disk_cache::CreateCacheBackend( - cache_type, net::CACHE_BACKEND_DEFAULT, cache_directory, cache_size, + cache_type, backend_type, cache_directory, cache_size, force, cache_thread, NULL, &(create_backend_callback_->backend_ptr_), base::Bind(&CreateBackendCallbackShim::Callback, create_backend_callback_)); diff --git a/chromium/webkit/browser/appcache/appcache_quota_client.cc b/chromium/webkit/browser/appcache/appcache_quota_client.cc index 7f2d647021c..fc8db6d5815 100644 --- a/chromium/webkit/browser/appcache/appcache_quota_client.cc +++ b/chromium/webkit/browser/appcache/appcache_quota_client.cc @@ -139,6 +139,10 @@ void AppCacheQuotaClient::DeleteOriginData(const GURL& origin, origin, GetServiceDeleteCallback()->callback()); } +bool AppCacheQuotaClient::DoesSupport(quota::StorageType type) const { + return type == quota::kStorageTypeTemporary; +} + void AppCacheQuotaClient::DidDeleteAppCachesForOrigin(int rv) { DCHECK(service_); if (quota_manager_is_destroyed_) diff --git a/chromium/webkit/browser/appcache/appcache_quota_client.h b/chromium/webkit/browser/appcache/appcache_quota_client.h index d2efb12ee67..c4901831e38 100644 --- a/chromium/webkit/browser/appcache/appcache_quota_client.h +++ b/chromium/webkit/browser/appcache/appcache_quota_client.h @@ -50,6 +50,7 @@ class AppCacheQuotaClient : public quota::QuotaClient { virtual void DeleteOriginData(const GURL& origin, quota::StorageType type, const DeletionCallback& callback) OVERRIDE; + virtual bool DoesSupport(quota::StorageType type) const OVERRIDE; private: friend class AppCacheService; // for NotifyAppCacheIsDestroyed diff --git a/chromium/webkit/browser/appcache/appcache_quota_client_unittest.cc b/chromium/webkit/browser/appcache/appcache_quota_client_unittest.cc index 9c7476a1697..5b7adeda009 100644 --- a/chromium/webkit/browser/appcache/appcache_quota_client_unittest.cc +++ b/chromium/webkit/browser/appcache/appcache_quota_client_unittest.cc @@ -6,8 +6,8 @@ #include <set> #include "base/bind.h" -#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_proxy.h" +#include "base/run_loop.h" #include "net/base/net_errors.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/appcache/appcache_quota_client.h" @@ -44,7 +44,7 @@ class AppCacheQuotaClientTest : public testing::Test { quota::StorageType type) { usage_ = -1; AsyncGetOriginUsage(client, origin, type); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); return usage_; } @@ -53,7 +53,7 @@ class AppCacheQuotaClientTest : public testing::Test { quota::StorageType type) { origins_.clear(); AsyncGetOriginsForType(client, type); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); return origins_; } @@ -63,7 +63,7 @@ class AppCacheQuotaClientTest : public testing::Test { const std::string& host) { origins_.clear(); AsyncGetOriginsForHost(client, type, host); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); return origins_; } @@ -73,7 +73,7 @@ class AppCacheQuotaClientTest : public testing::Test { const GURL& origin) { delete_status_ = quota::kQuotaStatusUnknown; AsyncDeleteOriginData(client, type, origin); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); return delete_status_; } @@ -315,7 +315,7 @@ TEST_F(AppCacheQuotaClientTest, PendingRequests) { EXPECT_EQ(0, num_get_origin_usage_completions_); EXPECT_EQ(0, num_get_origins_completions_); EXPECT_EQ(0, num_delete_origins_completions_); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, num_get_origin_usage_completions_); EXPECT_EQ(0, num_get_origins_completions_); EXPECT_EQ(0, num_delete_origins_completions_); @@ -325,7 +325,7 @@ TEST_F(AppCacheQuotaClientTest, PendingRequests) { EXPECT_EQ(2, num_get_origin_usage_completions_); EXPECT_EQ(4, num_get_origins_completions_); EXPECT_EQ(0, num_delete_origins_completions_); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(3, num_delete_origins_completions_); // deletes are really async // They should be serviced in order requested. @@ -354,7 +354,7 @@ TEST_F(AppCacheQuotaClientTest, DestroyServiceWithPending) { AsyncDeleteOriginData(client, kTemp, kOriginA); AsyncDeleteOriginData(client, kPerm, kOriginA); AsyncDeleteOriginData(client, kTemp, kOriginB); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, num_get_origin_usage_completions_); EXPECT_EQ(0, num_get_origins_completions_); EXPECT_EQ(0, num_delete_origins_completions_); @@ -390,7 +390,7 @@ TEST_F(AppCacheQuotaClientTest, DestroyQuotaManagerWithPending) { AsyncDeleteOriginData(client, kTemp, kOriginA); AsyncDeleteOriginData(client, kPerm, kOriginA); AsyncDeleteOriginData(client, kTemp, kOriginB); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, num_get_origin_usage_completions_); EXPECT_EQ(0, num_get_origins_completions_); EXPECT_EQ(0, num_delete_origins_completions_); @@ -400,7 +400,7 @@ TEST_F(AppCacheQuotaClientTest, DestroyQuotaManagerWithPending) { Call_NotifyAppCacheReady(client); // Callbacks should be deleted and not called. - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, num_get_origin_usage_completions_); EXPECT_EQ(0, num_get_origins_completions_); EXPECT_EQ(0, num_delete_origins_completions_); @@ -425,7 +425,7 @@ TEST_F(AppCacheQuotaClientTest, DestroyWithDeleteInProgress) { // A real completion callback from the service should // be dropped if it comes in after NotifyAppCacheDestroyed. - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(1, num_delete_origins_completions_); EXPECT_EQ(quota::kQuotaErrorAbort, delete_status_); diff --git a/chromium/webkit/browser/appcache/appcache_service_unittest.cc b/chromium/webkit/browser/appcache/appcache_service_unittest.cc index 41b6bc2c583..75817930630 100644 --- a/chromium/webkit/browser/appcache/appcache_service_unittest.cc +++ b/chromium/webkit/browser/appcache/appcache_service_unittest.cc @@ -6,8 +6,8 @@ #include "base/bind.h" #include "base/bind_helpers.h" -#include "base/message_loop/message_loop.h" #include "base/pickle.h" +#include "base/run_loop.h" #include "net/base/completion_callback.h" #include "net/base/io_buffer.h" #include "net/http/http_response_headers.h" @@ -184,7 +184,7 @@ TEST_F(AppCacheServiceTest, DeleteAppCachesForOrigin) { // Without giving mock storage simiulated info, should fail. service_->DeleteAppCachesForOrigin(kOrigin, deletion_callback_); EXPECT_EQ(0, delete_completion_count_); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(1, delete_completion_count_); EXPECT_EQ(net::ERR_FAILED, delete_result_); delete_completion_count_ = 0; @@ -193,7 +193,7 @@ TEST_F(AppCacheServiceTest, DeleteAppCachesForOrigin) { mock_storage()->SimulateGetAllInfo(new AppCacheInfoCollection); service_->DeleteAppCachesForOrigin(kOrigin, deletion_callback_); EXPECT_EQ(0, delete_completion_count_); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(1, delete_completion_count_); EXPECT_EQ(net::OK, delete_result_); delete_completion_count_ = 0; @@ -215,7 +215,7 @@ TEST_F(AppCacheServiceTest, DeleteAppCachesForOrigin) { mock_storage()->SimulateGetAllInfo(info.get()); service_->DeleteAppCachesForOrigin(kOrigin, deletion_callback_); EXPECT_EQ(0, delete_completion_count_); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(1, delete_completion_count_); EXPECT_EQ(net::OK, delete_result_); delete_completion_count_ = 0; @@ -226,7 +226,7 @@ TEST_F(AppCacheServiceTest, DeleteAppCachesForOrigin) { mock_storage()->SimulateMakeGroupObsoleteFailure(); service_->DeleteAppCachesForOrigin(kOrigin, deletion_callback_); EXPECT_EQ(0, delete_completion_count_); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(1, delete_completion_count_); EXPECT_EQ(net::ERR_FAILED, delete_result_); delete_completion_count_ = 0; @@ -242,7 +242,7 @@ TEST_F(AppCacheServiceTest, DeleteAppCachesForOrigin) { // Let any tasks lingering from the sudden deletion run and verify // no other completion calls occur. - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, delete_completion_count_); } @@ -250,7 +250,7 @@ TEST_F(AppCacheServiceTest, CheckAppCacheResponse) { // Check a non-existing manifest. EXPECT_FALSE(IsGroupStored(kManifestUrl)); service_->CheckAppCacheResponse(kManifestUrl, 1, 1); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, CountPendingHelpers()); EXPECT_FALSE(IsGroupStored(kManifestUrl)); ResetStorage(); @@ -261,7 +261,7 @@ TEST_F(AppCacheServiceTest, CheckAppCacheResponse) { EXPECT_TRUE(IsGroupStored(kManifestUrl)); SetupMockReader(true, true, true); service_->CheckAppCacheResponse(kManifestUrl, kMockCacheId, kMockResponseId); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, CountPendingHelpers()); EXPECT_TRUE(IsGroupStored(kManifestUrl)); ResetStorage(); @@ -271,7 +271,7 @@ TEST_F(AppCacheServiceTest, CheckAppCacheResponse) { SetupMockGroup(); service_->CheckAppCacheResponse(kManifestUrl, kMockCacheId, kMissingResponseId); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, CountPendingHelpers()); EXPECT_FALSE(IsGroupStored(kManifestUrl)); ResetStorage(); @@ -281,7 +281,7 @@ TEST_F(AppCacheServiceTest, CheckAppCacheResponse) { SetupMockGroup(); service_->CheckAppCacheResponse(kManifestUrl, kMissingCacheId, kMissingResponseId); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, CountPendingHelpers()); EXPECT_TRUE(IsGroupStored(kManifestUrl)); ResetStorage(); @@ -290,7 +290,7 @@ TEST_F(AppCacheServiceTest, CheckAppCacheResponse) { SetupMockGroup(); service_->CheckAppCacheResponse(kManifestUrl, kMockCacheId, kMockResponseId); SetupMockReader(false, true, true); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, CountPendingHelpers()); EXPECT_FALSE(IsGroupStored(kManifestUrl)); ResetStorage(); @@ -299,7 +299,7 @@ TEST_F(AppCacheServiceTest, CheckAppCacheResponse) { SetupMockGroup(); service_->CheckAppCacheResponse(kManifestUrl, kMockCacheId, kMockResponseId); SetupMockReader(true, false, true); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, CountPendingHelpers()); EXPECT_FALSE(IsGroupStored(kManifestUrl)); ResetStorage(); @@ -308,13 +308,13 @@ TEST_F(AppCacheServiceTest, CheckAppCacheResponse) { SetupMockGroup(); service_->CheckAppCacheResponse(kManifestUrl, kMockCacheId, kMockResponseId); SetupMockReader(true, true, false); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, CountPendingHelpers()); EXPECT_FALSE(IsGroupStored(kManifestUrl)); ResetStorage(); service_.reset(); // Clean up. - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } } // namespace appcache diff --git a/chromium/webkit/browser/appcache/mock_appcache_storage_unittest.cc b/chromium/webkit/browser/appcache/mock_appcache_storage_unittest.cc index 0ed9cd556bc..0e187bd2b3c 100644 --- a/chromium/webkit/browser/appcache/mock_appcache_storage_unittest.cc +++ b/chromium/webkit/browser/appcache/mock_appcache_storage_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/message_loop/message_loop.h" +#include "base/run_loop.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/appcache/appcache.h" #include "webkit/browser/appcache/appcache_group.h" @@ -87,7 +87,7 @@ TEST_F(MockAppCacheStorageTest, LoadCache_Miss) { MockStorageDelegate delegate; service.storage()->LoadCache(111, &delegate); EXPECT_NE(111, delegate.loaded_cache_id_); - base::MessageLoop::current()->RunUntilIdle(); // Do async task execution. + base::RunLoop().RunUntilIdle(); // Do async task execution. EXPECT_EQ(111, delegate.loaded_cache_id_); EXPECT_FALSE(delegate.loaded_cache_.get()); } @@ -121,7 +121,7 @@ TEST_F(MockAppCacheStorageTest, CreateGroup) { service.storage()->LoadOrCreateGroup(manifest_url, &delegate); EXPECT_NE(manifest_url, delegate.loaded_manifest_url_); EXPECT_FALSE(delegate.loaded_group_.get()); - base::MessageLoop::current()->RunUntilIdle(); // Do async task execution. + base::RunLoop().RunUntilIdle(); // Do async task execution. EXPECT_EQ(manifest_url, delegate.loaded_manifest_url_); EXPECT_TRUE(delegate.loaded_group_.get()); EXPECT_TRUE(delegate.loaded_group_->HasOneRef()); @@ -140,7 +140,7 @@ TEST_F(MockAppCacheStorageTest, LoadGroup_NearHit) { // to be "unstored" and "currently in use". GURL manifest_url("http://blah/"); service.storage()->LoadOrCreateGroup(manifest_url, &delegate); - base::MessageLoop::current()->RunUntilIdle(); // Do async task execution. + base::RunLoop().RunUntilIdle(); // Do async task execution. EXPECT_EQ(manifest_url, delegate.loaded_manifest_url_); EXPECT_TRUE(delegate.loaded_group_.get()); @@ -192,7 +192,7 @@ TEST_F(MockAppCacheStorageTest, LoadGroupAndCache_FarHit) { storage->LoadCache(cache_id, &delegate); EXPECT_NE(cache_id, delegate.loaded_cache_id_); EXPECT_NE(cache_ptr, delegate.loaded_cache_.get()); - base::MessageLoop::current()->RunUntilIdle(); // Do async task execution. + base::RunLoop().RunUntilIdle(); // Do async task execution. EXPECT_EQ(cache_id, delegate.loaded_cache_id_); EXPECT_EQ(cache_ptr, delegate.loaded_cache_.get()); delegate.loaded_cache_ = NULL; @@ -203,7 +203,7 @@ TEST_F(MockAppCacheStorageTest, LoadGroupAndCache_FarHit) { storage->LoadOrCreateGroup(manifest_url, &delegate); EXPECT_NE(manifest_url, delegate.loaded_manifest_url_); EXPECT_FALSE(delegate.loaded_group_.get()); - base::MessageLoop::current()->RunUntilIdle(); // Do async task execution. + base::RunLoop().RunUntilIdle(); // Do async task execution. EXPECT_EQ(manifest_url, delegate.loaded_manifest_url_); EXPECT_EQ(group_ptr, delegate.loaded_group_.get()); } @@ -232,7 +232,7 @@ TEST_F(MockAppCacheStorageTest, StoreNewGroup) { EXPECT_FALSE(delegate.stored_group_success_); EXPECT_TRUE(storage->stored_caches_.empty()); EXPECT_TRUE(storage->stored_groups_.empty()); - base::MessageLoop::current()->RunUntilIdle(); // Do async task execution. + base::RunLoop().RunUntilIdle(); // Do async task execution. EXPECT_TRUE(delegate.stored_group_success_); EXPECT_FALSE(storage->stored_caches_.empty()); EXPECT_FALSE(storage->stored_groups_.empty()); @@ -275,7 +275,7 @@ TEST_F(MockAppCacheStorageTest, StoreExistingGroup) { EXPECT_EQ(size_t(1), storage->stored_groups_.size()); EXPECT_TRUE(storage->IsCacheStored(old_cache.get())); EXPECT_FALSE(storage->IsCacheStored(new_cache.get())); - base::MessageLoop::current()->RunUntilIdle(); // Do async task execution. + base::RunLoop().RunUntilIdle(); // Do async task execution. EXPECT_TRUE(delegate.stored_group_success_); EXPECT_EQ(size_t(1), storage->stored_caches_.size()); EXPECT_EQ(size_t(1), storage->stored_groups_.size()); @@ -318,7 +318,7 @@ TEST_F(MockAppCacheStorageTest, StoreExistingGroupExistingCache) { EXPECT_FALSE(delegate.stored_group_success_); EXPECT_EQ(size_t(1), storage->stored_caches_.size()); EXPECT_EQ(size_t(1), storage->stored_groups_.size()); - base::MessageLoop::current()->RunUntilIdle(); // Do async task execution. + base::RunLoop().RunUntilIdle(); // Do async task execution. EXPECT_TRUE(delegate.stored_group_success_); EXPECT_EQ(size_t(1), storage->stored_caches_.size()); EXPECT_EQ(size_t(1), storage->stored_groups_.size()); @@ -359,7 +359,7 @@ TEST_F(MockAppCacheStorageTest, MakeGroupObsolete) { EXPECT_EQ(size_t(1), storage->stored_groups_.size()); EXPECT_FALSE(cache->HasOneRef()); EXPECT_FALSE(group->HasOneRef()); - base::MessageLoop::current()->RunUntilIdle(); // Do async task execution. + base::RunLoop().RunUntilIdle(); // Do async task execution. EXPECT_TRUE(delegate.obsoleted_success_); EXPECT_EQ(group.get(), delegate.obsoleted_group_.get()); EXPECT_TRUE(group->is_obsolete()); @@ -404,7 +404,7 @@ TEST_F(MockAppCacheStorageTest, FindNoMainResponse) { EXPECT_NE(url, delegate.found_url_); storage->FindResponseForMainRequest(url, GURL(), &delegate); EXPECT_NE(url, delegate.found_url_); - base::MessageLoop::current()->RunUntilIdle(); // Do async task execution. + base::RunLoop().RunUntilIdle(); // Do async task execution. EXPECT_EQ(url, delegate.found_url_); EXPECT_TRUE(delegate.found_manifest_url_.is_empty()); EXPECT_EQ(kNoCacheId, delegate.found_cache_id_); @@ -441,7 +441,7 @@ TEST_F(MockAppCacheStorageTest, BasicFindMainResponse) { EXPECT_NE(kEntryUrl, delegate.found_url_); storage->FindResponseForMainRequest(kEntryUrl, GURL(), &delegate); EXPECT_NE(kEntryUrl, delegate.found_url_); - base::MessageLoop::current()->RunUntilIdle(); // Do async task execution. + base::RunLoop().RunUntilIdle(); // Do async task execution. EXPECT_EQ(kEntryUrl, delegate.found_url_); EXPECT_EQ(kManifestUrl, delegate.found_manifest_url_); EXPECT_EQ(kCacheId, delegate.found_cache_id_); @@ -498,7 +498,7 @@ TEST_F(MockAppCacheStorageTest, BasicFindMainFallbackResponse) { EXPECT_NE(kTestUrl, delegate.found_url_); storage->FindResponseForMainRequest(kTestUrl, GURL(), &delegate); EXPECT_NE(kTestUrl, delegate.found_url_); - base::MessageLoop::current()->RunUntilIdle(); // Do async task execution. + base::RunLoop().RunUntilIdle(); // Do async task execution. EXPECT_EQ(kTestUrl, delegate.found_url_); EXPECT_EQ(kManifestUrl, delegate.found_manifest_url_); EXPECT_EQ(kCacheId, delegate.found_cache_id_); @@ -555,7 +555,7 @@ TEST_F(MockAppCacheStorageTest, FindMainResponseWithMultipleCandidates) { EXPECT_NE(kEntryUrl, delegate.found_url_); storage->FindResponseForMainRequest(kEntryUrl, GURL(), &delegate); EXPECT_NE(kEntryUrl, delegate.found_url_); - base::MessageLoop::current()->RunUntilIdle(); // Do async task execution. + base::RunLoop().RunUntilIdle(); // Do async task execution. EXPECT_EQ(kEntryUrl, delegate.found_url_); EXPECT_EQ(kManifestUrl2, delegate.found_manifest_url_); EXPECT_EQ(kCacheId2, delegate.found_cache_id_); @@ -602,7 +602,7 @@ TEST_F(MockAppCacheStorageTest, FindMainResponseExclusions) { EXPECT_NE(kEntryUrl, delegate.found_url_); storage->FindResponseForMainRequest(kEntryUrl, GURL(), &delegate); EXPECT_NE(kEntryUrl, delegate.found_url_); - base::MessageLoop::current()->RunUntilIdle(); // Do async task execution. + base::RunLoop().RunUntilIdle(); // Do async task execution. EXPECT_EQ(kEntryUrl, delegate.found_url_); EXPECT_TRUE(delegate.found_manifest_url_.is_empty()); EXPECT_EQ(kNoCacheId, delegate.found_cache_id_); @@ -616,7 +616,7 @@ TEST_F(MockAppCacheStorageTest, FindMainResponseExclusions) { EXPECT_NE(kOnlineNamespaceUrl, delegate.found_url_); storage->FindResponseForMainRequest(kOnlineNamespaceUrl, GURL(), &delegate); EXPECT_NE(kOnlineNamespaceUrl, delegate.found_url_); - base::MessageLoop::current()->RunUntilIdle(); // Do async task execution. + base::RunLoop().RunUntilIdle(); // Do async task execution. EXPECT_EQ(kOnlineNamespaceUrl, delegate.found_url_); EXPECT_TRUE(delegate.found_manifest_url_.is_empty()); EXPECT_EQ(kNoCacheId, delegate.found_cache_id_); diff --git a/chromium/webkit/browser/blob/blob_data_handle.h b/chromium/webkit/browser/blob/blob_data_handle.h index 25eeefe259f..5f870f2731a 100644 --- a/chromium/webkit/browser/blob/blob_data_handle.h +++ b/chromium/webkit/browser/blob/blob_data_handle.h @@ -43,6 +43,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobDataHandle BlobData* blob_data_; // Intentionally a raw ptr to a non-thread-safe ref. base::WeakPtr<BlobStorageContext> context_; scoped_refptr<base::SequencedTaskRunner> io_task_runner_; + + DISALLOW_COPY_AND_ASSIGN(BlobDataHandle); }; } // namespace webkit_blob diff --git a/chromium/webkit/browser/blob/blob_storage_context.cc b/chromium/webkit/browser/blob/blob_storage_context.cc index 4a0260736a0..34a1bee59df 100644 --- a/chromium/webkit/browser/blob/blob_storage_context.cc +++ b/chromium/webkit/browser/blob/blob_storage_context.cc @@ -94,6 +94,14 @@ scoped_ptr<BlobDataHandle> BlobStorageContext::AddFinishedBlob( return handle.Pass(); } +std::string BlobStorageContext::LookupUuidFromDeprecatedURL( + const GURL& url) { + BlobURLMap::const_iterator found = deprecated_blob_urls_.find(url); + if (found == deprecated_blob_urls_.end()) + return std::string(); + return found->second; +} + void BlobStorageContext::StartBuildingBlob(const std::string& uuid) { DCHECK(!IsInUse(uuid) && !uuid.empty()); blob_map_[uuid] = BlobMapEntry(1, BEING_BUILT, new BlobData(uuid)); @@ -146,7 +154,10 @@ void BlobStorageContext::AppendBlobDataItem( item.expected_modification_time()); break; case BlobData::Item::TYPE_BLOB: { - scoped_ptr<BlobDataHandle> src = GetBlobDataFromUUID(item.blob_uuid()); + scoped_ptr<BlobDataHandle> src = GetBlobDataFromUUID( + item.blob_uuid().empty() + ? LookupUuidFromDeprecatedURL(item.blob_url()) + : item.blob_uuid()); if (src) exceeded_memory = !ExpandStorageItems(target_blob_data, src->data(), @@ -222,6 +233,21 @@ void BlobStorageContext::RevokePublicBlobURL(const GURL& blob_url) { public_blob_urls_.erase(blob_url); } +void BlobStorageContext::DeprecatedRegisterPrivateBlobURL( + const GURL& url, const std::string& uuid) { + if (!IsInUse(uuid)) + return; + IncrementBlobRefCount(uuid); + deprecated_blob_urls_[url] = uuid; +} + +void BlobStorageContext::DeprecatedRevokePrivateBlobURL(const GURL& url) { + if (deprecated_blob_urls_.find(url) == deprecated_blob_urls_.end()) + return; + DecrementBlobRefCount(deprecated_blob_urls_[url]); + deprecated_blob_urls_.erase(url); +} + bool BlobStorageContext::ExpandStorageItems( BlobData* target_blob_data, BlobData* src_blob_data, uint64 offset, uint64 length) { diff --git a/chromium/webkit/browser/blob/blob_storage_context.h b/chromium/webkit/browser/blob/blob_storage_context.h index c9747aea3ed..eec1fee8c23 100644 --- a/chromium/webkit/browser/blob/blob_storage_context.h +++ b/chromium/webkit/browser/blob/blob_storage_context.h @@ -11,6 +11,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" +#include "webkit/browser/blob/blob_data_handle.h" #include "webkit/browser/webkit_storage_browser_export.h" #include "webkit/common/blob/blob_data.h" @@ -42,9 +43,13 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobStorageContext // blob cannot be added due to memory consumption, returns NULL. scoped_ptr<BlobDataHandle> AddFinishedBlob(const BlobData* blob_data); + // Temporary support for mapping oldstyle blobUrls to new style uuids. + std::string LookupUuidFromDeprecatedURL(const GURL& url); + private: friend class BlobDataHandle; friend class BlobStorageHost; + friend class ViewBlobInternalsJob; enum EntryFlags { BEING_BUILT = 1 << 0, @@ -75,6 +80,11 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobStorageContext void RegisterPublicBlobURL(const GURL& url, const std::string& uuid); void RevokePublicBlobURL(const GURL& url); + // Temporary support for mapping old style blobUrls to new style uuids. + void DeprecatedRegisterPrivateBlobURL(const GURL& url, + const std::string& uuid); + void DeprecatedRevokePrivateBlobURL(const GURL& url); + bool ExpandStorageItems(BlobData* target_blob_data, BlobData* src_blob_data, uint64 offset, @@ -96,6 +106,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobStorageContext BlobMap blob_map_; BlobURLMap public_blob_urls_; + BlobURLMap deprecated_blob_urls_; // Used to keep track of how much memory is being utitlized for blob data, // we count only the items of TYPE_DATA which are held in memory and not diff --git a/chromium/webkit/browser/blob/blob_storage_context_unittest.cc b/chromium/webkit/browser/blob/blob_storage_context_unittest.cc index 5ce15455ed7..e2c115c21a1 100644 --- a/chromium/webkit/browser/blob/blob_storage_context_unittest.cc +++ b/chromium/webkit/browser/blob/blob_storage_context_unittest.cc @@ -203,4 +203,6 @@ TEST(BlobStorageContextTest, EarlyContextDeletion) { EXPECT_FALSE(host.RevokePublicBlobURL(kUrl)); } +// TODO(michaeln): tests for the depcrecated url stuff + } // namespace webkit_blob diff --git a/chromium/webkit/browser/blob/blob_storage_controller.cc b/chromium/webkit/browser/blob/blob_storage_controller.cc deleted file mode 100644 index f5dd60ec99e..00000000000 --- a/chromium/webkit/browser/blob/blob_storage_controller.cc +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/browser/blob/blob_storage_controller.h" - -#include "base/logging.h" -#include "url/gurl.h" -#include "webkit/common/blob/blob_data.h" - -namespace webkit_blob { - -namespace { - -// We can't use GURL directly for these hash fragment manipulations -// since it doesn't have specific knowlege of the BlobURL format. GURL -// treats BlobURLs as if they were PathURLs which don't support hash -// fragments. - -bool BlobUrlHasRef(const GURL& url) { - return url.spec().find('#') != std::string::npos; -} - -GURL ClearBlobUrlRef(const GURL& url) { - size_t hash_pos = url.spec().find('#'); - if (hash_pos == std::string::npos) - return url; - return GURL(url.spec().substr(0, hash_pos)); -} - -static const int64 kMaxMemoryUsage = 1024 * 1024 * 1024; // 1G - -} // namespace - -BlobStorageController::BlobStorageController() - : memory_usage_(0) { -} - -BlobStorageController::~BlobStorageController() { -} - -void BlobStorageController::StartBuildingBlob(const GURL& url) { - DCHECK(url.SchemeIs("blob")); - DCHECK(!BlobUrlHasRef(url)); - BlobData* blob_data = new BlobData; - unfinalized_blob_map_[url.spec()] = blob_data; - IncrementBlobDataUsage(blob_data); -} - -void BlobStorageController::AppendBlobDataItem( - const GURL& url, const BlobData::Item& item) { - DCHECK(url.SchemeIs("blob")); - DCHECK(!BlobUrlHasRef(url)); - BlobMap::iterator found = unfinalized_blob_map_.find(url.spec()); - if (found == unfinalized_blob_map_.end()) - return; - BlobData* target_blob_data = found->second.get(); - DCHECK(target_blob_data); - - memory_usage_ -= target_blob_data->GetMemoryUsage(); - - // The blob data is stored in the "canonical" way. That is, it only contains a - // list of Data and File items. - // 1) The Data item is denoted by the raw data and the range. - // 2) The File item is denoted by the file path, the range and the expected - // modification time. - // 3) The FileSystem File item is denoted by the FileSystem URL, the range - // and the expected modification time. - // All the Blob items in the passing blob data are resolved and expanded into - // a set of Data and File items. - - DCHECK(item.length() > 0); - switch (item.type()) { - case BlobData::Item::TYPE_BYTES: - DCHECK(!item.offset()); - target_blob_data->AppendData(item.bytes(), item.length()); - break; - case BlobData::Item::TYPE_FILE: - AppendFileItem(target_blob_data, - item.path(), - item.offset(), - item.length(), - item.expected_modification_time()); - break; - case BlobData::Item::TYPE_FILE_FILESYSTEM: - AppendFileSystemFileItem(target_blob_data, - item.url(), - item.offset(), - item.length(), - item.expected_modification_time()); - break; - case BlobData::Item::TYPE_BLOB: { - BlobData* src_blob_data = GetBlobDataFromUrl(item.url()); - DCHECK(src_blob_data); - if (src_blob_data) - AppendStorageItems(target_blob_data, - src_blob_data, - item.offset(), - item.length()); - break; - } - default: - NOTREACHED(); - break; - } - - memory_usage_ += target_blob_data->GetMemoryUsage(); - - // If we're using too much memory, drop this blob. - // TODO(michaeln): Blob memory storage does not yet spill over to disk, - // until it does, we'll prevent memory usage over a max amount. - if (memory_usage_ > kMaxMemoryUsage) - RemoveBlob(url); -} - -void BlobStorageController::FinishBuildingBlob( - const GURL& url, const std::string& content_type) { - DCHECK(url.SchemeIs("blob")); - DCHECK(!BlobUrlHasRef(url)); - BlobMap::iterator found = unfinalized_blob_map_.find(url.spec()); - if (found == unfinalized_blob_map_.end()) - return; - found->second->set_content_type(content_type); - blob_map_[url.spec()] = found->second; - unfinalized_blob_map_.erase(found); -} - -void BlobStorageController::AddFinishedBlob(const GURL& url, - const BlobData* data) { - StartBuildingBlob(url); - for (std::vector<BlobData::Item>::const_iterator iter = - data->items().begin(); - iter != data->items().end(); ++iter) { - AppendBlobDataItem(url, *iter); - } - FinishBuildingBlob(url, data->content_type()); -} - -void BlobStorageController::CloneBlob( - const GURL& url, const GURL& src_url) { - DCHECK(url.SchemeIs("blob")); - DCHECK(!BlobUrlHasRef(url)); - - BlobData* blob_data = GetBlobDataFromUrl(src_url); - DCHECK(blob_data); - if (!blob_data) - return; - - blob_map_[url.spec()] = blob_data; - IncrementBlobDataUsage(blob_data); -} - -void BlobStorageController::RemoveBlob(const GURL& url) { - DCHECK(url.SchemeIs("blob")); - DCHECK(!BlobUrlHasRef(url)); - - if (!RemoveFromMapHelper(&unfinalized_blob_map_, url)) - RemoveFromMapHelper(&blob_map_, url); -} - -bool BlobStorageController::RemoveFromMapHelper( - BlobMap* map, const GURL& url) { - BlobMap::iterator found = map->find(url.spec()); - if (found == map->end()) - return false; - if (DecrementBlobDataUsage(found->second.get())) - memory_usage_ -= found->second->GetMemoryUsage(); - map->erase(found); - return true; -} - - -BlobData* BlobStorageController::GetBlobDataFromUrl(const GURL& url) { - BlobMap::iterator found = blob_map_.find( - BlobUrlHasRef(url) ? ClearBlobUrlRef(url).spec() : url.spec()); - return (found != blob_map_.end()) ? found->second.get() : NULL; -} - -void BlobStorageController::AppendStorageItems( - BlobData* target_blob_data, BlobData* src_blob_data, - uint64 offset, uint64 length) { - DCHECK(target_blob_data && src_blob_data && - length != static_cast<uint64>(-1)); - - std::vector<BlobData::Item>::const_iterator iter = - src_blob_data->items().begin(); - if (offset) { - for (; iter != src_blob_data->items().end(); ++iter) { - if (offset >= iter->length()) - offset -= iter->length(); - else - break; - } - } - - for (; iter != src_blob_data->items().end() && length > 0; ++iter) { - uint64 current_length = iter->length() - offset; - uint64 new_length = current_length > length ? length : current_length; - if (iter->type() == BlobData::Item::TYPE_BYTES) { - target_blob_data->AppendData( - iter->bytes() + static_cast<size_t>(iter->offset() + offset), - static_cast<uint32>(new_length)); - } else if (iter->type() == BlobData::Item::TYPE_FILE) { - AppendFileItem(target_blob_data, - iter->path(), - iter->offset() + offset, - new_length, - iter->expected_modification_time()); - } else { - DCHECK(iter->type() == BlobData::Item::TYPE_FILE_FILESYSTEM); - AppendFileSystemFileItem(target_blob_data, - iter->url(), - iter->offset() + offset, - new_length, - iter->expected_modification_time()); - } - length -= new_length; - offset = 0; - } -} - -void BlobStorageController::AppendFileItem( - BlobData* target_blob_data, - const base::FilePath& file_path, uint64 offset, uint64 length, - const base::Time& expected_modification_time) { - target_blob_data->AppendFile(file_path, offset, length, - expected_modification_time); - - // It may be a temporary file that should be deleted when no longer needed. - scoped_refptr<ShareableFileReference> shareable_file = - ShareableFileReference::Get(file_path); - if (shareable_file.get()) - target_blob_data->AttachShareableFileReference(shareable_file.get()); -} - -void BlobStorageController::AppendFileSystemFileItem( - BlobData* target_blob_data, - const GURL& url, uint64 offset, uint64 length, - const base::Time& expected_modification_time) { - target_blob_data->AppendFileSystemFile(url, offset, length, - expected_modification_time); -} - -void BlobStorageController::IncrementBlobDataUsage(BlobData* blob_data) { - blob_data_usage_count_[blob_data] += 1; -} - -bool BlobStorageController::DecrementBlobDataUsage(BlobData* blob_data) { - BlobDataUsageMap::iterator found = blob_data_usage_count_.find(blob_data); - DCHECK(found != blob_data_usage_count_.end()); - if (--(found->second)) - return false; // Still in use - blob_data_usage_count_.erase(found); - return true; -} - -} // namespace webkit_blob diff --git a/chromium/webkit/browser/blob/blob_storage_controller.h b/chromium/webkit/browser/blob/blob_storage_controller.h deleted file mode 100644 index 03dfb08045b..00000000000 --- a/chromium/webkit/browser/blob/blob_storage_controller.h +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_BROWSER_BLOB_BLOB_STORAGE_CONTROLLER_H_ -#define WEBKIT_BROWSER_BLOB_BLOB_STORAGE_CONTROLLER_H_ - -#include <map> -#include <string> - -#include "base/containers/hash_tables.h" -#include "base/memory/ref_counted.h" -#include "base/process/process.h" -#include "webkit/browser/webkit_storage_browser_export.h" -#include "webkit/common/blob/blob_data.h" - -class GURL; - -namespace base { -class FilePath; -class Time; -} - -namespace webkit_blob { - -// This class handles the logistics of blob Storage within the browser process. -class WEBKIT_STORAGE_BROWSER_EXPORT BlobStorageController { - public: - BlobStorageController(); - ~BlobStorageController(); - - void StartBuildingBlob(const GURL& url); - void AppendBlobDataItem(const GURL& url, const BlobData::Item& data_item); - void FinishBuildingBlob(const GURL& url, const std::string& content_type); - void AddFinishedBlob(const GURL& url, const BlobData* blob_data); - void CloneBlob(const GURL& url, const GURL& src_url); - void RemoveBlob(const GURL& url); - BlobData* GetBlobDataFromUrl(const GURL& url); - - private: - friend class ViewBlobInternalsJob; - - typedef base::hash_map<std::string, scoped_refptr<BlobData> > BlobMap; - typedef std::map<BlobData*, int> BlobDataUsageMap; - - void AppendStorageItems(BlobData* target_blob_data, - BlobData* src_blob_data, - uint64 offset, - uint64 length); - void AppendFileItem(BlobData* target_blob_data, - const base::FilePath& file_path, uint64 offset, - uint64 length, - const base::Time& expected_modification_time); - void AppendFileSystemFileItem( - BlobData* target_blob_data, - const GURL& url, uint64 offset, uint64 length, - const base::Time& expected_modification_time); - - bool RemoveFromMapHelper(BlobMap* map, const GURL& url); - - void IncrementBlobDataUsage(BlobData* blob_data); - // Returns true if no longer in use. - bool DecrementBlobDataUsage(BlobData* blob_data); - - BlobMap blob_map_; - BlobMap unfinalized_blob_map_; - - // Used to keep track of how much memory is being utitlized for blob data, - // we count only the items of TYPE_DATA which are held in memory and not - // items of TYPE_FILE. - int64 memory_usage_; - - // Multiple urls can refer to the same blob data, this map keeps track of - // how many urls refer to a BlobData. - BlobDataUsageMap blob_data_usage_count_; - - DISALLOW_COPY_AND_ASSIGN(BlobStorageController); -}; - -} // namespace webkit_blob - -#endif // WEBKIT_BROWSER_BLOB_BLOB_STORAGE_CONTROLLER_H_ diff --git a/chromium/webkit/browser/blob/blob_storage_controller_unittest.cc b/chromium/webkit/browser/blob/blob_storage_controller_unittest.cc deleted file mode 100644 index fbef876a57c..00000000000 --- a/chromium/webkit/browser/blob/blob_storage_controller_unittest.cc +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/files/file_path.h" -#include "base/memory/ref_counted.h" -#include "base/memory/scoped_ptr.h" -#include "base/time/time.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/blob/blob_storage_controller.h" -#include "webkit/common/blob/blob_data.h" - -namespace webkit_blob { - -TEST(BlobStorageControllerTest, RegisterBlobUrl) { - // Setup a set of blob data for testing. - base::Time time1, time2; - base::Time::FromString("Tue, 15 Nov 1994, 12:45:26 GMT", &time1); - base::Time::FromString("Mon, 14 Nov 1994, 11:30:49 GMT", &time2); - - scoped_refptr<BlobData> blob_data1(new BlobData()); - blob_data1->AppendData("Data1"); - blob_data1->AppendData("Data2"); - blob_data1->AppendFile(base::FilePath(FILE_PATH_LITERAL("File1.txt")), - 10, 1024, time1); - - scoped_refptr<BlobData> blob_data2(new BlobData()); - blob_data2->AppendData("Data3"); - blob_data2->AppendBlob(GURL("blob://url_1"), 8, 100); - blob_data2->AppendFile(base::FilePath(FILE_PATH_LITERAL("File2.txt")), - 0, 20, time2); - - scoped_refptr<BlobData> canonicalized_blob_data2(new BlobData()); - canonicalized_blob_data2->AppendData("Data3"); - canonicalized_blob_data2->AppendData("a2___", 2); - canonicalized_blob_data2->AppendFile( - base::FilePath(FILE_PATH_LITERAL("File1.txt")), - 10, 98, time1); - canonicalized_blob_data2->AppendFile( - base::FilePath(FILE_PATH_LITERAL("File2.txt")), 0, 20, time2); - - BlobStorageController blob_storage_controller; - - // Test registering a blob URL referring to the blob data containing only - // data and file. - GURL blob_url1("blob://url_1"); - blob_storage_controller.AddFinishedBlob(blob_url1, blob_data1.get()); - - BlobData* blob_data_found = - blob_storage_controller.GetBlobDataFromUrl(blob_url1); - ASSERT_TRUE(blob_data_found != NULL); - EXPECT_TRUE(*blob_data_found == *blob_data1.get()); - - // Test registering a blob URL referring to the blob data containing data, - // file and blob. - GURL blob_url2("blob://url_2"); - blob_storage_controller.AddFinishedBlob(blob_url2, blob_data2.get()); - - blob_data_found = blob_storage_controller.GetBlobDataFromUrl(blob_url2); - ASSERT_TRUE(blob_data_found != NULL); - EXPECT_TRUE(*blob_data_found == *canonicalized_blob_data2.get()); - - // Test registering a blob URL referring to existent blob URL. - GURL blob_url3("blob://url_3"); - blob_storage_controller.CloneBlob(blob_url3, blob_url1); - - blob_data_found = blob_storage_controller.GetBlobDataFromUrl(blob_url3); - ASSERT_TRUE(blob_data_found != NULL); - EXPECT_TRUE(*blob_data_found == *blob_data1.get()); - - // Test unregistering a blob URL. - blob_storage_controller.RemoveBlob(blob_url3); - blob_data_found = blob_storage_controller.GetBlobDataFromUrl(blob_url3); - EXPECT_TRUE(!blob_data_found); -} - -} // namespace webkit_blob diff --git a/chromium/webkit/browser/blob/blob_storage_host.cc b/chromium/webkit/browser/blob/blob_storage_host.cc index eebf3fbace7..9d3ddb959f6 100644 --- a/chromium/webkit/browser/blob/blob_storage_host.cc +++ b/chromium/webkit/browser/blob/blob_storage_host.cc @@ -5,6 +5,7 @@ #include "webkit/browser/blob/blob_storage_host.h" #include "base/sequenced_task_runner.h" +#include "base/strings/string_util.h" #include "url/gurl.h" #include "webkit/browser/blob/blob_data_handle.h" #include "webkit/browser/blob/blob_storage_context.h" @@ -27,6 +28,10 @@ BlobStorageHost::~BlobStorageHost() { for (int i = 0; i < iter->second; ++i) context_->DecrementBlobRefCount(iter->first); } + for (std::set<GURL>::iterator iter = private_blob_urls_.begin(); + iter != private_blob_urls_.end(); ++iter) { + context_->DeprecatedRevokePrivateBlobURL(*iter); + } } bool BlobStorageHost::StartBuildingBlob(const std::string& uuid) { @@ -98,6 +103,56 @@ bool BlobStorageHost::RevokePublicBlobURL(const GURL& blob_url) { return true; } +namespace { +bool IsPrivateBlobURL(const GURL& url) { + return StartsWithASCII(url.spec(), "blob:blobinternal", true); +} +} + +void BlobStorageHost::DeprecatedRegisterBlobURL( + const GURL& private_url, const std::string& uuid) { + DCHECK(IsPrivateBlobURL(private_url)); + if (!context_.get()) + return; + context_->DeprecatedRegisterPrivateBlobURL(private_url, uuid); + private_blob_urls_.insert(private_url); +} + +void BlobStorageHost::DeprecatedCloneBlobURL( + const GURL& url, const GURL& src_private_url) { + // This method is used in two ways. + // 1. During serialization/deserialization to 'clone' an existing blob. + // In this case the src and dest urls are 'private' blob urls. + // 2. To register public blob urls. In this case the dest url is a + // 'public' blob url. + DCHECK(IsPrivateBlobURL(src_private_url)); + if (!context_.get()) + return; + std::string uuid = context_->LookupUuidFromDeprecatedURL(src_private_url); + if (uuid.empty()) + return; + if (IsPrivateBlobURL(url)) { + DeprecatedRegisterBlobURL(url, uuid); + } else { + // Temporarily bump the refcount so the uuid passes the InUse + // check inside the RegisterPublicBlobURL method. + ignore_result(IncrementBlobRefCount(uuid)); + ignore_result(RegisterPublicBlobURL(url, uuid)); + ignore_result(DecrementBlobRefCount(uuid)); + } +} + +void BlobStorageHost::DeprecatedRevokeBlobURL(const GURL& url) { + if (!context_.get()) + return; + if (IsPrivateBlobURL(url)) { + context_->DeprecatedRevokePrivateBlobURL(url); + private_blob_urls_.erase(url); + } else { + ignore_result(RevokePublicBlobURL(url)); + } +} + bool BlobStorageHost::IsInUseInHost(const std::string& uuid) { return blobs_inuse_map_.find(uuid) != blobs_inuse_map_.end(); } diff --git a/chromium/webkit/browser/blob/blob_storage_host.h b/chromium/webkit/browser/blob/blob_storage_host.h index 954c32ce400..890db3a7448 100644 --- a/chromium/webkit/browser/blob/blob_storage_host.h +++ b/chromium/webkit/browser/blob/blob_storage_host.h @@ -47,6 +47,13 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobStorageHost { const std::string& uuid) WARN_UNUSED_RESULT; bool RevokePublicBlobURL(const GURL& blob_url) WARN_UNUSED_RESULT; + // Temporary support for mapping old style private blob urls to uuids. + void DeprecatedRegisterBlobURL(const GURL& private_url, + const std::string& uuid); + void DeprecatedCloneBlobURL(const GURL& url, + const GURL& src_private_url); + void DeprecatedRevokeBlobURL(const GURL& url); + private: typedef std::map<std::string, int> BlobReferenceMap; @@ -61,7 +68,12 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobStorageHost { // The set of public blob urls coined by this consumer. std::set<GURL> public_blob_urls_; + // And private deprecated blob urls. + std::set<GURL> private_blob_urls_; + base::WeakPtr<BlobStorageContext> context_; + + DISALLOW_COPY_AND_ASSIGN(BlobStorageHost); }; } // namespace webkit_blob diff --git a/chromium/webkit/browser/blob/blob_url_request_job.cc b/chromium/webkit/browser/blob/blob_url_request_job.cc index a845fc94a4a..8f27edee6a8 100644 --- a/chromium/webkit/browser/blob/blob_url_request_job.cc +++ b/chromium/webkit/browser/blob/blob_url_request_job.cc @@ -24,7 +24,7 @@ #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_error_job.h" #include "net/url_request/url_request_status.h" -#include "webkit/browser/blob/local_file_stream_reader.h" +#include "webkit/browser/blob/file_stream_reader.h" #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_url.h" @@ -551,14 +551,16 @@ void BlobURLRequestJob::CreateFileStreamReader(size_t index, FileStreamReader* reader = NULL; switch (item.type()) { case BlobData::Item::TYPE_FILE: - reader = new LocalFileStreamReader(file_thread_proxy_.get(), - item.path(), - item.offset() + additional_offset, - item.expected_modification_time()); + reader = FileStreamReader::CreateForLocalFile( + file_thread_proxy_.get(), + item.path(), + item.offset() + additional_offset, + item.expected_modification_time()); break; case BlobData::Item::TYPE_FILE_FILESYSTEM: reader = file_system_context_->CreateFileStreamReader( - fileapi::FileSystemURL(file_system_context_->CrackURL(item.url())), + fileapi::FileSystemURL( + file_system_context_->CrackURL(item.filesystem_url())), item.offset() + additional_offset, item.expected_modification_time()).release(); break; diff --git a/chromium/webkit/browser/blob/blob_url_request_job_factory.cc b/chromium/webkit/browser/blob/blob_url_request_job_factory.cc index cc600d1c228..71fad4926fe 100644 --- a/chromium/webkit/browser/blob/blob_url_request_job_factory.cc +++ b/chromium/webkit/browser/blob/blob_url_request_job_factory.cc @@ -7,45 +7,77 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/message_loop/message_loop_proxy.h" -#include "net/url_request/url_request.h" +#include "net/url_request/url_request_context.h" #include "net/url_request/url_request_job_factory.h" -#include "webkit/browser/blob/blob_storage_controller.h" +#include "webkit/browser/blob/blob_data_handle.h" +#include "webkit/browser/blob/blob_storage_context.h" #include "webkit/browser/blob/blob_url_request_job.h" #include "webkit/browser/fileapi/file_system_context.h" namespace webkit_blob { +namespace { + +int kUserDataKey; // The value is not important, the addr is a key. + +BlobDataHandle* GetRequestedBlobDataHandle(net::URLRequest* request) { + return static_cast<BlobDataHandle*>(request->GetUserData(&kUserDataKey)); +} + +} // namespace + +// static +net::URLRequest* BlobProtocolHandler::CreateBlobRequest( + scoped_ptr<BlobDataHandle> blob_data_handle, + const net::URLRequestContext* request_context, + net::URLRequest::Delegate* request_delegate) { + const GURL kBlobUrl("blob://see_user_data/"); + net::URLRequest* request = request_context->CreateRequest( + kBlobUrl, request_delegate); + SetRequestedBlobDataHandle(request, blob_data_handle.Pass()); + return request; +} + +// static +void BlobProtocolHandler::SetRequestedBlobDataHandle( + net::URLRequest* request, + scoped_ptr<BlobDataHandle> blob_data_handle) { + request->SetUserData(&kUserDataKey, blob_data_handle.release()); +} + BlobProtocolHandler::BlobProtocolHandler( - webkit_blob::BlobStorageController* blob_storage_controller, + BlobStorageContext* context, fileapi::FileSystemContext* file_system_context, base::MessageLoopProxy* loop_proxy) - : blob_storage_controller_(blob_storage_controller), - file_system_context_(file_system_context), + : file_system_context_(file_system_context), file_loop_proxy_(loop_proxy) { - DCHECK(blob_storage_controller_); - DCHECK(file_system_context_.get()); - DCHECK(file_loop_proxy_.get()); + if (context) + context_ = context->AsWeakPtr(); } -BlobProtocolHandler::~BlobProtocolHandler() {} +BlobProtocolHandler::~BlobProtocolHandler() { +} net::URLRequestJob* BlobProtocolHandler::MaybeCreateJob( net::URLRequest* request, net::NetworkDelegate* network_delegate) const { - scoped_refptr<webkit_blob::BlobData> data = LookupBlobData(request); - if (!data.get()) { - // This request is not coming through resource dispatcher host. - data = blob_storage_controller_->GetBlobDataFromUrl(request->url()); - } - return new webkit_blob::BlobURLRequestJob(request, - network_delegate, - data.get(), - file_system_context_.get(), - file_loop_proxy_.get()); + return new webkit_blob::BlobURLRequestJob( + request, network_delegate, LookupBlobData(request), + file_system_context_, file_loop_proxy_); } scoped_refptr<webkit_blob::BlobData> BlobProtocolHandler::LookupBlobData(net::URLRequest* request) const { - return NULL; + BlobDataHandle* blob_data_handle = GetRequestedBlobDataHandle(request); + if (blob_data_handle) + return blob_data_handle->data(); + if (!context_.get()) + return NULL; + + // Retain support for looking up based on deprecated blob urls for now. + // The FeedbackExtensionAPI relies on this. + scoped_ptr<BlobDataHandle> handle = context_->GetBlobDataFromUUID( + context_->LookupUuidFromDeprecatedURL(request->url())); + return handle.get() ? handle->data() : NULL; } } // namespace webkit_blob diff --git a/chromium/webkit/browser/blob/blob_url_request_job_factory.h b/chromium/webkit/browser/blob/blob_url_request_job_factory.h index 2a78c95d1a6..88ccc64dd6c 100644 --- a/chromium/webkit/browser/blob/blob_url_request_job_factory.h +++ b/chromium/webkit/browser/blob/blob_url_request_job_factory.h @@ -7,6 +7,8 @@ #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" +#include "base/memory/scoped_ptr.h" +#include "net/url_request/url_request.h" #include "net/url_request/url_request_job_factory.h" #include "webkit/browser/webkit_storage_browser_export.h" @@ -19,19 +21,31 @@ class FileSystemContext; } // namespace fileapi namespace net { -class URLRequest; +class URLRequestContext; } // namespace net namespace webkit_blob { class BlobData; -class BlobStorageController; +class BlobDataHandle; +class BlobStorageContext; class WEBKIT_STORAGE_BROWSER_EXPORT BlobProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { public: - // |controller|'s lifetime should exceed the lifetime of the ProtocolHandler. - BlobProtocolHandler(BlobStorageController* blob_storage_controller, + // A helper to manufacture an URLRequest to retrieve the given blob. + static net::URLRequest* CreateBlobRequest( + scoped_ptr<BlobDataHandle> blob_data_handle, + const net::URLRequestContext* request_context, + net::URLRequest::Delegate* request_delegate); + + // This class ignores the request's URL and uses the value given + // to SetRequestedBlobDataHandle instead. + static void SetRequestedBlobDataHandle( + net::URLRequest* request, + scoped_ptr<BlobDataHandle> blob_data_handle); + + BlobProtocolHandler(BlobStorageContext* context, fileapi::FileSystemContext* file_system_context, base::MessageLoopProxy* file_loop_proxy); virtual ~BlobProtocolHandler(); @@ -41,12 +55,10 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobProtocolHandler net::NetworkDelegate* network_delegate) const OVERRIDE; private: - virtual scoped_refptr<BlobData> LookupBlobData( + scoped_refptr<BlobData> LookupBlobData( net::URLRequest* request) const; - // No scoped_refptr because |blob_storage_controller_| is owned by the - // ProfileIOData, which also owns this ProtocolHandler. - BlobStorageController* const blob_storage_controller_; + base::WeakPtr<BlobStorageContext> context_; const scoped_refptr<fileapi::FileSystemContext> file_system_context_; const scoped_refptr<base::MessageLoopProxy> file_loop_proxy_; diff --git a/chromium/webkit/browser/blob/blob_url_request_job_unittest.cc b/chromium/webkit/browser/blob/blob_url_request_job_unittest.cc index 4b0749ee35b..8a814f5422f 100644 --- a/chromium/webkit/browser/blob/blob_url_request_job_unittest.cc +++ b/chromium/webkit/browser/blob/blob_url_request_job_unittest.cc @@ -8,7 +8,7 @@ #include "base/files/scoped_temp_dir.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop.h" +#include "base/run_loop.h" #include "base/time/time.h" #include "net/base/io_buffer.h" #include "net/http/http_request_headers.h" @@ -18,8 +18,8 @@ #include "net/url_request/url_request_job_factory_impl.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/blob/blob_url_request_job.h" +#include "webkit/browser/fileapi/async_file_test_helper.h" #include "webkit/browser/fileapi/file_system_context.h" -#include "webkit/browser/fileapi/file_system_file_util.h" #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/mock_file_system_context.h" @@ -175,7 +175,7 @@ class BlobURLRequestJobTest : public testing::Test { fileapi::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, base::Bind(&BlobURLRequestJobTest::OnValidateFileSystem, base::Unretained(this))); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); ASSERT_TRUE(file_system_root_url_.is_valid()); // Prepare files on file system. @@ -204,31 +204,14 @@ class BlobURLRequestJobTest : public testing::Test { kFileSystemType, base::FilePath().AppendASCII(filename)); - fileapi::FileSystemFileUtil* file_util = - file_system_context_->GetFileUtil(kFileSystemType); - - fileapi::FileSystemOperationContext context(file_system_context_.get()); - context.set_allowed_bytes_growth(1024); - - base::PlatformFile handle = base::kInvalidPlatformFileValue; - bool created = false; - ASSERT_EQ(base::PLATFORM_FILE_OK, file_util->CreateOrOpen( - &context, - url, - base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_WRITE, - &handle, - &created)); - EXPECT_TRUE(created); - ASSERT_NE(base::kInvalidPlatformFileValue, handle); - ASSERT_EQ(buf_size, - base::WritePlatformFile(handle, 0 /* offset */, buf, buf_size)); - base::ClosePlatformFile(handle); + ASSERT_EQ(base::PLATFORM_FILE_OK, + fileapi::AsyncFileTestHelper::CreateFileWithData( + file_system_context_, url, buf, buf_size)); base::PlatformFileInfo file_info; - base::FilePath platform_path; ASSERT_EQ(base::PLATFORM_FILE_OK, - file_util->GetFileInfo(&context, url, &file_info, - &platform_path)); + fileapi::AsyncFileTestHelper::GetMetadata( + file_system_context_, url, &file_info)); if (modification_time) *modification_time = file_info.last_modified; } diff --git a/chromium/webkit/browser/blob/file_stream_reader.h b/chromium/webkit/browser/blob/file_stream_reader.h index dd49a52c2bc..d60dfdbd91c 100644 --- a/chromium/webkit/browser/blob/file_stream_reader.h +++ b/chromium/webkit/browser/blob/file_stream_reader.h @@ -10,15 +10,52 @@ #include "net/base/completion_callback.h" #include "webkit/browser/webkit_storage_browser_export.h" +namespace base { +class FilePath; +class TaskRunner; +class Time; +} + namespace net { class IOBuffer; } +namespace fileapi { +class FileSystemContext; +class FileSystemURL; +} + namespace webkit_blob { // A generic interface for reading a file-like object. -class WEBKIT_STORAGE_BROWSER_EXPORT FileStreamReader { +class FileStreamReader { public: + // Creates a new FileReader for a local file |file_path|. + // |initial_offset| specifies the offset in the file where the first read + // should start. If the given offset is out of the file range any + // read operation may error out with net::ERR_REQUEST_RANGE_NOT_SATISFIABLE. + // |expected_modification_time| specifies the expected last modification + // If the value is non-null, the reader will check the underlying file's + // actual modification time to see if the file has been modified, and if + // it does any succeeding read operations should fail with + // ERR_UPLOAD_FILE_CHANGED error. + WEBKIT_STORAGE_BROWSER_EXPORT static FileStreamReader* + CreateForLocalFile(base::TaskRunner* task_runner, + const base::FilePath& file_path, + int64 initial_offset, + const base::Time& expected_modification_time); + + // Creates a new reader for a filesystem URL |url| form |initial_offset|. + // |expected_modification_time| specifies the expected last modification if + // the value is non-null, the reader will check the underlying file's actual + // modification time to see if the file has been modified, and if it does any + // succeeding read operations should fail with ERR_UPLOAD_FILE_CHANGED error. + WEBKIT_STORAGE_BROWSER_EXPORT static FileStreamReader* + CreateForFileSystemFile(fileapi::FileSystemContext* context, + const fileapi::FileSystemURL& url, + int64 initial_offset, + const base::Time& expected_modification_time); + // It is valid to delete the reader at any time. If the stream is deleted // while it has a pending read, its callback will not be called. virtual ~FileStreamReader() {} diff --git a/chromium/webkit/browser/blob/local_file_stream_reader.cc b/chromium/webkit/browser/blob/local_file_stream_reader.cc index a72709cb800..0686821ac24 100644 --- a/chromium/webkit/browser/blob/local_file_stream_reader.cc +++ b/chromium/webkit/browser/blob/local_file_stream_reader.cc @@ -32,17 +32,14 @@ bool VerifySnapshotTime(const base::Time& expected_modification_time, } // namespace -LocalFileStreamReader::LocalFileStreamReader( +FileStreamReader* FileStreamReader::CreateForLocalFile( base::TaskRunner* task_runner, const base::FilePath& file_path, int64 initial_offset, - const base::Time& expected_modification_time) - : task_runner_(task_runner), - file_path_(file_path), - initial_offset_(initial_offset), - expected_modification_time_(expected_modification_time), - has_pending_open_(false), - weak_factory_(this) {} + const base::Time& expected_modification_time) { + return new LocalFileStreamReader(task_runner, file_path, initial_offset, + expected_modification_time); +} LocalFileStreamReader::~LocalFileStreamReader() { } @@ -69,6 +66,18 @@ int64 LocalFileStreamReader::GetLength( return net::ERR_IO_PENDING; } +LocalFileStreamReader::LocalFileStreamReader( + base::TaskRunner* task_runner, + const base::FilePath& file_path, + int64 initial_offset, + const base::Time& expected_modification_time) + : task_runner_(task_runner), + file_path_(file_path), + initial_offset_(initial_offset), + expected_modification_time_(expected_modification_time), + has_pending_open_(false), + weak_factory_(this) {} + int LocalFileStreamReader::Open(const net::CompletionCallback& callback) { DCHECK(!has_pending_open_); DCHECK(!stream_impl_.get()); diff --git a/chromium/webkit/browser/blob/local_file_stream_reader.h b/chromium/webkit/browser/blob/local_file_stream_reader.h index 143a43bf87e..18a5424514a 100644 --- a/chromium/webkit/browser/blob/local_file_stream_reader.h +++ b/chromium/webkit/browser/blob/local_file_stream_reader.h @@ -27,22 +27,8 @@ namespace webkit_blob { // A thin wrapper of net::FileStream with range support for sliced file // handling. class WEBKIT_STORAGE_BROWSER_EXPORT LocalFileStreamReader - : public FileStreamReader { + : public NON_EXPORTED_BASE(FileStreamReader) { public: - // Creates a new FileReader for a local file |file_path|. - // |initial_offset| specifies the offset in the file where the first read - // should start. If the given offset is out of the file range any - // read operation may error out with net::ERR_REQUEST_RANGE_NOT_SATISFIABLE. - // - // |expected_modification_time| specifies the expected last modification - // If the value is non-null, the reader will check the underlying file's - // actual modification time to see if the file has been modified, and if - // it does any succeeding read operations should fail with - // ERR_UPLOAD_FILE_CHANGED error. - LocalFileStreamReader(base::TaskRunner* task_runner, - const base::FilePath& file_path, - int64 initial_offset, - const base::Time& expected_modification_time); virtual ~LocalFileStreamReader(); // FileStreamReader overrides. @@ -52,6 +38,13 @@ class WEBKIT_STORAGE_BROWSER_EXPORT LocalFileStreamReader const net::Int64CompletionCallback& callback) OVERRIDE; private: + friend class FileStreamReader; + friend class LocalFileStreamReaderTest; + + LocalFileStreamReader(base::TaskRunner* task_runner, + const base::FilePath& file_path, + int64 initial_offset, + const base::Time& expected_modification_time); int Open(const net::CompletionCallback& callback); // Callbacks that are chained from Open for Read. diff --git a/chromium/webkit/browser/blob/local_file_stream_reader_unittest.cc b/chromium/webkit/browser/blob/local_file_stream_reader_unittest.cc index f1ec01dbe3a..86a3c3d7a89 100644 --- a/chromium/webkit/browser/blob/local_file_stream_reader_unittest.cc +++ b/chromium/webkit/browser/blob/local_file_stream_reader_unittest.cc @@ -10,8 +10,8 @@ #include "base/files/file_path.h" #include "base/files/scoped_temp_dir.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop.h" #include "base/platform_file.h" +#include "base/run_loop.h" #include "base/threading/thread.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" @@ -75,9 +75,9 @@ class LocalFileStreamReaderTest : public testing::Test { virtual void TearDown() OVERRIDE { // Give another chance for deleted streams to perform Close. - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); file_thread_.Stop(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } protected: diff --git a/chromium/webkit/browser/blob/mock_blob_url_request_context.cc b/chromium/webkit/browser/blob/mock_blob_url_request_context.cc index 45c61340bfb..1794a58eb62 100644 --- a/chromium/webkit/browser/blob/mock_blob_url_request_context.cc +++ b/chromium/webkit/browser/blob/mock_blob_url_request_context.cc @@ -4,71 +4,46 @@ #include "webkit/browser/blob/mock_blob_url_request_context.h" -#include "webkit/browser/blob/blob_storage_controller.h" +#include "webkit/browser/blob/blob_storage_context.h" #include "webkit/browser/blob/blob_url_request_job.h" +#include "webkit/browser/blob/blob_url_request_job_factory.h" #include "webkit/common/blob/blob_data.h" -namespace webkit_blob { - -namespace { - -class MockBlobProtocolHandler - : public net::URLRequestJobFactory::ProtocolHandler { - public: - explicit MockBlobProtocolHandler( - BlobStorageController* blob_storage_controller, - fileapi::FileSystemContext* file_system_context) - : blob_storage_controller_(blob_storage_controller), - file_system_context_(file_system_context) {} - - virtual ~MockBlobProtocolHandler() {} - - virtual net::URLRequestJob* MaybeCreateJob( - net::URLRequest* request, - net::NetworkDelegate* network_delegate) const OVERRIDE { - return new BlobURLRequestJob( - request, - network_delegate, - blob_storage_controller_->GetBlobDataFromUrl(request->url()), - file_system_context_, - base::MessageLoopProxy::current().get()); - } - - private: - webkit_blob::BlobStorageController* const blob_storage_controller_; - fileapi::FileSystemContext* const file_system_context_; - DISALLOW_COPY_AND_ASSIGN(MockBlobProtocolHandler); -}; - -} // namespace +namespace webkit_blob { MockBlobURLRequestContext::MockBlobURLRequestContext( fileapi::FileSystemContext* file_system_context) - : blob_storage_controller_(new BlobStorageController) { + : blob_storage_context_(new BlobStorageContext) { // Job factory owns the protocol handler. job_factory_.SetProtocolHandler( - "blob", new MockBlobProtocolHandler(blob_storage_controller_.get(), - file_system_context)); + "blob", new BlobProtocolHandler(blob_storage_context_.get(), + file_system_context, + base::MessageLoopProxy::current())); set_job_factory(&job_factory_); } -MockBlobURLRequestContext::~MockBlobURLRequestContext() {} +MockBlobURLRequestContext::~MockBlobURLRequestContext() { +} ScopedTextBlob::ScopedTextBlob( const MockBlobURLRequestContext& request_context, - const GURL& blob_url, + const std::string& blob_id, const std::string& data) - : blob_url_(blob_url), - blob_storage_controller_(request_context.blob_storage_controller()) { - DCHECK(blob_storage_controller_); - scoped_refptr<BlobData> blob_data(new BlobData()); - blob_data->AppendData(data); - blob_storage_controller_->AddFinishedBlob(blob_url_, blob_data.get()); + : blob_id_(blob_id), + context_(request_context.blob_storage_context()) { + DCHECK(context_); + scoped_refptr<BlobData> blob_data(new BlobData(blob_id_)); + if (!data.empty()) + blob_data->AppendData(data); + handle_ = context_->AddFinishedBlob(blob_data); } ScopedTextBlob::~ScopedTextBlob() { - blob_storage_controller_->RemoveBlob(blob_url_); +} + +scoped_ptr<BlobDataHandle> ScopedTextBlob::GetBlobDataHandle() { + return context_->GetBlobDataFromUUID(blob_id_); } } // namespace webkit_blob diff --git a/chromium/webkit/browser/blob/mock_blob_url_request_context.h b/chromium/webkit/browser/blob/mock_blob_url_request_context.h index b89027c95e7..a5d1acc8a4c 100644 --- a/chromium/webkit/browser/blob/mock_blob_url_request_context.h +++ b/chromium/webkit/browser/blob/mock_blob_url_request_context.h @@ -15,34 +15,40 @@ class FileSystemContext; namespace webkit_blob { -class BlobStorageController; +class BlobDataHandle; +class BlobStorageContext; class MockBlobURLRequestContext : public net::URLRequestContext { public: MockBlobURLRequestContext(fileapi::FileSystemContext* file_system_context); virtual ~MockBlobURLRequestContext(); - BlobStorageController* blob_storage_controller() const { - return blob_storage_controller_.get(); + BlobStorageContext* blob_storage_context() const { + return blob_storage_context_.get(); } private: net::URLRequestJobFactoryImpl job_factory_; - scoped_ptr<BlobStorageController> blob_storage_controller_; + scoped_ptr<BlobStorageContext> blob_storage_context_; DISALLOW_COPY_AND_ASSIGN(MockBlobURLRequestContext); }; class ScopedTextBlob { public: + // Registers a blob with the given |id| that contains |data|. ScopedTextBlob(const MockBlobURLRequestContext& request_context, - const GURL& blob_url, + const std::string& blob_id, const std::string& data); ~ScopedTextBlob(); + // Returns a BlobDataHandle referring to the scoped blob. + scoped_ptr<BlobDataHandle> GetBlobDataHandle(); + private: - const GURL blob_url_; - BlobStorageController* blob_storage_controller_; + const std::string blob_id_; + BlobStorageContext* context_; + scoped_ptr<BlobDataHandle> handle_; DISALLOW_COPY_AND_ASSIGN(ScopedTextBlob); }; diff --git a/chromium/webkit/browser/blob/view_blob_internals_job.cc b/chromium/webkit/browser/blob/view_blob_internals_job.cc index 41ef7883de5..e0523a4277b 100644 --- a/chromium/webkit/browser/blob/view_blob_internals_job.cc +++ b/chromium/webkit/browser/blob/view_blob_internals_job.cc @@ -11,13 +11,14 @@ #include "base/i18n/time_formatting.h" #include "base/logging.h" #include "base/message_loop/message_loop.h" +#include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "net/base/escape.h" #include "net/base/net_errors.h" #include "net/url_request/url_request.h" -#include "webkit/browser/blob/blob_storage_controller.h" +#include "webkit/browser/blob/blob_storage_context.h" #include "webkit/common/blob/blob_data.h" namespace { @@ -34,6 +35,8 @@ const char kURL[] = "URL: "; const char kModificationTime[] = "Modification Time: "; const char kOffset[] = "Offset: "; const char kLength[] = "Length: "; +const char kUUID[] = "Uuid: "; +const char kRefcount[] = "Refcount: "; void StartHTML(std::string* out) { out->append( @@ -48,11 +51,11 @@ void StartHTML(std::string* out) { ".subsection_body { margin: 10px 0 10px 2em; }\n" ".subsection_title { font-weight: bold; }\n" "</style>\n" - "</head><body>\n"); + "</head><body>\n\n"); } void EndHTML(std::string* out) { - out->append("</body></html>"); + out->append("\n</body></html>"); } void AddHTMLBoldText(const std::string& text, std::string* out) { @@ -62,11 +65,11 @@ void AddHTMLBoldText(const std::string& text, std::string* out) { } void StartHTMLList(std::string* out) { - out->append("<ul>"); + out->append("\n<ul>"); } void EndHTMLList(std::string* out) { - out->append("</ul>"); + out->append("</ul>\n"); } void AddHTMLListItem(const std::string& element_title, @@ -76,21 +79,11 @@ void AddHTMLListItem(const std::string& element_title, // No need to escape element_title since constant string is passed. out->append(element_title); out->append(net::EscapeForHTML(element_data)); - out->append("</li>"); + out->append("</li>\n"); } -void AddHTMLButton(const std::string& title, - const std::string& command, - std::string* out) { - // No need to escape title since constant string is passed. - std::string escaped_command = net::EscapeForHTML(command.c_str()); - base::StringAppendF(out, - "<form action=\"\" method=\"GET\">\n" - "<input type=\"hidden\" name=\"remove\" value=\"%s\">\n" - "<input type=\"submit\" value=\"%s\">\n" - "</form><br/>\n", - escaped_command.c_str(), - title.c_str()); +void AddHorizontalRule(std::string* out) { + out->append("\n<hr>\n"); } } // namespace @@ -100,9 +93,9 @@ namespace webkit_blob { ViewBlobInternalsJob::ViewBlobInternalsJob( net::URLRequest* request, net::NetworkDelegate* network_delegate, - BlobStorageController* blob_storage_controller) + BlobStorageContext* blob_storage_context) : net::URLRequestSimpleJob(request, network_delegate), - blob_storage_controller_(blob_storage_controller), + blob_storage_context_(blob_storage_context), weak_factory_(this) { } @@ -112,7 +105,7 @@ ViewBlobInternalsJob::~ViewBlobInternalsJob() { void ViewBlobInternalsJob::Start() { base::MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&ViewBlobInternalsJob::DoWorkAsync, + base::Bind(&ViewBlobInternalsJob::StartAsync, weak_factory_.GetWeakPtr())); } @@ -134,18 +127,6 @@ void ViewBlobInternalsJob::Kill() { weak_factory_.InvalidateWeakPtrs(); } -void ViewBlobInternalsJob::DoWorkAsync() { - if (request_->url().has_query() && - StartsWithASCII(request_->url().query(), "remove=", true)) { - std::string blob_url = request_->url().query().substr(strlen("remove=")); - blob_url = net::UnescapeURLComponent(blob_url, - net::UnescapeRule::NORMAL | net::UnescapeRule::URL_SPECIAL_CHARS); - blob_storage_controller_->RemoveBlob(GURL(blob_url)); - } - - StartAsync(); -} - int ViewBlobInternalsJob::GetData( std::string* mime_type, std::string* charset, @@ -156,7 +137,7 @@ int ViewBlobInternalsJob::GetData( data->clear(); StartHTML(data); - if (blob_storage_controller_->blob_map_.empty()) + if (blob_storage_context_->blob_map_.empty()) data->append(kEmptyBlobStorageMessage); else GenerateHTML(data); @@ -165,20 +146,47 @@ int ViewBlobInternalsJob::GetData( } void ViewBlobInternalsJob::GenerateHTML(std::string* out) const { - for (BlobStorageController::BlobMap::const_iterator iter = - blob_storage_controller_->blob_map_.begin(); - iter != blob_storage_controller_->blob_map_.end(); + for (BlobStorageContext::BlobMap::const_iterator iter = + blob_storage_context_->blob_map_.begin(); + iter != blob_storage_context_->blob_map_.end(); ++iter) { AddHTMLBoldText(iter->first, out); - AddHTMLButton(kRemove, iter->first, out); - GenerateHTMLForBlobData(*iter->second.get(), out); + GenerateHTMLForBlobData(*(iter->second.data.get()), + iter->second.refcount, + out); + } + if (!blob_storage_context_->public_blob_urls_.empty()) { + AddHorizontalRule(out); + for (BlobStorageContext::BlobURLMap::const_iterator iter = + blob_storage_context_->public_blob_urls_.begin(); + iter != blob_storage_context_->public_blob_urls_.end(); + ++iter) { + AddHTMLBoldText(iter->first.spec(), out); + StartHTMLList(out); + AddHTMLListItem(kUUID, iter->second, out); + EndHTMLList(out); + } + } + if (!blob_storage_context_->deprecated_blob_urls_.empty()) { + AddHorizontalRule(out); + for (BlobStorageContext::BlobURLMap::const_iterator iter = + blob_storage_context_->deprecated_blob_urls_.begin(); + iter != blob_storage_context_->deprecated_blob_urls_.end(); + ++iter) { + AddHTMLBoldText(iter->first.spec(), out); + StartHTMLList(out); + AddHTMLListItem(kUUID, iter->second, out); + EndHTMLList(out); + } } } void ViewBlobInternalsJob::GenerateHTMLForBlobData(const BlobData& blob_data, + int refcount, std::string* out) { StartHTMLList(out); + AddHTMLListItem(kRefcount, base::IntToString(refcount), out); if (!blob_data.content_type().empty()) AddHTMLListItem(kContentType, blob_data.content_type(), out); if (!blob_data.content_disposition().empty()) @@ -213,12 +221,11 @@ void ViewBlobInternalsJob::GenerateHTMLForBlobData(const BlobData& blob_data, } break; case BlobData::Item::TYPE_BLOB: - AddHTMLListItem(kType, "blob", out); - AddHTMLListItem(kURL, item.url().spec(), out); + NOTREACHED(); // Should be flattened in the storage context. break; case BlobData::Item::TYPE_FILE_FILESYSTEM: AddHTMLListItem(kType, "filesystem", out); - AddHTMLListItem(kURL, item.url().spec(), out); + AddHTMLListItem(kURL, item.filesystem_url().spec(), out); if (!item.expected_modification_time().is_null()) { AddHTMLListItem(kModificationTime, UTF16ToUTF8( TimeFormatFriendlyDateAndTime(item.expected_modification_time())), diff --git a/chromium/webkit/browser/blob/view_blob_internals_job.h b/chromium/webkit/browser/blob/view_blob_internals_job.h index 41687d9c3b4..ed9d657f70d 100644 --- a/chromium/webkit/browser/blob/view_blob_internals_job.h +++ b/chromium/webkit/browser/blob/view_blob_internals_job.h @@ -18,7 +18,7 @@ class URLRequest; namespace webkit_blob { class BlobData; -class BlobStorageController; +class BlobStorageContext; // A job subclass that implements a protocol to inspect the internal // state of blob registry. @@ -27,7 +27,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT ViewBlobInternalsJob public: ViewBlobInternalsJob(net::URLRequest* request, net::NetworkDelegate* network_delegate, - BlobStorageController* blob_storage_controller); + BlobStorageContext* blob_storage_context); virtual void Start() OVERRIDE; virtual int GetData(std::string* mime_type, @@ -41,12 +41,12 @@ class WEBKIT_STORAGE_BROWSER_EXPORT ViewBlobInternalsJob private: virtual ~ViewBlobInternalsJob(); - void DoWorkAsync(); void GenerateHTML(std::string* out) const; static void GenerateHTMLForBlobData(const BlobData& blob_data, + int refcount, std::string* out); - BlobStorageController* blob_storage_controller_; + BlobStorageContext* blob_storage_context_; base::WeakPtrFactory<ViewBlobInternalsJob> weak_factory_; DISALLOW_COPY_AND_ASSIGN(ViewBlobInternalsJob); diff --git a/chromium/webkit/browser/database/database_quota_client.cc b/chromium/webkit/browser/database/database_quota_client.cc index 650edfe4c18..08e86660375 100644 --- a/chromium/webkit/browser/database/database_quota_client.cc +++ b/chromium/webkit/browser/database/database_quota_client.cc @@ -215,4 +215,8 @@ void DatabaseQuotaClient::DeleteOriginData( delete_callback); } +bool DatabaseQuotaClient::DoesSupport(quota::StorageType type) const { + return type == quota::kStorageTypeTemporary; +} + } // namespace webkit_database diff --git a/chromium/webkit/browser/database/database_quota_client.h b/chromium/webkit/browser/database/database_quota_client.h index bc070213182..2c6d0aeda71 100644 --- a/chromium/webkit/browser/database/database_quota_client.h +++ b/chromium/webkit/browser/database/database_quota_client.h @@ -39,10 +39,11 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE DatabaseQuotaClient const GetOriginsCallback& callback) OVERRIDE; virtual void GetOriginsForHost(quota::StorageType type, const std::string& host, - const GetOriginsCallback& callback) OVERRIDE; + const GetOriginsCallback& callback) OVERRIDE; virtual void DeleteOriginData(const GURL& origin, quota::StorageType type, const DeletionCallback& callback) OVERRIDE; + virtual bool DoesSupport(quota::StorageType type) const OVERRIDE; private: scoped_refptr<base::MessageLoopProxy> db_tracker_thread_; scoped_refptr<DatabaseTracker> db_tracker_; // only used on its thread diff --git a/chromium/webkit/browser/database/database_quota_client_unittest.cc b/chromium/webkit/browser/database/database_quota_client_unittest.cc index 93ca2d0893d..3d4f71aef53 100644 --- a/chromium/webkit/browser/database/database_quota_client_unittest.cc +++ b/chromium/webkit/browser/database/database_quota_client_unittest.cc @@ -6,8 +6,8 @@ #include "base/bind.h" #include "base/files/file_path.h" -#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_proxy.h" +#include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "net/base/completion_callback.h" #include "net/base/net_errors.h" @@ -142,7 +142,7 @@ class DatabaseQuotaClientTest : public testing::Test { origin, type, base::Bind(&DatabaseQuotaClientTest::OnGetOriginUsageComplete, weak_factory_.GetWeakPtr())); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); return usage_; } @@ -154,7 +154,7 @@ class DatabaseQuotaClientTest : public testing::Test { type, base::Bind(&DatabaseQuotaClientTest::OnGetOriginsComplete, weak_factory_.GetWeakPtr())); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); return origins_; } @@ -167,7 +167,7 @@ class DatabaseQuotaClientTest : public testing::Test { type, host, base::Bind(&DatabaseQuotaClientTest::OnGetOriginsComplete, weak_factory_.GetWeakPtr())); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); return origins_; } @@ -180,7 +180,7 @@ class DatabaseQuotaClientTest : public testing::Test { origin, type, base::Bind(&DatabaseQuotaClientTest::OnDeleteOriginDataComplete, weak_factory_.GetWeakPtr())); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); return delete_status_ == quota::kQuotaStatusOk; } diff --git a/chromium/webkit/browser/database/database_tracker.cc b/chromium/webkit/browser/database/database_tracker.cc index e3b3c6abe83..f9adb3bed43 100644 --- a/chromium/webkit/browser/database/database_tracker.cc +++ b/chromium/webkit/browser/database/database_tracker.cc @@ -289,15 +289,13 @@ base::FilePath DatabaseTracker::GetFullDBFilePath( if (!LazyInit()) return base::FilePath(); - int64 id = databases_table_->GetDatabaseID( - origin_identifier, database_name); + int64 id = databases_table_->GetDatabaseID(origin_identifier, database_name); if (id < 0) return base::FilePath(); - base::FilePath file_name = base::FilePath::FromWStringHack( - UTF8ToWide(base::Int64ToString(id))); - return db_dir_.Append(base::FilePath::FromWStringHack( - UTF16ToWide(GetOriginDirectory(origin_identifier)))).Append(file_name); + return db_dir_.Append(base::FilePath::FromUTF16Unsafe( + GetOriginDirectory(origin_identifier))).AppendASCII( + base::Int64ToString(id)); } bool DatabaseTracker::GetOriginInfo(const std::string& origin_identifier, diff --git a/chromium/webkit/browser/database/database_tracker_unittest.cc b/chromium/webkit/browser/database/database_tracker_unittest.cc index 25f0a6949d2..860faa0cd2c 100644 --- a/chromium/webkit/browser/database/database_tracker_unittest.cc +++ b/chromium/webkit/browser/database/database_tracker_unittest.cc @@ -220,12 +220,12 @@ class DatabaseTracker_TestHelper_Test { tracker->DatabaseOpened(kOrigin2, kDB3, kDescription, 0, &database_size); - EXPECT_TRUE(file_util::CreateDirectory(tracker->DatabaseDirectory().Append( - base::FilePath::FromWStringHack(UTF16ToWide( - tracker->GetOriginDirectory(kOrigin1)))))); - EXPECT_TRUE(file_util::CreateDirectory(tracker->DatabaseDirectory().Append( - base::FilePath::FromWStringHack(UTF16ToWide( - tracker->GetOriginDirectory(kOrigin2)))))); + EXPECT_TRUE(file_util::CreateDirectory( + tracker->DatabaseDirectory().Append(base::FilePath::FromUTF16Unsafe( + tracker->GetOriginDirectory(kOrigin1))))); + EXPECT_TRUE(file_util::CreateDirectory( + tracker->DatabaseDirectory().Append(base::FilePath::FromUTF16Unsafe( + tracker->GetOriginDirectory(kOrigin2))))); EXPECT_EQ(1, file_util::WriteFile( tracker->GetFullDBFilePath(kOrigin1, kDB1), "a", 1)); EXPECT_EQ(2, file_util::WriteFile( @@ -255,9 +255,9 @@ class DatabaseTracker_TestHelper_Test { // Recreate db1. tracker->DatabaseOpened(kOrigin1, kDB1, kDescription, 0, &database_size); - EXPECT_TRUE(file_util::CreateDirectory(tracker->DatabaseDirectory().Append( - base::FilePath::FromWStringHack(UTF16ToWide( - tracker->GetOriginDirectory(kOrigin1)))))); + EXPECT_TRUE(file_util::CreateDirectory( + tracker->DatabaseDirectory().Append(base::FilePath::FromUTF16Unsafe( + tracker->GetOriginDirectory(kOrigin1))))); EXPECT_EQ(1, file_util::WriteFile( tracker->GetFullDBFilePath(kOrigin1, kDB1), "a", 1)); tracker->DatabaseModified(kOrigin1, kDB1); @@ -348,12 +348,12 @@ class DatabaseTracker_TestHelper_Test { // Write some data to each file and check that the listeners are // called with the appropriate values. - EXPECT_TRUE(file_util::CreateDirectory(tracker->DatabaseDirectory().Append( - base::FilePath::FromWStringHack(UTF16ToWide( - tracker->GetOriginDirectory(kOrigin1)))))); - EXPECT_TRUE(file_util::CreateDirectory(tracker->DatabaseDirectory().Append( - base::FilePath::FromWStringHack(UTF16ToWide( - tracker->GetOriginDirectory(kOrigin2)))))); + EXPECT_TRUE(file_util::CreateDirectory( + tracker->DatabaseDirectory().Append(base::FilePath::FromUTF16Unsafe( + tracker->GetOriginDirectory(kOrigin1))))); + EXPECT_TRUE(file_util::CreateDirectory( + tracker->DatabaseDirectory().Append(base::FilePath::FromUTF16Unsafe( + tracker->GetOriginDirectory(kOrigin2))))); EXPECT_EQ(1, file_util::WriteFile( tracker->GetFullDBFilePath(kOrigin1, kDB1), "a", 1)); EXPECT_EQ(2, file_util::WriteFile( diff --git a/chromium/webkit/browser/fileapi/async_file_test_helper.cc b/chromium/webkit/browser/fileapi/async_file_test_helper.cc index 8a01fd2a474..e3343d51935 100644 --- a/chromium/webkit/browser/fileapi/async_file_test_helper.cc +++ b/chromium/webkit/browser/fileapi/async_file_test_helper.cc @@ -3,6 +3,8 @@ // found in the LICENSE file. #include "base/bind.h" +#include "base/file_util.h" +#include "base/files/scoped_temp_dir.h" #include "base/run_loop.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/fileapi/async_file_test_helper.h" @@ -92,10 +94,19 @@ base::PlatformFileError AsyncFileTestHelper::Copy( FileSystemContext* context, const FileSystemURL& src, const FileSystemURL& dest) { + return CopyWithProgress(context, src, dest, CopyProgressCallback()); +} + +base::PlatformFileError AsyncFileTestHelper::CopyWithProgress( + FileSystemContext* context, + const FileSystemURL& src, + const FileSystemURL& dest, + const CopyProgressCallback& progress_callback) { base::PlatformFileError result = base::PLATFORM_FILE_ERROR_FAILED; base::RunLoop run_loop; context->operation_runner()->Copy( - src, dest, AssignAndQuitCallback(&run_loop, &result)); + src, dest, progress_callback, + AssignAndQuitCallback(&run_loop, &result)); run_loop.Run(); return result; } @@ -164,6 +175,25 @@ base::PlatformFileError AsyncFileTestHelper::CreateFile( return result; } +base::PlatformFileError AsyncFileTestHelper::CreateFileWithData( + FileSystemContext* context, + const FileSystemURL& url, + const char* buf, + int buf_size) { + base::ScopedTempDir dir; + if (!dir.CreateUniqueTempDir()) + return base::PLATFORM_FILE_ERROR_FAILED; + base::FilePath local_path = dir.path().AppendASCII("tmp"); + if (buf_size != file_util::WriteFile(local_path, buf, buf_size)) + return base::PLATFORM_FILE_ERROR_FAILED; + base::PlatformFileError result = base::PLATFORM_FILE_ERROR_FAILED; + base::RunLoop run_loop; + context->operation_runner()->CopyInForeignFile( + local_path, url, AssignAndQuitCallback(&run_loop, &result)); + run_loop.Run(); + return result; +} + base::PlatformFileError AsyncFileTestHelper::TruncateFile( FileSystemContext* context, const FileSystemURL& url, @@ -232,7 +262,7 @@ quota::QuotaStatusCode AsyncFileTestHelper::GetUsageAndQuota( origin, FileSystemTypeToQuotaStorageType(type), base::Bind(&DidGetUsageAndQuota, &status, usage, quota)); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); return status; } diff --git a/chromium/webkit/browser/fileapi/async_file_test_helper.h b/chromium/webkit/browser/fileapi/async_file_test_helper.h index cfa7981e03e..168400fd0ef 100644 --- a/chromium/webkit/browser/fileapi/async_file_test_helper.h +++ b/chromium/webkit/browser/fileapi/async_file_test_helper.h @@ -23,6 +23,7 @@ class FileSystemURL; class AsyncFileTestHelper { public: typedef FileSystemOperation::FileEntryList FileEntryList; + typedef FileSystemOperation::CopyProgressCallback CopyProgressCallback; static const int64 kDontCheckSize; @@ -31,6 +32,13 @@ class AsyncFileTestHelper { const FileSystemURL& src, const FileSystemURL& dest); + // Same as Copy, but this supports |progress_callback|. + static base::PlatformFileError CopyWithProgress( + FileSystemContext* context, + const FileSystemURL& src, + const FileSystemURL& dest, + const CopyProgressCallback& progress_callback); + // Performs Move from |src| to |dest| and returns the status code. static base::PlatformFileError Move(FileSystemContext* context, const FileSystemURL& src, @@ -54,6 +62,13 @@ class AsyncFileTestHelper { static base::PlatformFileError CreateFile(FileSystemContext* context, const FileSystemURL& url); + // Creates a file at |url| and fills with |buf|. + static base::PlatformFileError CreateFileWithData( + FileSystemContext* context, + const FileSystemURL& url, + const char* buf, + int buf_size); + // Truncates the file |url| to |size|. static base::PlatformFileError TruncateFile(FileSystemContext* context, const FileSystemURL& url, diff --git a/chromium/webkit/browser/fileapi/async_file_util.h b/chromium/webkit/browser/fileapi/async_file_util.h index dc8216eaac0..84a033b7a4e 100644 --- a/chromium/webkit/browser/fileapi/async_file_util.h +++ b/chromium/webkit/browser/fileapi/async_file_util.h @@ -42,7 +42,7 @@ class FileSystemURL; // It is NOT valid to give null callback to this class, and implementors // can assume that they don't get any null callbacks. // -class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil { +class AsyncFileUtil { public: typedef base::Callback< void(base::PlatformFileError result)> StatusCallback; @@ -76,6 +76,15 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil { const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref )> CreateSnapshotFileCallback; + + typedef base::Callback<void(int64 size)> CopyFileProgressCallback; + + // Creates an AsyncFileUtil instance which performs file operations on + // local native file system. The created instance assumes + // FileSystemURL::path() has the target platform path. + WEBKIT_STORAGE_BROWSER_EXPORT static AsyncFileUtil* + CreateForLocalFileSystem(); + AsyncFileUtil() {} virtual ~AsyncFileUtil() {} @@ -198,6 +207,12 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil { // Copies a file from |src_url| to |dest_url|. // This must be called for files that belong to the same filesystem // (i.e. type() and origin() of the |src_url| and |dest_url| must match). + // |progress_callback| is a callback to report the progress update. + // See file_system_operations.h for details. This should be called on the + // same thread as where the method's called (IO thread). Calling this + // is optional. It is recommended to use this callback for heavier operations + // (such as file network downloading), so that, e.g., clients (UIs) can + // update its state to show progress to users. This may be a null callback. // // FileSystemOperationImpl::Copy calls this for same-filesystem copy case. // @@ -214,6 +229,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil { scoped_ptr<FileSystemOperationContext> context, const FileSystemURL& src_url, const FileSystemURL& dest_url, + const CopyFileProgressCallback& progress_callback, const StatusCallback& callback) = 0; // Moves a local file from |src_url| to |dest_url|. diff --git a/chromium/webkit/browser/fileapi/async_file_util_adapter.cc b/chromium/webkit/browser/fileapi/async_file_util_adapter.cc index 807c2e20227..54d67976dc7 100644 --- a/chromium/webkit/browser/fileapi/async_file_util_adapter.cc +++ b/chromium/webkit/browser/fileapi/async_file_util_adapter.cc @@ -253,7 +253,9 @@ void AsyncFileUtilAdapter::CopyFileLocal( scoped_ptr<FileSystemOperationContext> context, const FileSystemURL& src_url, const FileSystemURL& dest_url, + const CopyFileProgressCallback& progress_callback, const StatusCallback& callback) { + // TODO(hidehiko): Support progress_callback. FileSystemOperationContext* context_ptr = context.release(); const bool success = base::PostTaskAndReplyWithResult( context_ptr->task_runner(), FROM_HERE, diff --git a/chromium/webkit/browser/fileapi/async_file_util_adapter.h b/chromium/webkit/browser/fileapi/async_file_util_adapter.h index 9da3db9eac7..0122b11b9d5 100644 --- a/chromium/webkit/browser/fileapi/async_file_util_adapter.h +++ b/chromium/webkit/browser/fileapi/async_file_util_adapter.h @@ -22,8 +22,8 @@ class FileSystemFileUtil; // // This instance (as thus this->sync_file_util_) is guaranteed to be alive // as far as FileSystemOperationContext given to each operation is kept alive. -class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE AsyncFileUtilAdapter - : public AsyncFileUtil { +class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtilAdapter + : public NON_EXPORTED_BASE(AsyncFileUtil) { public: // Creates a new AsyncFileUtil for |sync_file_util|. This takes the // ownership of |sync_file_util|. (This doesn't take scoped_ptr<> just @@ -76,6 +76,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE AsyncFileUtilAdapter scoped_ptr<FileSystemOperationContext> context, const FileSystemURL& src_url, const FileSystemURL& dest_url, + const CopyFileProgressCallback& progress_callback, const StatusCallback& callback) OVERRIDE; virtual void MoveFileLocal( scoped_ptr<FileSystemOperationContext> context, diff --git a/chromium/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc b/chromium/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc index caecccfddfb..366efa3dad5 100644 --- a/chromium/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc +++ b/chromium/webkit/browser/fileapi/copy_or_move_file_validator_unittest.cc @@ -6,7 +6,7 @@ #include "base/bind.h" #include "base/files/file_path.h" #include "base/files/scoped_temp_dir.h" -#include "base/message_loop/message_loop.h" +#include "base/run_loop.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/fileapi/async_file_test_helper.h" #include "webkit/browser/fileapi/copy_or_move_file_validator.h" @@ -46,7 +46,7 @@ class CopyOrMoveFileValidatorTestHelper { ~CopyOrMoveFileValidatorTestHelper() { file_system_context_ = NULL; - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } void SetUp() { @@ -68,7 +68,7 @@ class CopyOrMoveFileValidatorTestHelper { origin_, src_type_, OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, base::Bind(&ExpectOk)); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); ASSERT_EQ(base::PLATFORM_FILE_OK, CreateDirectory(SourceURL(""))); // Sets up dest. diff --git a/chromium/webkit/browser/fileapi/copy_or_move_operation_delegate.cc b/chromium/webkit/browser/fileapi/copy_or_move_operation_delegate.cc index da1ef97b984..aba17b55d75 100644 --- a/chromium/webkit/browser/fileapi/copy_or_move_operation_delegate.cc +++ b/chromium/webkit/browser/fileapi/copy_or_move_operation_delegate.cc @@ -16,22 +16,293 @@ namespace fileapi { +class CopyOrMoveOperationDelegate::CopyOrMoveImpl { + public: + virtual ~CopyOrMoveImpl() {} + virtual void Run( + const CopyOrMoveOperationDelegate::StatusCallback& callback) = 0; + protected: + CopyOrMoveImpl() {} + DISALLOW_COPY_AND_ASSIGN(CopyOrMoveImpl); +}; + +namespace { + +// Copies a file on a (same) file system. Just delegate the operation to +// |operation_runner|. +class CopyOrMoveOnSameFileSystemImpl + : public CopyOrMoveOperationDelegate::CopyOrMoveImpl { + public: + CopyOrMoveOnSameFileSystemImpl( + FileSystemOperationRunner* operation_runner, + CopyOrMoveOperationDelegate::OperationType operation_type, + const FileSystemURL& src_url, + const FileSystemURL& dest_url, + const FileSystemOperation::CopyFileProgressCallback& + file_progress_callback) + : operation_runner_(operation_runner), + operation_type_(operation_type), + src_url_(src_url), + dest_url_(dest_url), + file_progress_callback_(file_progress_callback) { + } + + virtual void Run( + const CopyOrMoveOperationDelegate::StatusCallback& callback) OVERRIDE { + if (operation_type_ == CopyOrMoveOperationDelegate::OPERATION_MOVE) { + operation_runner_->MoveFileLocal(src_url_, dest_url_, callback); + } else { + operation_runner_->CopyFileLocal( + src_url_, dest_url_, file_progress_callback_, callback); + } + } + + private: + FileSystemOperationRunner* operation_runner_; + CopyOrMoveOperationDelegate::OperationType operation_type_; + FileSystemURL src_url_; + FileSystemURL dest_url_; + FileSystemOperation::CopyFileProgressCallback file_progress_callback_; + DISALLOW_COPY_AND_ASSIGN(CopyOrMoveOnSameFileSystemImpl); +}; + +// Specifically for cross file system copy/move operation, this class creates +// a snapshot file, validates it if necessary, runs copying process, +// validates the created file, and removes source file for move (noop for +// copy). +class SnapshotCopyOrMoveImpl + : public CopyOrMoveOperationDelegate::CopyOrMoveImpl { + public: + SnapshotCopyOrMoveImpl( + FileSystemOperationRunner* operation_runner, + CopyOrMoveOperationDelegate::OperationType operation_type, + const FileSystemURL& src_url, + const FileSystemURL& dest_url, + CopyOrMoveFileValidatorFactory* validator_factory, + const FileSystemOperation::CopyFileProgressCallback& + file_progress_callback) + : operation_runner_(operation_runner), + operation_type_(operation_type), + src_url_(src_url), + dest_url_(dest_url), + validator_factory_(validator_factory), + file_progress_callback_(file_progress_callback), + weak_factory_(this) { + } + + virtual void Run( + const CopyOrMoveOperationDelegate::StatusCallback& callback) OVERRIDE { + file_progress_callback_.Run(0); + operation_runner_->CreateSnapshotFile( + src_url_, + base::Bind(&SnapshotCopyOrMoveImpl::RunAfterCreateSnapshot, + weak_factory_.GetWeakPtr(), callback)); + } + + private: + void RunAfterCreateSnapshot( + const CopyOrMoveOperationDelegate::StatusCallback& callback, + base::PlatformFileError error, + const base::PlatformFileInfo& file_info, + const base::FilePath& platform_path, + const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { + if (error != base::PLATFORM_FILE_OK) { + callback.Run(error); + return; + } + + // For now we assume CreateSnapshotFile always return a valid local file + // path. + DCHECK(!platform_path.empty()); + + if (!validator_factory_) { + // No validation is needed. + RunAfterPreWriteValidation(platform_path, file_info, file_ref, callback, + base::PLATFORM_FILE_OK); + return; + } + + // Run pre write validation. + PreWriteValidation( + platform_path, + base::Bind(&SnapshotCopyOrMoveImpl::RunAfterPreWriteValidation, + weak_factory_.GetWeakPtr(), + platform_path, file_info, file_ref, callback)); + } + + void RunAfterPreWriteValidation( + const base::FilePath& platform_path, + const base::PlatformFileInfo& file_info, + const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref, + const CopyOrMoveOperationDelegate::StatusCallback& callback, + base::PlatformFileError error) { + if (error != base::PLATFORM_FILE_OK) { + callback.Run(error); + return; + } + + // |file_ref| is unused but necessary to keep the file alive until + // CopyInForeignFile() is completed. + operation_runner_->CopyInForeignFile( + platform_path, dest_url_, + base::Bind(&SnapshotCopyOrMoveImpl::RunAfterCopyInForeignFile, + weak_factory_.GetWeakPtr(), file_info, file_ref, callback)); + } + + void RunAfterCopyInForeignFile( + const base::PlatformFileInfo& file_info, + const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref, + const CopyOrMoveOperationDelegate::StatusCallback& callback, + base::PlatformFileError error) { + if (error != base::PLATFORM_FILE_OK) { + callback.Run(error); + return; + } + + file_progress_callback_.Run(file_info.size); + + // |validator_| is NULL when the destination filesystem does not do + // validation. + if (!validator_) { + // No validation is needed. + RunAfterPostWriteValidation(callback, base::PLATFORM_FILE_OK); + return; + } + + PostWriteValidation( + base::Bind(&SnapshotCopyOrMoveImpl::RunAfterPostWriteValidation, + weak_factory_.GetWeakPtr(), callback)); + } + + void RunAfterPostWriteValidation( + const CopyOrMoveOperationDelegate::StatusCallback& callback, + base::PlatformFileError error) { + if (error != base::PLATFORM_FILE_OK) { + // Failed to validate. Remove the destination file. + operation_runner_->Remove( + dest_url_, true /* recursive */, + base::Bind(&SnapshotCopyOrMoveImpl::DidRemoveDestForError, + weak_factory_.GetWeakPtr(), error, callback)); + return; + } + + if (operation_type_ == CopyOrMoveOperationDelegate::OPERATION_COPY) { + callback.Run(base::PLATFORM_FILE_OK); + return; + } + + DCHECK_EQ(CopyOrMoveOperationDelegate::OPERATION_MOVE, operation_type_); + + // Remove the source for finalizing move operation. + operation_runner_->Remove( + src_url_, true /* recursive */, + base::Bind(&SnapshotCopyOrMoveImpl::RunAfterRemoveSourceForMove, + weak_factory_.GetWeakPtr(), callback)); + } + + void RunAfterRemoveSourceForMove( + const CopyOrMoveOperationDelegate::StatusCallback& callback, + base::PlatformFileError error) { + if (error == base::PLATFORM_FILE_ERROR_NOT_FOUND) + error = base::PLATFORM_FILE_OK; + callback.Run(error); + } + + void DidRemoveDestForError( + base::PlatformFileError prior_error, + const CopyOrMoveOperationDelegate::StatusCallback& callback, + base::PlatformFileError error) { + if (error != base::PLATFORM_FILE_OK) { + VLOG(1) << "Error removing destination file after validation error: " + << error; + } + callback.Run(prior_error); + } + + // Runs pre-write validation. + void PreWriteValidation( + const base::FilePath& platform_path, + const CopyOrMoveOperationDelegate::StatusCallback& callback) { + DCHECK(validator_factory_); + validator_.reset( + validator_factory_->CreateCopyOrMoveFileValidator( + src_url_, platform_path)); + validator_->StartPreWriteValidation(callback); + } + + // Runs post-write validation. + void PostWriteValidation( + const CopyOrMoveOperationDelegate::StatusCallback& callback) { + operation_runner_->CreateSnapshotFile( + dest_url_, + base::Bind( + &SnapshotCopyOrMoveImpl::PostWriteValidationAfterCreateSnapshotFile, + weak_factory_.GetWeakPtr(), callback)); + } + + void PostWriteValidationAfterCreateSnapshotFile( + const CopyOrMoveOperationDelegate::StatusCallback& callback, + base::PlatformFileError error, + const base::PlatformFileInfo& file_info, + const base::FilePath& platform_path, + const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { + if (error != base::PLATFORM_FILE_OK) { + callback.Run(error); + return; + } + + DCHECK(validator_); + // Note: file_ref passed here to keep the file alive until after + // the StartPostWriteValidation operation finishes. + validator_->StartPostWriteValidation( + platform_path, + base::Bind(&SnapshotCopyOrMoveImpl::DidPostWriteValidation, + weak_factory_.GetWeakPtr(), file_ref, callback)); + } + + // |file_ref| is unused; it is passed here to make sure the reference is + // alive until after post-write validation is complete. + void DidPostWriteValidation( + const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref, + const CopyOrMoveOperationDelegate::StatusCallback& callback, + base::PlatformFileError error) { + callback.Run(error); + } + + FileSystemOperationRunner* operation_runner_; + CopyOrMoveOperationDelegate::OperationType operation_type_; + FileSystemURL src_url_; + FileSystemURL dest_url_; + CopyOrMoveFileValidatorFactory* validator_factory_; + scoped_ptr<CopyOrMoveFileValidator> validator_; + FileSystemOperation::CopyFileProgressCallback file_progress_callback_; + + base::WeakPtrFactory<SnapshotCopyOrMoveImpl> weak_factory_; + DISALLOW_COPY_AND_ASSIGN(SnapshotCopyOrMoveImpl); +}; + +} // namespace + + CopyOrMoveOperationDelegate::CopyOrMoveOperationDelegate( FileSystemContext* file_system_context, const FileSystemURL& src_root, const FileSystemURL& dest_root, OperationType operation_type, + const CopyProgressCallback& progress_callback, const StatusCallback& callback) : RecursiveOperationDelegate(file_system_context), src_root_(src_root), dest_root_(dest_root), operation_type_(operation_type), + progress_callback_(progress_callback), callback_(callback), weak_factory_(this) { same_file_system_ = src_root_.IsInSameFileSystem(dest_root_); } CopyOrMoveOperationDelegate::~CopyOrMoveOperationDelegate() { + STLDeleteElements(&running_copy_set_); } void CopyOrMoveOperationDelegate::Run() { @@ -54,239 +325,154 @@ void CopyOrMoveOperationDelegate::RunRecursively() { return; } - // First try to copy/move it as a file. - CopyOrMoveFile(URLPair(src_root_, dest_root_), - base::Bind(&CopyOrMoveOperationDelegate::DidTryCopyOrMoveFile, - weak_factory_.GetWeakPtr())); -} - -void CopyOrMoveOperationDelegate::ProcessFile(const FileSystemURL& src_url, - const StatusCallback& callback) { - CopyOrMoveFile(URLPair(src_url, CreateDestURL(src_url)), callback); -} - -void CopyOrMoveOperationDelegate::ProcessDirectory(const FileSystemURL& src_url, - const StatusCallback& callback) { - FileSystemURL dest_url = CreateDestURL(src_url); - - // If operation_type == Move we may need to record directories and - // restore directory timestamps in the end, though it may have - // negative performance impact. - // See http://crbug.com/171284 for more details. - operation_runner()->CreateDirectory( - dest_url, false /* exclusive */, false /* recursive */, callback); -} - -void CopyOrMoveOperationDelegate::DidTryCopyOrMoveFile( - base::PlatformFileError error) { - if (error == base::PLATFORM_FILE_OK || - error != base::PLATFORM_FILE_ERROR_NOT_A_FILE) { - callback_.Run(error); - return; - } - - // The src_root_ looks to be a directory. - // Try removing the dest_root_ to see if it exists and/or it is an - // empty directory. - operation_runner()->RemoveDirectory( - dest_root_, - base::Bind(&CopyOrMoveOperationDelegate::DidTryRemoveDestRoot, - weak_factory_.GetWeakPtr())); -} - -void CopyOrMoveOperationDelegate::DidTryRemoveDestRoot( - base::PlatformFileError error) { - if (error == base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY) { - callback_.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); - return; - } - if (error != base::PLATFORM_FILE_OK && - error != base::PLATFORM_FILE_ERROR_NOT_FOUND) { - callback_.Run(error); - return; - } - // Start to process the source directory recursively. // TODO(kinuko): This could be too expensive for same_file_system_==true // and operation==MOVE case, probably we can just rename the root directory. // http://crbug.com/172187 - StartRecursiveOperation( - src_root_, - base::Bind(&CopyOrMoveOperationDelegate::DidFinishRecursiveCopyDir, - weak_factory_.GetWeakPtr(), src_root_, callback_)); + StartRecursiveOperation(src_root_, callback_); } -void CopyOrMoveOperationDelegate::CopyOrMoveFile( - const URLPair& url_pair, +void CopyOrMoveOperationDelegate::ProcessFile( + const FileSystemURL& src_url, const StatusCallback& callback) { - // Same filesystem case. - if (same_file_system_) { - if (operation_type_ == OPERATION_MOVE) { - operation_runner()->MoveFileLocal(url_pair.src, url_pair.dest, callback); - } else { - operation_runner()->CopyFileLocal(url_pair.src, url_pair.dest, callback); - } - return; + if (!progress_callback_.is_null()) { + progress_callback_.Run( + FileSystemOperation::BEGIN_COPY_ENTRY, src_url, FileSystemURL(), 0); } - // Cross filesystem case. - // Perform CreateSnapshotFile, CopyInForeignFile and then calls - // copy_callback which removes the source file if operation_type == MOVE. - StatusCallback copy_callback = - base::Bind(&CopyOrMoveOperationDelegate::DidFinishCopy, - weak_factory_.GetWeakPtr(), url_pair, callback); - operation_runner()->CreateSnapshotFile( - url_pair.src, - base::Bind(&CopyOrMoveOperationDelegate::DidCreateSnapshot, - weak_factory_.GetWeakPtr(), url_pair, copy_callback)); -} + FileSystemURL dest_url = CreateDestURL(src_url); + CopyOrMoveImpl* impl = NULL; + if (same_file_system_) { + impl = new CopyOrMoveOnSameFileSystemImpl( + operation_runner(), operation_type_, src_url, dest_url, + base::Bind(&CopyOrMoveOperationDelegate::OnCopyFileProgress, + weak_factory_.GetWeakPtr(), src_url)); + } else { + // Cross filesystem case. + // TODO(hidehiko): Support stream based copy. crbug.com/279287. + base::PlatformFileError error = base::PLATFORM_FILE_ERROR_FAILED; + CopyOrMoveFileValidatorFactory* validator_factory = + file_system_context()->GetCopyOrMoveFileValidatorFactory( + dest_root_.type(), &error); + if (error != base::PLATFORM_FILE_OK) { + callback.Run(error); + return; + } -void CopyOrMoveOperationDelegate::DidCreateSnapshot( - const URLPair& url_pair, - const StatusCallback& callback, - base::PlatformFileError error, - const base::PlatformFileInfo& file_info, - const base::FilePath& platform_path, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { - if (error != base::PLATFORM_FILE_OK) { - callback.Run(error); - return; + impl = new SnapshotCopyOrMoveImpl( + operation_runner(), operation_type_, src_url, dest_url, + validator_factory, + base::Bind(&CopyOrMoveOperationDelegate::OnCopyFileProgress, + weak_factory_.GetWeakPtr(), src_url)); } - current_file_ref_ = file_ref; - // For now we assume CreateSnapshotFile always return a valid local file path. - // TODO(kinuko): Otherwise create a FileStreamReader to perform a copy/move. - DCHECK(!platform_path.empty()); + // Register the running task. + running_copy_set_.insert(impl); + impl->Run(base::Bind( + &CopyOrMoveOperationDelegate::DidCopyOrMoveFile, + weak_factory_.GetWeakPtr(), src_url, dest_url, callback, impl)); +} - CopyOrMoveFileValidatorFactory* factory = - file_system_context()->GetCopyOrMoveFileValidatorFactory( - dest_root_.type(), &error); - if (error != base::PLATFORM_FILE_OK) { - callback.Run(error); - return; - } - if (!factory) { - DidValidateFile(url_pair.dest, callback, file_info, platform_path, error); +void CopyOrMoveOperationDelegate::ProcessDirectory( + const FileSystemURL& src_url, + const StatusCallback& callback) { + if (src_url == src_root_) { + // The src_root_ looks to be a directory. + // Try removing the dest_root_ to see if it exists and/or it is an + // empty directory. + // We do not invoke |progress_callback_| for source root, because it is + // already called in ProcessFile(). + operation_runner()->RemoveDirectory( + dest_root_, + base::Bind(&CopyOrMoveOperationDelegate::DidTryRemoveDestRoot, + weak_factory_.GetWeakPtr(), callback)); return; } - validator_.reset( - factory->CreateCopyOrMoveFileValidator(url_pair.src, platform_path)); - validator_->StartPreWriteValidation( - base::Bind(&CopyOrMoveOperationDelegate::DidValidateFile, - weak_factory_.GetWeakPtr(), - url_pair.dest, callback, file_info, platform_path)); -} - -void CopyOrMoveOperationDelegate::DidValidateFile( - const FileSystemURL& dest, - const StatusCallback& callback, - const base::PlatformFileInfo& file_info, - const base::FilePath& platform_path, - base::PlatformFileError error) { - if (error != base::PLATFORM_FILE_OK) { - callback.Run(error); - return; + if (!progress_callback_.is_null()) { + progress_callback_.Run( + FileSystemOperation::BEGIN_COPY_ENTRY, src_url, FileSystemURL(), 0); } - operation_runner()->CopyInForeignFile(platform_path, dest, callback); + ProcessDirectoryInternal(src_url, CreateDestURL(src_url), callback); } -void CopyOrMoveOperationDelegate::DidFinishRecursiveCopyDir( - const FileSystemURL& src, - const StatusCallback& callback, - base::PlatformFileError error) { - if (error != base::PLATFORM_FILE_OK || - operation_type_ == OPERATION_COPY) { - callback.Run(error); +void CopyOrMoveOperationDelegate::PostProcessDirectory( + const FileSystemURL& src_url, + const StatusCallback& callback) { + if (operation_type_ == OPERATION_COPY) { + callback.Run(base::PLATFORM_FILE_OK); return; } DCHECK_EQ(OPERATION_MOVE, operation_type_); - // Remove the source for finalizing move operation. + // All files and subdirectories in the directory should be moved here, + // so remove the source directory for finalizing move operation. operation_runner()->Remove( - src, true /* recursive */, + src_url, false /* recursive */, base::Bind(&CopyOrMoveOperationDelegate::DidRemoveSourceForMove, weak_factory_.GetWeakPtr(), callback)); } -void CopyOrMoveOperationDelegate::DidFinishCopy( - const URLPair& url_pair, +void CopyOrMoveOperationDelegate::DidCopyOrMoveFile( + const FileSystemURL& src_url, + const FileSystemURL& dest_url, const StatusCallback& callback, + CopyOrMoveImpl* impl, base::PlatformFileError error) { - if (error != base::PLATFORM_FILE_OK) { - callback.Run(error); - return; - } + running_copy_set_.erase(impl); + delete impl; - // |validator_| is NULL in the same-filesystem case or when the destination - // filesystem does not do validation. - if (!validator_.get()) { - scoped_refptr<webkit_blob::ShareableFileReference> file_ref; - DidPostWriteValidation(url_pair, callback, file_ref, - base::PLATFORM_FILE_OK); - return; + if (!progress_callback_.is_null() && error == base::PLATFORM_FILE_OK) { + progress_callback_.Run( + FileSystemOperation::END_COPY_ENTRY, src_url, dest_url, 0); } - DCHECK(!same_file_system_); - operation_runner()->CreateSnapshotFile( - url_pair.dest, - base::Bind(&CopyOrMoveOperationDelegate::DoPostWriteValidation, - weak_factory_.GetWeakPtr(), url_pair, callback)); + callback.Run(error); } -void CopyOrMoveOperationDelegate::DoPostWriteValidation( - const URLPair& url_pair, +void CopyOrMoveOperationDelegate::DidTryRemoveDestRoot( const StatusCallback& callback, - base::PlatformFileError error, - const base::PlatformFileInfo& file_info, - const base::FilePath& platform_path, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { - if (error != base::PLATFORM_FILE_OK) { - operation_runner()->Remove( - url_pair.dest, true, - base::Bind(&CopyOrMoveOperationDelegate::DidRemoveDestForError, - weak_factory_.GetWeakPtr(), error, callback)); + base::PlatformFileError error) { + if (error == base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY) { + callback_.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); + return; + } + if (error != base::PLATFORM_FILE_OK && + error != base::PLATFORM_FILE_ERROR_NOT_FOUND) { + callback_.Run(error); return; } - DCHECK(validator_.get()); - // Note: file_ref passed here to keep the file alive until after - // the StartPostWriteValidation operation finishes. - validator_->StartPostWriteValidation( - platform_path, - base::Bind(&CopyOrMoveOperationDelegate::DidPostWriteValidation, - weak_factory_.GetWeakPtr(), url_pair, callback, file_ref)); + ProcessDirectoryInternal(src_root_, dest_root_, callback); +} + +void CopyOrMoveOperationDelegate::ProcessDirectoryInternal( + const FileSystemURL& src_url, + const FileSystemURL& dest_url, + const StatusCallback& callback) { + // If operation_type == Move we may need to record directories and + // restore directory timestamps in the end, though it may have + // negative performance impact. + // See http://crbug.com/171284 for more details. + operation_runner()->CreateDirectory( + dest_url, false /* exclusive */, false /* recursive */, + base::Bind(&CopyOrMoveOperationDelegate::DidCreateDirectory, + weak_factory_.GetWeakPtr(), src_url, dest_url, callback)); } -// |file_ref| is unused; it is passed here to make sure the reference is -// alive until after post-write validation is complete. -void CopyOrMoveOperationDelegate::DidPostWriteValidation( - const URLPair& url_pair, +void CopyOrMoveOperationDelegate::DidCreateDirectory( + const FileSystemURL& src_url, + const FileSystemURL& dest_url, const StatusCallback& callback, - const scoped_refptr<webkit_blob::ShareableFileReference>& /*file_ref*/, base::PlatformFileError error) { - if (error != base::PLATFORM_FILE_OK) { - operation_runner()->Remove( - url_pair.dest, true, - base::Bind(&CopyOrMoveOperationDelegate::DidRemoveDestForError, - weak_factory_.GetWeakPtr(), error, callback)); - return; + if (!progress_callback_.is_null() && error == base::PLATFORM_FILE_OK) { + progress_callback_.Run( + FileSystemOperation::END_COPY_ENTRY, src_url, dest_url, 0); } - if (operation_type_ == OPERATION_COPY) { - callback.Run(error); - return; - } - - DCHECK_EQ(OPERATION_MOVE, operation_type_); - - // Remove the source for finalizing move operation. - operation_runner()->Remove( - url_pair.src, true /* recursive */, - base::Bind(&CopyOrMoveOperationDelegate::DidRemoveSourceForMove, - weak_factory_.GetWeakPtr(), callback)); + callback.Run(error); } void CopyOrMoveOperationDelegate::DidRemoveSourceForMove( @@ -297,6 +483,14 @@ void CopyOrMoveOperationDelegate::DidRemoveSourceForMove( callback.Run(error); } +void CopyOrMoveOperationDelegate::OnCopyFileProgress( + const FileSystemURL& src_url, int64 size) { + if (!progress_callback_.is_null()) { + progress_callback_.Run( + FileSystemOperation::PROGRESS, src_url, FileSystemURL(), size); + } +} + FileSystemURL CopyOrMoveOperationDelegate::CreateDestURL( const FileSystemURL& src_url) const { DCHECK_EQ(src_root_.type(), src_url.type()); @@ -311,15 +505,4 @@ FileSystemURL CopyOrMoveOperationDelegate::CreateDestURL( relative); } -void CopyOrMoveOperationDelegate::DidRemoveDestForError( - base::PlatformFileError prior_error, - const StatusCallback& callback, - base::PlatformFileError error) { - if (error != base::PLATFORM_FILE_OK) { - VLOG(1) << "Error removing destination file after validation error: " - << error; - } - callback.Run(prior_error); -} - } // namespace fileapi diff --git a/chromium/webkit/browser/fileapi/copy_or_move_operation_delegate.h b/chromium/webkit/browser/fileapi/copy_or_move_operation_delegate.h index ceceb971367..77d1a76efc6 100644 --- a/chromium/webkit/browser/fileapi/copy_or_move_operation_delegate.h +++ b/chromium/webkit/browser/fileapi/copy_or_move_operation_delegate.h @@ -23,6 +23,9 @@ class CopyOrMoveFileValidator; class CopyOrMoveOperationDelegate : public RecursiveOperationDelegate { public: + class CopyOrMoveImpl; + typedef FileSystemOperation::CopyProgressCallback CopyProgressCallback; + enum OperationType { OPERATION_COPY, OPERATION_MOVE @@ -33,6 +36,7 @@ class CopyOrMoveOperationDelegate const FileSystemURL& src_root, const FileSystemURL& dest_root, OperationType operation_type, + const CopyProgressCallback& progress_callback, const StatusCallback& callback); virtual ~CopyOrMoveOperationDelegate(); @@ -43,75 +47,38 @@ class CopyOrMoveOperationDelegate const StatusCallback& callback) OVERRIDE; virtual void ProcessDirectory(const FileSystemURL& url, const StatusCallback& callback) OVERRIDE; + virtual void PostProcessDirectory(const FileSystemURL& url, + const StatusCallback& callback) OVERRIDE; private: - struct URLPair { - URLPair(const FileSystemURL& src, const FileSystemURL& dest) - : src(src), - dest(dest) { - } - FileSystemURL src; - FileSystemURL dest; - }; - - void DidTryCopyOrMoveFile(base::PlatformFileError error); - void DidTryRemoveDestRoot(base::PlatformFileError error); - void CopyOrMoveFile( - const URLPair& url_pair, - const StatusCallback& callback); - void DidCreateSnapshot( - const URLPair& url_pair, - const StatusCallback& callback, - base::PlatformFileError error, - const base::PlatformFileInfo& file_info, - const base::FilePath& platform_path, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); - void DidValidateFile( - const FileSystemURL& dest, - const StatusCallback& callback, - const base::PlatformFileInfo& file_info, - const base::FilePath& platform_path, - base::PlatformFileError error); - void DidFinishRecursiveCopyDir( - const FileSystemURL& src, - const StatusCallback& callback, - base::PlatformFileError error); - void DidFinishCopy( - const URLPair& url_pair, - const StatusCallback& callback, - base::PlatformFileError error); - void DoPostWriteValidation( - const URLPair& url_pair, - const StatusCallback& callback, - base::PlatformFileError error, - const base::PlatformFileInfo& file_info, - const base::FilePath& platform_path, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); - void DidPostWriteValidation( - const URLPair& url_pair, - const StatusCallback& callback, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref, - base::PlatformFileError error); - void DidRemoveSourceForMove( - const StatusCallback& callback, - base::PlatformFileError error); - void DidRemoveDestForError( - base::PlatformFileError prior_error, - const StatusCallback& callback, - base::PlatformFileError error); - + void DidCopyOrMoveFile(const FileSystemURL& src_url, + const FileSystemURL& dest_url, + const StatusCallback& callback, + CopyOrMoveImpl* impl, + base::PlatformFileError error); + void DidTryRemoveDestRoot(const StatusCallback& callback, + base::PlatformFileError error); + void ProcessDirectoryInternal(const FileSystemURL& src_url, + const FileSystemURL& dest_url, + const StatusCallback& callback); + void DidCreateDirectory(const FileSystemURL& src_url, + const FileSystemURL& dest_url, + const StatusCallback& callback, + base::PlatformFileError error); + void DidRemoveSourceForMove(const StatusCallback& callback, + base::PlatformFileError error); + + void OnCopyFileProgress(const FileSystemURL& src_url, int64 size); FileSystemURL CreateDestURL(const FileSystemURL& src_url) const; FileSystemURL src_root_; FileSystemURL dest_root_; bool same_file_system_; OperationType operation_type_; + CopyProgressCallback progress_callback_; StatusCallback callback_; - scoped_refptr<webkit_blob::ShareableFileReference> current_file_ref_; - - scoped_ptr<CopyOrMoveFileValidator> validator_; - + std::set<CopyOrMoveImpl*> running_copy_set_; base::WeakPtrFactory<CopyOrMoveOperationDelegate> weak_factory_; DISALLOW_COPY_AND_ASSIGN(CopyOrMoveOperationDelegate); diff --git a/chromium/webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc b/chromium/webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc index 183becd7dbf..322341dc40f 100644 --- a/chromium/webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc +++ b/chromium/webkit/browser/fileapi/copy_or_move_operation_delegate_unittest.cc @@ -93,6 +93,27 @@ class TestValidatorFactory : public CopyOrMoveFileValidatorFactory { }; }; +// Records CopyProgressCallback invocations. +struct ProgressRecord { + FileSystemOperation::CopyProgressType type; + FileSystemURL source_url; + FileSystemURL dest_url; + int64 size; +}; + +void RecordProgressCallback(std::vector<ProgressRecord>* records, + FileSystemOperation::CopyProgressType type, + const FileSystemURL& source_url, + const FileSystemURL& dest_url, + int64 size) { + ProgressRecord record; + record.type = type; + record.source_url = source_url; + record.dest_url = dest_url; + record.size = size; + records->push_back(record); +} + } // namespace class CopyOrMoveOperationTestHelper { @@ -110,7 +131,7 @@ class CopyOrMoveOperationTestHelper { quota_manager_proxy_->SimulateQuotaManagerDestroyed(); quota_manager_ = NULL; quota_manager_proxy_ = NULL; - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } void SetUp() { @@ -156,7 +177,7 @@ class CopyOrMoveOperationTestHelper { backend->OpenFileSystem(origin_, dest_type_, OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, base::Bind(&ExpectOk)); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); // Grant relatively big quota initially. quota_manager_->SetQuota(origin_, @@ -194,6 +215,14 @@ class CopyOrMoveOperationTestHelper { return AsyncFileTestHelper::Copy(file_system_context_.get(), src, dest); } + base::PlatformFileError CopyWithProgress( + const FileSystemURL& src, + const FileSystemURL& dest, + const AsyncFileTestHelper::CopyProgressCallback& progress_callback) { + return AsyncFileTestHelper::CopyWithProgress( + file_system_context_.get(), src, dest, progress_callback); + } + base::PlatformFileError Move(const FileSystemURL& src, const FileSystemURL& dest) { return AsyncFileTestHelper::Move(file_system_context_.get(), src, dest); @@ -453,7 +482,10 @@ TEST(LocalFileSystemCopyOrMoveOperationTest, CopyDirectory) { int64 src_increase = helper.GetSourceUsage() - src_initial_usage; // Copy it. - ASSERT_EQ(base::PLATFORM_FILE_OK, helper.Copy(src, dest)); + ASSERT_EQ(base::PLATFORM_FILE_OK, + helper.CopyWithProgress( + src, dest, + AsyncFileTestHelper::CopyProgressCallback())); // Verify. ASSERT_TRUE(helper.DirectoryExists(src)); @@ -559,4 +591,75 @@ TEST(LocalFileSystemCopyOrMoveOperationTest, CopySingleFileNoValidator) { ASSERT_EQ(base::PLATFORM_FILE_ERROR_SECURITY, helper.Copy(src, dest)); } +TEST(LocalFileSystemCopyOrMoveOperationTest, ProgressCallback) { + CopyOrMoveOperationTestHelper helper(GURL("http://foo"), + kFileSystemTypeTemporary, + kFileSystemTypePersistent); + helper.SetUp(); + + FileSystemURL src = helper.SourceURL("a"); + FileSystemURL dest = helper.DestURL("b"); + + // Set up a source directory. + ASSERT_EQ(base::PLATFORM_FILE_OK, helper.CreateDirectory(src)); + ASSERT_EQ(base::PLATFORM_FILE_OK, + helper.SetUpTestCaseFiles(src, + test::kRegularTestCases, + test::kRegularTestCaseSize)); + + std::vector<ProgressRecord> records; + ASSERT_EQ(base::PLATFORM_FILE_OK, + helper.CopyWithProgress(src, dest, + base::Bind(&RecordProgressCallback, + base::Unretained(&records)))); + + // Verify progress callback. + for (size_t i = 0; i < test::kRegularTestCaseSize; ++i) { + const test::TestCaseRecord& test_case = test::kRegularTestCases[i]; + + FileSystemURL src_url = helper.SourceURL( + std::string("a/") + base::FilePath(test_case.path).AsUTF8Unsafe()); + FileSystemURL dest_url = helper.DestURL( + std::string("b/") + base::FilePath(test_case.path).AsUTF8Unsafe()); + + // Find the first and last progress record. + size_t begin_index = records.size(); + size_t end_index = records.size(); + for (size_t j = 0; j < records.size(); ++j) { + if (records[j].source_url == src_url) { + if (begin_index == records.size()) + begin_index = j; + end_index = j; + } + } + + // The record should be found. + ASSERT_NE(begin_index, records.size()); + ASSERT_NE(end_index, records.size()); + ASSERT_NE(begin_index, end_index); + + EXPECT_EQ(FileSystemOperation::BEGIN_COPY_ENTRY, + records[begin_index].type); + EXPECT_FALSE(records[begin_index].dest_url.is_valid()); + EXPECT_EQ(FileSystemOperation::END_COPY_ENTRY, records[end_index].type); + EXPECT_EQ(dest_url, records[end_index].dest_url); + + if (test_case.is_directory) { + // For directory copy, the progress shouldn't be interlaced. + EXPECT_EQ(begin_index + 1, end_index); + } else { + // PROGRESS event's size should be assending order. + int64 current_size = 0; + for (size_t j = begin_index + 1; j < end_index; ++j) { + if (records[j].source_url == src_url) { + EXPECT_EQ(FileSystemOperation::PROGRESS, records[j].type); + EXPECT_FALSE(records[j].dest_url.is_valid()); + EXPECT_GE(records[j].size, current_size); + current_size = records[j].size; + } + } + } + } +} + } // namespace fileapi diff --git a/chromium/webkit/browser/fileapi/isolated_file_util.cc b/chromium/webkit/browser/fileapi/dragged_file_util.cc index bd2dffc009e..b4536a70f9a 100644 --- a/chromium/webkit/browser/fileapi/isolated_file_util.cc +++ b/chromium/webkit/browser/fileapi/dragged_file_util.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/browser/fileapi/isolated_file_util.h" +#include "webkit/browser/fileapi/dragged_file_util.h" #include <string> #include <vector> @@ -58,24 +58,6 @@ class SetFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator { //------------------------------------------------------------------------- -IsolatedFileUtil::IsolatedFileUtil() {} - -PlatformFileError IsolatedFileUtil::GetLocalFilePath( - FileSystemOperationContext* context, - const FileSystemURL& url, - base::FilePath* local_file_path) { - DCHECK(local_file_path); - DCHECK(url.is_valid()); - if (url.path().empty()) { - // Root direcory case, which should not be accessed. - return base::PLATFORM_FILE_ERROR_ACCESS_DENIED; - } - *local_file_path = url.path(); - return base::PLATFORM_FILE_OK; -} - -//------------------------------------------------------------------------- - DraggedFileUtil::DraggedFileUtil() {} PlatformFileError DraggedFileUtil::GetFileInfo( diff --git a/chromium/webkit/browser/fileapi/isolated_file_util.h b/chromium/webkit/browser/fileapi/dragged_file_util.h index e6f595572c4..22c538e1b34 100644 --- a/chromium/webkit/browser/fileapi/isolated_file_util.h +++ b/chromium/webkit/browser/fileapi/dragged_file_util.h @@ -1,9 +1,9 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_FILEAPI_ISOLATED_FILE_UTIL_H_ -#define WEBKIT_BROWSER_FILEAPI_ISOLATED_FILE_UTIL_H_ +#ifndef WEBKIT_BROWSER_FILEAPI_DRAGGED_FILE_UTIL_H_ +#define WEBKIT_BROWSER_FILEAPI_DRAGGED_FILE_UTIL_H_ #include "base/memory/scoped_ptr.h" #include "webkit/browser/fileapi/local_file_util.h" @@ -13,24 +13,11 @@ namespace fileapi { class FileSystemOperationContext; -class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE IsolatedFileUtil - : public LocalFileUtil { - public: - IsolatedFileUtil(); - virtual ~IsolatedFileUtil() {} - - // LocalFileUtil overrides. - virtual base::PlatformFileError GetLocalFilePath( - FileSystemOperationContext* context, - const FileSystemURL& file_system_url, - base::FilePath* local_file_path) OVERRIDE; -}; - -// Dragged file system is a specialized IsolatedFileUtil where read access to +// Dragged file system is a specialized LocalFileUtil where read access to // the virtual root directory (i.e. empty cracked path case) is allowed // and single isolated context may be associated with multiple file paths. class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE DraggedFileUtil - : public IsolatedFileUtil { + : public LocalFileUtil { public: DraggedFileUtil(); virtual ~DraggedFileUtil() {} @@ -51,4 +38,4 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE DraggedFileUtil } // namespace fileapi -#endif // WEBKIT_BROWSER_FILEAPI_ISOLATED_FILE_UTIL_H_ +#endif // WEBKIT_BROWSER_FILEAPI_DRAGGED_FILE_UTIL_H_ diff --git a/chromium/webkit/browser/fileapi/isolated_file_util_unittest.cc b/chromium/webkit/browser/fileapi/dragged_file_util_unittest.cc index fee8ed1497d..af15af8f9fd 100644 --- a/chromium/webkit/browser/fileapi/isolated_file_util_unittest.cc +++ b/chromium/webkit/browser/fileapi/dragged_file_util_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -17,10 +17,10 @@ #include "base/time/time.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/fileapi/async_file_test_helper.h" +#include "webkit/browser/fileapi/dragged_file_util.h" #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/isolated_context.h" -#include "webkit/browser/fileapi/isolated_file_util.h" #include "webkit/browser/fileapi/local_file_util.h" #include "webkit/browser/fileapi/mock_file_system_context.h" #include "webkit/browser/fileapi/native_file_util.h" @@ -32,7 +32,7 @@ namespace { typedef AsyncFileTestHelper::FileEntryList FileEntryList; -// Used in IsolatedFileUtilTest::SimulateDropFiles(). +// Used in DraggedFileUtilTest::SimulateDropFiles(). // Random root paths in which we create each file/directory of the // RegularTestCases (so that we can simulate a drop with files/directories // from multiple directories). @@ -87,11 +87,9 @@ FileSystemURL GetOtherURL(FileSystemContext* file_system_context, } // namespace -// TODO(kinuko): we should have separate tests for DraggedFileUtil and -// IsolatedFileUtil. -class IsolatedFileUtilTest : public testing::Test { +class DraggedFileUtilTest : public testing::Test { public: - IsolatedFileUtilTest() {} + DraggedFileUtilTest() {} virtual void SetUp() { ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); @@ -184,8 +182,8 @@ class IsolatedFileUtilTest : public testing::Test { EXPECT_NE(platform_path1, platform_path2); std::string content1, content2; - EXPECT_TRUE(file_util::ReadFileToString(platform_path1, &content1)); - EXPECT_TRUE(file_util::ReadFileToString(platform_path2, &content2)); + EXPECT_TRUE(base::ReadFileToString(platform_path1, &content1)); + EXPECT_TRUE(base::ReadFileToString(platform_path2, &content2)); EXPECT_EQ(content1, content2); } @@ -281,11 +279,11 @@ class IsolatedFileUtilTest : public testing::Test { std::string filesystem_id_; scoped_refptr<FileSystemContext> file_system_context_; std::map<base::FilePath, base::FilePath> toplevel_root_map_; - scoped_ptr<IsolatedFileUtil> file_util_; - DISALLOW_COPY_AND_ASSIGN(IsolatedFileUtilTest); + scoped_ptr<DraggedFileUtil> file_util_; + DISALLOW_COPY_AND_ASSIGN(DraggedFileUtilTest); }; -TEST_F(IsolatedFileUtilTest, BasicTest) { +TEST_F(DraggedFileUtilTest, BasicTest) { for (size_t i = 0; i < test::kRegularTestCaseSize; ++i) { SCOPED_TRACE(testing::Message() << "Testing RegularTestCases " << i); const test::TestCaseRecord& test_case = test::kRegularTestCases[i]; @@ -310,7 +308,7 @@ TEST_F(IsolatedFileUtilTest, BasicTest) { } } -TEST_F(IsolatedFileUtilTest, UnregisteredPathsTest) { +TEST_F(DraggedFileUtilTest, UnregisteredPathsTest) { static const fileapi::test::TestCaseRecord kUnregisteredCases[] = { {true, FILE_PATH_LITERAL("nonexistent"), 0}, {true, FILE_PATH_LITERAL("nonexistent/dir foo"), 0}, @@ -345,7 +343,7 @@ TEST_F(IsolatedFileUtilTest, UnregisteredPathsTest) { } } -TEST_F(IsolatedFileUtilTest, ReadDirectoryTest) { +TEST_F(DraggedFileUtilTest, ReadDirectoryTest) { for (size_t i = 0; i < test::kRegularTestCaseSize; ++i) { const test::TestCaseRecord& test_case = test::kRegularTestCases[i]; if (!test_case.is_directory) @@ -404,7 +402,7 @@ TEST_F(IsolatedFileUtilTest, ReadDirectoryTest) { } } -TEST_F(IsolatedFileUtilTest, GetLocalFilePathTest) { +TEST_F(DraggedFileUtilTest, GetLocalFilePathTest) { for (size_t i = 0; i < test::kRegularTestCaseSize; ++i) { const test::TestCaseRecord& test_case = test::kRegularTestCases[i]; FileSystemURL url = GetFileSystemURL(base::FilePath(test_case.path)); @@ -419,7 +417,7 @@ TEST_F(IsolatedFileUtilTest, GetLocalFilePathTest) { } } -TEST_F(IsolatedFileUtilTest, CopyOutFileTest) { +TEST_F(DraggedFileUtilTest, CopyOutFileTest) { FileSystemURL src_root = GetFileSystemURL(base::FilePath()); FileSystemURL dest_root = GetOtherFileSystemURL(base::FilePath()); @@ -460,7 +458,7 @@ TEST_F(IsolatedFileUtilTest, CopyOutFileTest) { } } -TEST_F(IsolatedFileUtilTest, CopyOutDirectoryTest) { +TEST_F(DraggedFileUtilTest, CopyOutDirectoryTest) { FileSystemURL src_root = GetFileSystemURL(base::FilePath()); FileSystemURL dest_root = GetOtherFileSystemURL(base::FilePath()); @@ -488,7 +486,7 @@ TEST_F(IsolatedFileUtilTest, CopyOutDirectoryTest) { } } -TEST_F(IsolatedFileUtilTest, TouchTest) { +TEST_F(DraggedFileUtilTest, TouchTest) { for (size_t i = 0; i < test::kRegularTestCaseSize; ++i) { const test::TestCaseRecord& test_case = test::kRegularTestCases[i]; if (test_case.is_directory) @@ -515,7 +513,7 @@ TEST_F(IsolatedFileUtilTest, TouchTest) { } } -TEST_F(IsolatedFileUtilTest, TruncateTest) { +TEST_F(DraggedFileUtilTest, TruncateTest) { for (size_t i = 0; i < test::kRegularTestCaseSize; ++i) { const test::TestCaseRecord& test_case = test::kRegularTestCases[i]; if (test_case.is_directory) diff --git a/chromium/webkit/browser/fileapi/file_stream_writer.h b/chromium/webkit/browser/fileapi/file_stream_writer.h index 7262cdf6ccd..1ebdfb9191a 100644 --- a/chromium/webkit/browser/fileapi/file_stream_writer.h +++ b/chromium/webkit/browser/fileapi/file_stream_writer.h @@ -9,6 +9,11 @@ #include "net/base/completion_callback.h" #include "webkit/browser/webkit_storage_browser_export.h" +namespace base { +class FilePath; +class TaskRunner; +} + namespace net { class IOBuffer; } @@ -16,8 +21,15 @@ class IOBuffer; namespace fileapi { // A generic interface for writing to a file-like object. -class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileStreamWriter { +class FileStreamWriter { public: + // Creates a writer for the existing file in the path |file_path| starting + // from |initial_offset|. Uses |task_runner| for async file operations. + WEBKIT_STORAGE_BROWSER_EXPORT static FileStreamWriter* CreateForLocalFile( + base::TaskRunner* task_runner, + const base::FilePath& file_path, + int64 initial_offset); + // Closes the file. If there's an in-flight operation, it is canceled (i.e., // the callback function associated with the operation is not called). virtual ~FileStreamWriter() {} diff --git a/chromium/webkit/browser/fileapi/file_system_backend.h b/chromium/webkit/browser/fileapi/file_system_backend.h index b368db6c928..2c8be930b3e 100644 --- a/chromium/webkit/browser/fileapi/file_system_backend.h +++ b/chromium/webkit/browser/fileapi/file_system_backend.h @@ -69,11 +69,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemBackend { OpenFileSystemMode mode, const OpenFileSystemCallback& callback) = 0; - // Returns the specialized FileSystemFileUtil for this backend. - // It is ok to return NULL if the filesystem doesn't support synchronous - // version of FileUtil. - virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) = 0; - // Returns the specialized AsyncFileUtil for this backend. virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) = 0; diff --git a/chromium/webkit/browser/fileapi/file_system_context.cc b/chromium/webkit/browser/fileapi/file_system_context.cc index d43ba8a846e..9098649f245 100644 --- a/chromium/webkit/browser/fileapi/file_system_context.cc +++ b/chromium/webkit/browser/fileapi/file_system_context.cc @@ -27,6 +27,7 @@ #include "webkit/browser/fileapi/test_file_system_backend.h" #include "webkit/browser/quota/quota_manager.h" #include "webkit/browser/quota/special_storage_policy.h" +#include "webkit/common/fileapi/file_system_info.h" #include "webkit/common/fileapi/file_system_util.h" using quota::QuotaClient; @@ -49,6 +50,19 @@ void DidOpenFileSystem( callback.Run(error, filesystem_name, filesystem_root); } +void DidGetMetadataForResolveURL( + const base::FilePath& path, + const FileSystemContext::ResolveURLCallback& callback, + const FileSystemInfo& info, + base::PlatformFileError error, + const base::PlatformFileInfo& file_info) { + if (error != base::PLATFORM_FILE_OK) { + callback.Run(error, FileSystemInfo(), base::FilePath(), false); + return; + } + callback.Run(error, info, path, file_info.is_directory); +} + } // namespace // static @@ -108,24 +122,20 @@ FileSystemContext::FileSystemContext( : io_task_runner_(io_task_runner), default_file_task_runner_(file_task_runner), quota_manager_proxy_(quota_manager_proxy), - sandbox_context_(new SandboxContext( + sandbox_delegate_(new SandboxFileSystemBackendDelegate( quota_manager_proxy, file_task_runner, partition_path, special_storage_policy, options)), sandbox_backend_(new SandboxFileSystemBackend( - sandbox_context_.get())), + sandbox_delegate_.get())), isolated_backend_(new IsolatedFileSystemBackend()), additional_backends_(additional_backends.Pass()), external_mount_points_(external_mount_points), partition_path_(partition_path), + is_incognito_(options.is_incognito()), operation_runner_(new FileSystemOperationRunner(this)) { - if (quota_manager_proxy) { - quota_manager_proxy->RegisterClient(CreateQuotaClient( - this, options.is_incognito())); - } - RegisterBackend(sandbox_backend_.get()); RegisterBackend(isolated_backend_.get()); @@ -135,6 +145,12 @@ FileSystemContext::FileSystemContext( RegisterBackend(*iter); } + if (quota_manager_proxy) { + // Quota client assumes all backends have registered. + quota_manager_proxy->RegisterClient(CreateQuotaClient( + this, options.is_incognito())); + } + sandbox_backend_->Initialize(this); isolated_backend_->Initialize(this); for (ScopedVector<FileSystemBackend>::const_iterator iter = @@ -200,14 +216,6 @@ AsyncFileUtil* FileSystemContext::GetAsyncFileUtil( return backend->GetAsyncFileUtil(type); } -FileSystemFileUtil* FileSystemContext::GetFileUtil( - FileSystemType type) const { - FileSystemBackend* backend = GetFileSystemBackend(type); - if (!backend) - return NULL; - return backend->GetFileUtil(type); -} - CopyOrMoveFileValidatorFactory* FileSystemContext::GetCopyOrMoveFileValidatorFactory( FileSystemType type, base::PlatformFileError* error_code) const { @@ -230,7 +238,8 @@ FileSystemBackend* FileSystemContext::GetFileSystemBackend( } bool FileSystemContext::IsSandboxFileSystem(FileSystemType type) const { - return GetQuotaUtil(type) != NULL; + FileSystemBackendMap::const_iterator found = backend_map_.find(type); + return found != backend_map_.end() && found->second->GetQuotaUtil(); } const UpdateObserverList* FileSystemContext::GetUpdateObservers( @@ -280,6 +289,26 @@ void FileSystemContext::OpenFileSystem( base::Bind(&DidOpenFileSystem, callback)); } +void FileSystemContext::ResolveURL( + const FileSystemURL& url, + const ResolveURLCallback& callback) { + DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); + DCHECK(!callback.is_null()); + + FileSystemBackend* backend = GetFileSystemBackend(url.type()); + if (!backend) { + callback.Run(base::PLATFORM_FILE_ERROR_SECURITY, + FileSystemInfo(), base::FilePath(), false); + return; + } + + backend->OpenFileSystem( + url.origin(), url.type(), + OPEN_FILE_SYSTEM_FAIL_IF_NONEXISTENT, + base::Bind(&FileSystemContext::DidOpenFileSystemForResolveURL, + this, url, callback)); +} + void FileSystemContext::DeleteFileSystem( const GURL& origin_url, FileSystemType type, @@ -355,6 +384,16 @@ void FileSystemContext::EnableTemporaryFileSystemInIncognito() { } #endif +bool FileSystemContext::CanServeURLRequest(const FileSystemURL& url) const { +#if defined(OS_CHROMEOS) && defined(GOOGLE_CHROME_BUILD) + if (url.type() == kFileSystemTypeTemporary && + sandbox_backend_->enable_temporary_file_system_in_incognito()) { + return true; + } +#endif + return !is_incognito_ || !FileSystemContext::IsSandboxFileSystem(url.type()); +} + FileSystemContext::~FileSystemContext() { } @@ -417,8 +456,7 @@ FileSystemURL FileSystemContext::CrackFileSystemURL( return current; } -void FileSystemContext::RegisterBackend( - FileSystemBackend* backend) { +void FileSystemContext::RegisterBackend(FileSystemBackend* backend) { const FileSystemType mount_types[] = { kFileSystemTypeTemporary, kFileSystemTypePersistent, @@ -445,4 +483,35 @@ void FileSystemContext::RegisterBackend( } } +void FileSystemContext::DidOpenFileSystemForResolveURL( + const FileSystemURL& url, + const FileSystemContext::ResolveURLCallback& callback, + const GURL& filesystem_root, + const std::string& filesystem_name, + base::PlatformFileError error) { + DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); + + if (error != base::PLATFORM_FILE_OK) { + callback.Run(error, FileSystemInfo(), base::FilePath(), false); + return; + } + + fileapi::FileSystemInfo info( + filesystem_name, filesystem_root, url.mount_type()); + + // Extract the virtual path not containing a filesystem type part from |url|. + base::FilePath parent = + base::FilePath::FromUTF8Unsafe(filesystem_root.path()); + base::FilePath child = base::FilePath::FromUTF8Unsafe(url.ToGURL().path()); + base::FilePath path; + + if (parent != child) { + bool result = parent.AppendRelativePath(child, &path); + DCHECK(result); + } + + operation_runner()->GetMetadata( + url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); +} + } // namespace fileapi diff --git a/chromium/webkit/browser/fileapi/file_system_context.h b/chromium/webkit/browser/fileapi/file_system_context.h index d6934ec7c68..21a31b89eb8 100644 --- a/chromium/webkit/browser/fileapi/file_system_context.h +++ b/chromium/webkit/browser/fileapi/file_system_context.h @@ -17,7 +17,7 @@ #include "base/sequenced_task_runner_helpers.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/open_file_system_mode.h" -#include "webkit/browser/fileapi/sandbox_context.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend_delegate.h" #include "webkit/browser/fileapi/task_runner_bound_observer_list.h" #include "webkit/browser/webkit_storage_browser_export.h" #include "webkit/common/fileapi/file_system_types.h" @@ -49,8 +49,8 @@ class CopyOrMoveFileValidatorFactory; class ExternalFileSystemBackend; class ExternalMountPoints; class FileStreamWriter; -class FileSystemFileUtil; class FileSystemBackend; +class FileSystemFileUtil; class FileSystemOperation; class FileSystemOperationRunner; class FileSystemOptions; @@ -61,6 +61,7 @@ class MountPoints; class SandboxFileSystemBackend; struct DefaultContextDeleter; +struct FileSystemInfo; // This class keeps and provides a file system context for FileSystem API. // An instance of this class is created and owned by profile. @@ -119,11 +120,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext // Returns the appropriate AsyncFileUtil instance for the given |type|. AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) const; - // Returns the appropriate FileUtil instance for the given |type|. - // This may return NULL if it is given an invalid type or the filesystem - // does not support synchronous file operations. - FileSystemFileUtil* GetFileUtil(FileSystemType type) const; - // Returns the appropriate CopyOrMoveFileValidatorFactory for the given // |type|. If |error_code| is PLATFORM_FILE_OK and the result is NULL, // then no validator is required. @@ -159,6 +155,12 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext const std::string& name, const GURL& root)> OpenFileSystemCallback; + // Used for ResolveURL. + typedef base::Callback<void(base::PlatformFileError result, + const FileSystemInfo& info, + const base::FilePath& file_path, + bool is_directory)> ResolveURLCallback; + // Used for DeleteFileSystem. typedef base::Callback<void(base::PlatformFileError result)> DeleteFileSystemCallback; @@ -174,8 +176,15 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext OpenFileSystemMode mode, const OpenFileSystemCallback& callback); + // Opens the filesystem for the given |url| as read-only, and then checks the + // existence of the file entry referred by the URL. This should be called on + // the IO thread. + void ResolveURL( + const FileSystemURL& url, + const ResolveURLCallback& callback); + // Deletes the filesystem for the given |origin_url| and |type|. This should - // be called on the IO Thread. + // be called on the IO thread. void DeleteFileSystem( const GURL& origin_url, FileSystemType type, @@ -228,7 +237,13 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext void EnableTemporaryFileSystemInIncognito(); #endif - SandboxContext* sandbox_context() { return sandbox_context_.get(); } + SandboxFileSystemBackendDelegate* sandbox_delegate() { + return sandbox_delegate_.get(); + } + + // Returns true if the requested url is ok to be served. + // (E.g. this returns false if the context is created for incognito mode) + bool CanServeURLRequest(const FileSystemURL& url) const; private: typedef std::map<FileSystemType, FileSystemBackend*> @@ -273,6 +288,13 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext // the constructor. void RegisterBackend(FileSystemBackend* backend); + void DidOpenFileSystemForResolveURL( + const FileSystemURL& url, + const ResolveURLCallback& callback, + const GURL& filesystem_root, + const std::string& filesystem_name, + base::PlatformFileError error); + // Returns a FileSystemBackend, used only by test code. SandboxFileSystemBackend* sandbox_backend() const { return sandbox_backend_.get(); @@ -283,7 +305,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; - scoped_ptr<SandboxContext> sandbox_context_; + scoped_ptr<SandboxFileSystemBackendDelegate> sandbox_delegate_; // Regular file system backends. scoped_ptr<SandboxFileSystemBackend> sandbox_backend_; @@ -311,6 +333,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext // The base path of the storage partition for this context. const base::FilePath partition_path_; + bool is_incognito_; + scoped_ptr<FileSystemOperationRunner> operation_runner_; DISALLOW_IMPLICIT_CONSTRUCTORS(FileSystemContext); diff --git a/chromium/webkit/browser/fileapi/file_system_dir_url_request_job.cc b/chromium/webkit/browser/fileapi/file_system_dir_url_request_job.cc index b91c7d00d9d..721a228b94e 100644 --- a/chromium/webkit/browser/fileapi/file_system_dir_url_request_job.cc +++ b/chromium/webkit/browser/fileapi/file_system_dir_url_request_job.cc @@ -23,6 +23,7 @@ #include "webkit/browser/fileapi/file_system_operation_runner.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/common/fileapi/directory_entry.h" +#include "webkit/common/fileapi/file_system_util.h" using net::NetworkDelegate; using net::URLRequest; @@ -80,6 +81,19 @@ void FileSystemDirURLRequestJob::StartAsync() { if (!request_) return; url_ = file_system_context_->CrackURL(request_->url()); + if (!file_system_context_->CanServeURLRequest(url_)) { + // In incognito mode the API is not usable and there should be no data. + if (url_.is_valid() && VirtualPath::IsRootPath(url_.virtual_path())) { + // Return an empty directory if the filesystem root is queried. + DidReadDirectory(base::PLATFORM_FILE_OK, + std::vector<DirectoryEntry>(), + false); + return; + } + NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, + net::ERR_FILE_NOT_FOUND)); + return; + } file_system_context_->operation_runner()->ReadDirectory( url_, base::Bind(&FileSystemDirURLRequestJob::DidReadDirectory, this)); diff --git a/chromium/webkit/browser/fileapi/file_system_dir_url_request_job_unittest.cc b/chromium/webkit/browser/fileapi/file_system_dir_url_request_job_unittest.cc index 1c197cd294d..e43ee4dfa3b 100644 --- a/chromium/webkit/browser/fileapi/file_system_dir_url_request_job_unittest.cc +++ b/chromium/webkit/browser/fileapi/file_system_dir_url_request_job_unittest.cc @@ -12,6 +12,7 @@ #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" #include "base/platform_file.h" +#include "base/run_loop.h" #include "base/strings/string_piece.h" #include "base/strings/utf_string_conversions.h" #include "net/base/net_errors.h" @@ -57,7 +58,7 @@ class FileSystemDirURLRequestJobTest : public testing::Test { OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, base::Bind(&FileSystemDirURLRequestJobTest::OnOpenFileSystem, weak_factory_.GetWeakPtr())); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); net::URLRequest::Deprecated::RegisterProtocolFactory( "filesystem", &FileSystemDirURLRequestJobFactory); @@ -78,12 +79,13 @@ class FileSystemDirURLRequestJobTest : public testing::Test { ASSERT_EQ(base::PLATFORM_FILE_OK, result); } - void TestRequestHelper(const GURL& url, bool run_to_completion) { + void TestRequestHelper(const GURL& url, bool run_to_completion, + FileSystemContext* file_system_context) { delegate_.reset(new net::TestDelegate()); delegate_->set_quit_on_redirect(true); request_.reset(empty_context_.CreateRequest(url, delegate_.get())); job_ = new FileSystemDirURLRequestJob( - request_.get(), NULL, file_system_context_.get()); + request_.get(), NULL, file_system_context); request_->Start(); ASSERT_TRUE(request_->is_pending()); // verify that we're starting async @@ -92,11 +94,16 @@ class FileSystemDirURLRequestJobTest : public testing::Test { } void TestRequest(const GURL& url) { - TestRequestHelper(url, true); + TestRequestHelper(url, true, file_system_context_.get()); + } + + void TestRequestWithContext(const GURL& url, + FileSystemContext* file_system_context) { + TestRequestHelper(url, true, file_system_context); } void TestRequestNoRun(const GURL& url) { - TestRequestHelper(url, false); + TestRequestHelper(url, false, file_system_context_.get()); } FileSystemURL CreateURL(const base::FilePath& file_path) { @@ -199,7 +206,7 @@ class FileSystemDirURLRequestJobTest : public testing::Test { } FileSystemFileUtil* file_util() { - return file_system_context_->GetFileUtil(kFileSystemTypeTemporary); + return file_system_context_->sandbox_delegate()->sync_file_util(); } // Put the message loop at the top, so that it's the last thing deleted. @@ -282,9 +289,32 @@ TEST_F(FileSystemDirURLRequestJobTest, Cancel) { TestRequestNoRun(CreateFileSystemURL("foo/")); // Run StartAsync() and only StartAsync(). base::MessageLoop::current()->DeleteSoon(FROM_HERE, request_.release()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); // If we get here, success! we didn't crash! } +TEST_F(FileSystemDirURLRequestJobTest, Incognito) { + CreateDirectory("foo"); + + scoped_refptr<FileSystemContext> file_system_context = + CreateIncognitoFileSystemContextForTesting(NULL, temp_dir_.path()); + + TestRequestWithContext(CreateFileSystemURL("/"), + file_system_context.get()); + ASSERT_FALSE(request_->is_pending()); + ASSERT_TRUE(request_->status().is_success()); + + std::istringstream in(delegate_->data_received()); + std::string line; + EXPECT_TRUE(std::getline(in, line)); + EXPECT_FALSE(std::getline(in, line)); + + TestRequestWithContext(CreateFileSystemURL("foo"), + file_system_context.get()); + ASSERT_FALSE(request_->is_pending()); + ASSERT_FALSE(request_->status().is_success()); + EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); +} + } // namespace (anonymous) } // namespace fileapi diff --git a/chromium/webkit/browser/fileapi/file_system_file_stream_reader.cc b/chromium/webkit/browser/fileapi/file_system_file_stream_reader.cc index 71b38278186..d3697c201e5 100644 --- a/chromium/webkit/browser/fileapi/file_system_file_stream_reader.cc +++ b/chromium/webkit/browser/fileapi/file_system_file_stream_reader.cc @@ -10,11 +10,29 @@ #include "net/base/file_stream.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" -#include "webkit/browser/blob/local_file_stream_reader.h" +#include "webkit/browser/blob/file_stream_reader.h" #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_operation_runner.h" -using webkit_blob::LocalFileStreamReader; +using webkit_blob::FileStreamReader; + +// TODO(kinuko): Remove this temporary namespace hack after we move both +// blob and fileapi into content namespace. +namespace webkit_blob { + +FileStreamReader* FileStreamReader::CreateForFileSystemFile( + fileapi::FileSystemContext* file_system_context, + const fileapi::FileSystemURL& url, + int64 initial_offset, + const base::Time& expected_modification_time) { + return new fileapi::FileSystemFileStreamReader( + file_system_context, + url, + initial_offset, + expected_modification_time); +} + +} // webkit_blob namespace fileapi { @@ -46,19 +64,6 @@ void Int64CallbackAdapter(const net::Int64CompletionCallback& callback, } // namespace -FileSystemFileStreamReader::FileSystemFileStreamReader( - FileSystemContext* file_system_context, - const FileSystemURL& url, - int64 initial_offset, - const base::Time& expected_modification_time) - : file_system_context_(file_system_context), - url_(url), - initial_offset_(initial_offset), - expected_modification_time_(expected_modification_time), - has_pending_create_snapshot_(false), - weak_factory_(this) { -} - FileSystemFileStreamReader::~FileSystemFileStreamReader() { } @@ -82,6 +87,19 @@ int64 FileSystemFileStreamReader::GetLength( base::Bind(&Int64CallbackAdapter, callback)); } +FileSystemFileStreamReader::FileSystemFileStreamReader( + FileSystemContext* file_system_context, + const FileSystemURL& url, + int64 initial_offset, + const base::Time& expected_modification_time) + : file_system_context_(file_system_context), + url_(url), + initial_offset_(initial_offset), + expected_modification_time_(expected_modification_time), + has_pending_create_snapshot_(false), + weak_factory_(this) { +} + int FileSystemFileStreamReader::CreateSnapshot( const base::Closure& callback, const net::CompletionCallback& error_callback) { @@ -116,7 +134,7 @@ void FileSystemFileStreamReader::DidCreateSnapshot( snapshot_ref_ = file_ref; local_file_reader_.reset( - new LocalFileStreamReader( + FileStreamReader::CreateForLocalFile( file_system_context_->default_file_task_runner(), platform_path, initial_offset_, expected_modification_time_)); diff --git a/chromium/webkit/browser/fileapi/file_system_file_stream_reader.h b/chromium/webkit/browser/fileapi/file_system_file_stream_reader.h index 634f5684c42..3a90663ed95 100644 --- a/chromium/webkit/browser/fileapi/file_system_file_stream_reader.h +++ b/chromium/webkit/browser/fileapi/file_system_file_stream_reader.h @@ -19,30 +19,18 @@ class FilePath; class SequencedTaskRunner; } -namespace webkit_blob { -class LocalFileStreamReader; -} - namespace fileapi { class FileSystemContext; -// TODO(kinaba,satorux): This generic implementation would work for any -// filesystems but remote filesystem should implement its own reader -// rather than relying on FileSystemOperation::GetSnapshotFile() which -// may force downloading the entire contents for remote files. +// Generic FileStreamReader implementation for FileSystem files. +// Note: This generic implementation would work for any filesystems but +// remote filesystem should implement its own reader rather than relying +// on FileSystemOperation::GetSnapshotFile() which may force downloading +// the entire contents for remote files. class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemFileStreamReader - : public webkit_blob::FileStreamReader { + : public NON_EXPORTED_BASE(webkit_blob::FileStreamReader) { public: - // Creates a new FileReader for a filesystem URL |url| form |initial_offset|. - // |expected_modification_time| specifies the expected last modification if - // the value is non-null, the reader will check the underlying file's actual - // modification time to see if the file has been modified, and if it does any - // succeeding read operations should fail with ERR_UPLOAD_FILE_CHANGED error. - FileSystemFileStreamReader(FileSystemContext* file_system_context, - const FileSystemURL& url, - int64 initial_offset, - const base::Time& expected_modification_time); virtual ~FileSystemFileStreamReader(); // FileStreamReader overrides. @@ -52,6 +40,14 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemFileStreamReader const net::Int64CompletionCallback& callback) OVERRIDE; private: + friend class webkit_blob::FileStreamReader; + friend class FileSystemFileStreamReaderTest; + + FileSystemFileStreamReader(FileSystemContext* file_system_context, + const FileSystemURL& url, + int64 initial_offset, + const base::Time& expected_modification_time); + int CreateSnapshot(const base::Closure& callback, const net::CompletionCallback& error_callback); void DidCreateSnapshot( @@ -66,7 +62,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemFileStreamReader FileSystemURL url_; const int64 initial_offset_; const base::Time expected_modification_time_; - scoped_ptr<webkit_blob::LocalFileStreamReader> local_file_reader_; + scoped_ptr<webkit_blob::FileStreamReader> local_file_reader_; scoped_refptr<webkit_blob::ShareableFileReference> snapshot_ref_; bool has_pending_create_snapshot_; base::WeakPtrFactory<FileSystemFileStreamReader> weak_factory_; diff --git a/chromium/webkit/browser/fileapi/file_system_file_stream_reader_unittest.cc b/chromium/webkit/browser/fileapi/file_system_file_stream_reader_unittest.cc index ca82338a5cc..0ce56585e42 100644 --- a/chromium/webkit/browser/fileapi/file_system_file_stream_reader_unittest.cc +++ b/chromium/webkit/browser/fileapi/file_system_file_stream_reader_unittest.cc @@ -9,16 +9,16 @@ #include "base/files/scoped_temp_dir.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop.h" #include "base/platform_file.h" +#include "base/run_loop.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" #include "net/base/test_completion_callback.h" #include "testing/gtest/include/gtest/gtest.h" +#include "webkit/browser/fileapi/async_file_test_helper.h" #include "webkit/browser/fileapi/external_mount_points.h" #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_file_util.h" -#include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/mock_file_system_context.h" namespace fileapi { @@ -73,14 +73,14 @@ class FileSystemFileStreamReaderTest : public testing::Test { GURL(kURLOrigin), kFileSystemTypeTemporary, OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, base::Bind(&OnOpenFileSystem)); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); WriteFile(kTestFileName, kTestData, kTestDataSize, &test_file_modification_time_); } virtual void TearDown() OVERRIDE { - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } protected: @@ -102,32 +102,16 @@ class FileSystemFileStreamReaderTest : public testing::Test { const char* buf, int buf_size, base::Time* modification_time) { - FileSystemFileUtil* file_util = file_system_context_->GetFileUtil( - kFileSystemTypeTemporary); FileSystemURL url = GetFileSystemURL(file_name); - FileSystemOperationContext context(file_system_context_.get()); - context.set_allowed_bytes_growth(1024); - - base::PlatformFile handle = base::kInvalidPlatformFileValue; - bool created = false; - ASSERT_EQ(base::PLATFORM_FILE_OK, file_util->CreateOrOpen( - &context, - url, - base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_WRITE, - &handle, - &created)); - EXPECT_TRUE(created); - ASSERT_NE(base::kInvalidPlatformFileValue, handle); - ASSERT_EQ(buf_size, - base::WritePlatformFile(handle, 0 /* offset */, buf, buf_size)); - base::ClosePlatformFile(handle); + ASSERT_EQ(base::PLATFORM_FILE_OK, + fileapi::AsyncFileTestHelper::CreateFileWithData( + file_system_context_, url, buf, buf_size)); base::PlatformFileInfo file_info; - base::FilePath platform_path; ASSERT_EQ(base::PLATFORM_FILE_OK, - file_util->GetFileInfo(&context, url, &file_info, - &platform_path)); + AsyncFileTestHelper::GetMetadata( + file_system_context_, url, &file_info)); if (modification_time) *modification_time = file_info.last_modified; } diff --git a/chromium/webkit/browser/fileapi/file_system_operation.h b/chromium/webkit/browser/fileapi/file_system_operation.h index f1adc191a7e..99d3b3d6a97 100644 --- a/chromium/webkit/browser/fileapi/file_system_operation.h +++ b/chromium/webkit/browser/fileapi/file_system_operation.h @@ -11,6 +11,8 @@ #include "base/files/file_path.h" #include "base/platform_file.h" #include "base/process/process.h" +#include "webkit/browser/fileapi/file_system_operation_context.h" +#include "webkit/browser/webkit_storage_browser_export.h" #include "webkit/common/fileapi/directory_entry.h" namespace base { @@ -29,9 +31,9 @@ class GURL; namespace fileapi { +class FileSystemContext; class FileSystemURL; class FileWriterDelegate; -class FileSystemOperationImpl; // The interface class for FileSystemOperation implementations. // @@ -56,6 +58,11 @@ class FileSystemOperationImpl; // it gets called. class FileSystemOperation { public: + WEBKIT_STORAGE_BROWSER_EXPORT static FileSystemOperation* Create( + const FileSystemURL& url, + FileSystemContext* file_system_context, + scoped_ptr<FileSystemOperationContext> operation_context); + virtual ~FileSystemOperation() {} // Used for CreateFile(), etc. |result| is the return code of the operation. @@ -115,6 +122,93 @@ class FileSystemOperation { const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref)> SnapshotFileCallback; + // Used for progress update callback for Copy(). + // + // BEGIN_COPY_ENTRY is fired for each copy creation beginning (for both + // file and directory). + // The |source_url| is the URL of the source entry. |size| should not be + // used. + // + // END_COPY_ENTRY is fired for each copy creation finishing (for both + // file and directory). + // The |source_url| is the URL of the source entry. The |destination_url| is + // the URL of the destination entry. |size| should not be used. + // + // PROGRESS is fired periodically during file copying (not fired for + // directory copy). + // The |source_url| is the URL of the source file. |size| is the number + // of cumulative copied bytes for the currently copied file. + // Both at beginning and ending of file copying, PROGRESS event should be + // called. At beginning, |size| should be 0. At ending, |size| should be + // the size of the file. + // + // Here is an example callback sequence of recursive copy. Suppose + // there are a/b/c.txt (100 bytes) and a/b/d.txt (200 bytes), and trying to + // copy a to x recursively, then the progress update sequence will be: + // + // BEGIN_COPY_ENTRY a (starting create "a" directory in x/). + // END_COPY_ENTRY a x/a (creating "a" directory in x/ is finished). + // + // BEGIN_COPY_ENTRY a/b (starting create "b" directory in x/a). + // END_COPY_ENTRY a/b x/a/b (creating "b" directory in x/a/ is finished). + // + // BEGIN_COPY_ENTRY a/b/c.txt (starting to copy "c.txt" in x/a/b/). + // PROGRESS a/b/c.txt 0 (The first PROGRESS's |size| should be 0). + // PROGRESS a/b/c.txt 10 + // : + // PROGRESS a/b/c.txt 90 + // PROGRESS a/b/c.txt 100 (The last PROGRESS's |size| should be the size of + // the file). + // END_COPY_ENTRY a/b/c.txt x/a/b/c.txt (copying "c.txt" is finished). + // + // BEGIN_COPY_ENTRY a/b/d.txt (starting to copy "d.txt" in x/a/b). + // PROGRESS a/b/d.txt 0 (The first PROGRESS's |size| should be 0). + // PROGRESS a/b/d.txt 10 + // : + // PROGRESS a/b/d.txt 190 + // PROGRESS a/b/d.txt 200 (The last PROGRESS's |size| should be the size of + // the file). + // END_COPY_ENTRY a/b/d.txt x/a/b/d.txt (copy "d.txt" is finished). + // + // Note that event sequence of a/b/c.txt and a/b/d.txt can be interlaced, + // because they can be done in parallel. Also PROGRESS events are optional, + // so they may not be appeared. + // All the progress callback invocation should be done before StatusCallback + // given to the Copy is called. Especially if an error is found before first + // progres callback invocation, the progress callback may NOT invoked for the + // copy. + // + // Note for future extension. Currently this callback is only supported on + // Copy(). We can extend this to Move(), because Move() is sometimes + // implemented as "copy then delete." + // In more precise, Move() usually can be implemented either 1) by updating + // the metadata of resource (e.g. root of moving directory tree), or 2) by + // copying directory tree and them removing the source tree. + // For 1)'s case, we can simply add BEGIN_MOVE_ENTRY and END_MOVE_ENTRY + // for root directory. + // For 2)'s case, we can add BEGIN_DELETE_ENTRY and END_DELETE_ENTRY for each + // entry. + // For both cases, we probably won't need to use PROGRESS event because + // these operations should be done quickly (at least much faster than copying + // usually). + enum CopyProgressType { + BEGIN_COPY_ENTRY, + END_COPY_ENTRY, + PROGRESS, + }; + typedef base::Callback<void(CopyProgressType type, + const FileSystemURL& source_url, + const FileSystemURL& destination_url, + int64 size)> + CopyProgressCallback; + + // Used for CopyFileLocal() to report progress update. + // |size| is the cumulative copied bytes for the copy. + // At the beginning the progress callback should be called with |size| = 0, + // and also at the ending the progress callback should be called with |size| + // set to the copied file size. + typedef base::Callback<void(int64 size)> CopyFileProgressCallback; + // Used for Write(). typedef base::Callback<void(base::PlatformFileError result, int64 bytes, @@ -139,12 +233,34 @@ class FileSystemOperation { // |src_path| is a directory, the contents of |src_path| are copied to // |dest_path| recursively. A new file or directory is created at // |dest_path| as needed. + // |progress_callback| is periodically called to report the progress + // update. See also the comment of CopyProgressCallback. This callback is + // optional. + // + // For recursive case this internally creates new FileSystemOperations and + // calls: + // - ReadDirectory, CopyFileLocal and CreateDirectory + // for same-filesystem case, or + // - ReadDirectory and CreateSnapshotFile on source filesystem and + // CopyInForeignFile and CreateDirectory on dest filesystem + // for cross-filesystem case. + // virtual void Copy(const FileSystemURL& src_path, const FileSystemURL& dest_path, + const CopyProgressCallback& progress_callback, const StatusCallback& callback) = 0; // Moves a file or directory from |src_path| to |dest_path|. A new file // or directory is created at |dest_path| as needed. + // + // For recursive case this internally creates new FileSystemOperations and + // calls: + // - ReadDirectory, MoveFileLocal, CreateDirectory and Remove + // for same-filesystem case, or + // - ReadDirectory, CreateSnapshotFile and Remove on source filesystem and + // CopyInForeignFile and CreateDirectory on dest filesystem + // for cross-filesystem case. + // virtual void Move(const FileSystemURL& src_path, const FileSystemURL& dest_path, const StatusCallback& callback) = 0; @@ -230,11 +346,6 @@ class FileSystemOperation { base::ProcessHandle peer_handle, const OpenFileCallback& callback) = 0; - // For downcasting to FileSystemOperationImpl. - // TODO(kinuko): this hack should go away once appropriate upload-stream - // handling based on element types is supported. - virtual FileSystemOperationImpl* AsFileSystemOperationImpl() = 0; - // Creates a local snapshot file for a given |path| and returns the // metadata and platform path of the snapshot file via |callback|. // In local filesystem cases the implementation may simply return @@ -246,6 +357,86 @@ class FileSystemOperation { virtual void CreateSnapshotFile(const FileSystemURL& path, const SnapshotFileCallback& callback) = 0; + // Copies in a single file from a different filesystem. + // + // This returns: + // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_file_path| + // or the parent directory of |dest_url| does not exist. + // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and + // is not a file. + // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and + // its parent path is a file. + // + virtual void CopyInForeignFile(const base::FilePath& src_local_disk_path, + const FileSystemURL& dest_url, + const StatusCallback& callback) = 0; + + // Removes a single file. + // + // This returns: + // - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist. + // - PLATFORM_FILE_ERROR_NOT_A_FILE if |url| is not a file. + // + virtual void RemoveFile(const FileSystemURL& url, + const StatusCallback& callback) = 0; + + // Removes a single empty directory. + // + // This returns: + // - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist. + // - PLATFORM_FILE_ERROR_NOT_A_DIRECTORY if |url| is not a directory. + // - PLATFORM_FILE_ERROR_NOT_EMPTY if |url| is not empty. + // + virtual void RemoveDirectory(const FileSystemURL& url, + const StatusCallback& callback) = 0; + + // Copies a file from |src_url| to |dest_url|. + // This must be called for files that belong to the same filesystem + // (i.e. type() and origin() of the |src_url| and |dest_url| must match). + // |progress_callback| is periodically called to report the progress + // update. See also the comment of CopyFileProgressCallback. This callback is + // optional. + // + // This returns: + // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_url| + // or the parent directory of |dest_url| does not exist. + // - PLATFORM_FILE_ERROR_NOT_A_FILE if |src_url| exists but is not a file. + // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and + // is not a file. + // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and + // its parent path is a file. + // + virtual void CopyFileLocal(const FileSystemURL& src_url, + const FileSystemURL& dest_url, + const CopyFileProgressCallback& progress_callback, + const StatusCallback& callback) = 0; + + // Moves a local file from |src_url| to |dest_url|. + // This must be called for files that belong to the same filesystem + // (i.e. type() and origin() of the |src_url| and |dest_url| must match). + // + // This returns: + // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_url| + // or the parent directory of |dest_url| does not exist. + // - PLATFORM_FILE_ERROR_NOT_A_FILE if |src_url| exists but is not a file. + // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and + // is not a file. + // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and + // its parent path is a file. + // + virtual void MoveFileLocal(const FileSystemURL& src_url, + const FileSystemURL& dest_url, + const StatusCallback& callback) = 0; + + // Synchronously gets the platform path for the given |url|. + // This may fail if the given |url|'s filesystem type is neither + // temporary nor persistent. + // In such a case, base::PLATFORM_FILE_ERROR_INVALID_OPERATION will be + // returned. + virtual base::PlatformFileError SyncGetPlatformPath( + const FileSystemURL& url, + base::FilePath* platform_path) = 0; + protected: // Used only for internal assertions. enum OperationType { diff --git a/chromium/webkit/browser/fileapi/file_system_operation_context.h b/chromium/webkit/browser/fileapi/file_system_operation_context.h index 4d175108482..decdecbb5ca 100644 --- a/chromium/webkit/browser/fileapi/file_system_operation_context.h +++ b/chromium/webkit/browser/fileapi/file_system_operation_context.h @@ -52,7 +52,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemOperationContext int64 allowed_bytes_growth() const { return allowed_bytes_growth_; } quota::QuotaLimitType quota_limit_type() const { return quota_limit_type_; } base::SequencedTaskRunner* task_runner() const { return task_runner_.get(); } - const base::FilePath& root_path() const { return root_path_; } ChangeObserverList* change_observers() { return &change_observers_; } UpdateObserverList* update_observers() { return &update_observers_; } @@ -72,10 +71,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemOperationContext DCHECK(setter_thread_checker_.CalledOnValidThread()); quota_limit_type_ = limit_type; } - void set_root_path(const base::FilePath& root_path) { - DCHECK(setter_thread_checker_.CalledOnValidThread()); - root_path_ = root_path; - } private: scoped_refptr<FileSystemContext> file_system_context_; @@ -91,9 +86,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemOperationContext ChangeObserverList change_observers_; UpdateObserverList update_observers_; - // Root path for the operation, used by LocalFileUtil. - base::FilePath root_path_; - // Used to check its setters are not called on arbitrary thread. base::ThreadChecker setter_thread_checker_; diff --git a/chromium/webkit/browser/fileapi/file_system_operation_impl.cc b/chromium/webkit/browser/fileapi/file_system_operation_impl.cc index 60f79901923..c9e75eb9acd 100644 --- a/chromium/webkit/browser/fileapi/file_system_operation_impl.cc +++ b/chromium/webkit/browser/fileapi/file_system_operation_impl.cc @@ -20,7 +20,7 @@ #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/file_writer_delegate.h" #include "webkit/browser/fileapi/remove_operation_delegate.h" -#include "webkit/browser/fileapi/sandbox_file_stream_writer.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend.h" #include "webkit/browser/quota/quota_manager.h" #include "webkit/common/blob/shareable_file_reference.h" #include "webkit/common/fileapi/file_system_types.h" @@ -31,19 +31,12 @@ using webkit_blob::ScopedFile; namespace fileapi { -FileSystemOperationImpl::FileSystemOperationImpl( +FileSystemOperation* FileSystemOperation::Create( const FileSystemURL& url, FileSystemContext* file_system_context, - scoped_ptr<FileSystemOperationContext> operation_context) - : file_system_context_(file_system_context), - operation_context_(operation_context.Pass()), - async_file_util_(NULL), - peer_handle_(base::kNullProcessHandle), - pending_operation_(kOperationNone) { - DCHECK(operation_context_.get()); - operation_context_->DetachUserDataThread(); - async_file_util_ = file_system_context_->GetAsyncFileUtil(url.type()); - DCHECK(async_file_util_); + scoped_ptr<FileSystemOperationContext> operation_context) { + return new FileSystemOperationImpl(url, file_system_context, + operation_context.Pass()); } FileSystemOperationImpl::~FileSystemOperationImpl() { @@ -56,7 +49,7 @@ void FileSystemOperationImpl::CreateFile(const FileSystemURL& url, GetUsageAndQuotaThenRunTask( url, base::Bind(&FileSystemOperationImpl::DoCreateFile, - AsWeakPtr(), url, callback, exclusive), + weak_factory_.GetWeakPtr(), url, callback, exclusive), base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED)); } @@ -68,22 +61,28 @@ void FileSystemOperationImpl::CreateDirectory(const FileSystemURL& url, GetUsageAndQuotaThenRunTask( url, base::Bind(&FileSystemOperationImpl::DoCreateDirectory, - AsWeakPtr(), url, callback, exclusive, recursive), + weak_factory_.GetWeakPtr(), url, callback, + exclusive, recursive), base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED)); } -void FileSystemOperationImpl::Copy(const FileSystemURL& src_url, - const FileSystemURL& dest_url, - const StatusCallback& callback) { +void FileSystemOperationImpl::Copy( + const FileSystemURL& src_url, + const FileSystemURL& dest_url, + const CopyProgressCallback& progress_callback, + const StatusCallback& callback) { DCHECK(SetPendingOperationType(kOperationCopy)); DCHECK(!recursive_operation_delegate_); + + // TODO(hidehiko): Support |progress_callback|. (crbug.com/278038). recursive_operation_delegate_.reset( new CopyOrMoveOperationDelegate( file_system_context(), src_url, dest_url, CopyOrMoveOperationDelegate::OPERATION_COPY, + progress_callback, base::Bind(&FileSystemOperationImpl::DidFinishOperation, - AsWeakPtr(), callback))); + weak_factory_.GetWeakPtr(), callback))); recursive_operation_delegate_->RunRecursively(); } @@ -97,8 +96,9 @@ void FileSystemOperationImpl::Move(const FileSystemURL& src_url, file_system_context(), src_url, dest_url, CopyOrMoveOperationDelegate::OPERATION_MOVE, + FileSystemOperation::CopyProgressCallback(), base::Bind(&FileSystemOperationImpl::DidFinishOperation, - AsWeakPtr(), callback))); + weak_factory_.GetWeakPtr(), callback))); recursive_operation_delegate_->RunRecursively(); } @@ -108,7 +108,7 @@ void FileSystemOperationImpl::DirectoryExists(const FileSystemURL& url, async_file_util_->GetFileInfo( operation_context_.Pass(), url, base::Bind(&FileSystemOperationImpl::DidDirectoryExists, - AsWeakPtr(), callback)); + weak_factory_.GetWeakPtr(), callback)); } void FileSystemOperationImpl::FileExists(const FileSystemURL& url, @@ -117,7 +117,7 @@ void FileSystemOperationImpl::FileExists(const FileSystemURL& url, async_file_util_->GetFileInfo( operation_context_.Pass(), url, base::Bind(&FileSystemOperationImpl::DidFileExists, - AsWeakPtr(), callback)); + weak_factory_.GetWeakPtr(), callback)); } void FileSystemOperationImpl::GetMetadata( @@ -146,7 +146,7 @@ void FileSystemOperationImpl::Remove(const FileSystemURL& url, async_file_util_->DeleteRecursively( operation_context_.Pass(), url, base::Bind(&FileSystemOperationImpl::DidDeleteRecursively, - AsWeakPtr(), url, callback)); + weak_factory_.GetWeakPtr(), url, callback)); return; } @@ -154,7 +154,7 @@ void FileSystemOperationImpl::Remove(const FileSystemURL& url, new RemoveOperationDelegate( file_system_context(), url, base::Bind(&FileSystemOperationImpl::DidFinishOperation, - AsWeakPtr(), callback))); + weak_factory_.GetWeakPtr(), callback))); recursive_operation_delegate_->Run(); } @@ -167,8 +167,8 @@ void FileSystemOperationImpl::Write( file_writer_delegate_ = writer_delegate.Pass(); file_writer_delegate_->Start( blob_request.Pass(), - base::Bind(&FileSystemOperationImpl::DidWrite, AsWeakPtr(), - url, callback)); + base::Bind(&FileSystemOperationImpl::DidWrite, + weak_factory_.GetWeakPtr(), url, callback)); } void FileSystemOperationImpl::Truncate(const FileSystemURL& url, int64 length, @@ -177,7 +177,7 @@ void FileSystemOperationImpl::Truncate(const FileSystemURL& url, int64 length, GetUsageAndQuotaThenRunTask( url, base::Bind(&FileSystemOperationImpl::DoTruncate, - AsWeakPtr(), url, callback, length), + weak_factory_.GetWeakPtr(), url, callback, length), base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED)); } @@ -190,7 +190,7 @@ void FileSystemOperationImpl::TouchFile(const FileSystemURL& url, operation_context_.Pass(), url, last_access_time, last_modified_time, base::Bind(&FileSystemOperationImpl::DidFinishOperation, - AsWeakPtr(), callback)); + weak_factory_.GetWeakPtr(), callback)); } void FileSystemOperationImpl::OpenFile(const FileSystemURL& url, @@ -212,7 +212,7 @@ void FileSystemOperationImpl::OpenFile(const FileSystemURL& url, GetUsageAndQuotaThenRunTask( url, base::Bind(&FileSystemOperationImpl::DoOpenFile, - AsWeakPtr(), + weak_factory_.GetWeakPtr(), url, callback, file_flags), base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED, base::kInvalidPlatformFileValue, @@ -230,6 +230,9 @@ void FileSystemOperationImpl::Cancel(const StatusCallback& cancel_callback) { DCHECK_EQ(kOperationWrite, pending_operation_); // This will call DidWrite() with ABORT status code. file_writer_delegate_->Cancel(); + } else if (recursive_operation_delegate_) { + // This will call DidFinishOperation() with ABORT status code. + recursive_operation_delegate_->Cancel(); } else { // For truncate we have no way to cancel the inflight operation (for now). // Let it just run and dispatch cancel callback later. @@ -237,22 +240,6 @@ void FileSystemOperationImpl::Cancel(const StatusCallback& cancel_callback) { } } -FileSystemOperationImpl* FileSystemOperationImpl::AsFileSystemOperationImpl() { - return this; -} - -base::PlatformFileError FileSystemOperationImpl::SyncGetPlatformPath( - const FileSystemURL& url, - base::FilePath* platform_path) { - DCHECK(SetPendingOperationType(kOperationGetLocalPath)); - FileSystemFileUtil* file_util = file_system_context()->GetFileUtil( - url.type()); - if (!file_util) - return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; - file_util->GetLocalFilePath(operation_context_.get(), url, platform_path); - return base::PLATFORM_FILE_OK; -} - void FileSystemOperationImpl::CreateSnapshotFile( const FileSystemURL& url, const SnapshotFileCallback& callback) { @@ -269,7 +256,7 @@ void FileSystemOperationImpl::CopyInForeignFile( GetUsageAndQuotaThenRunTask( dest_url, base::Bind(&FileSystemOperationImpl::DoCopyInForeignFile, - AsWeakPtr(), src_local_disk_file_path, dest_url, + weak_factory_.GetWeakPtr(), src_local_disk_file_path, dest_url, callback), base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED)); } @@ -281,7 +268,7 @@ void FileSystemOperationImpl::RemoveFile( async_file_util_->DeleteFile( operation_context_.Pass(), url, base::Bind(&FileSystemOperationImpl::DidFinishOperation, - AsWeakPtr(), callback)); + weak_factory_.GetWeakPtr(), callback)); } void FileSystemOperationImpl::RemoveDirectory( @@ -291,19 +278,22 @@ void FileSystemOperationImpl::RemoveDirectory( async_file_util_->DeleteDirectory( operation_context_.Pass(), url, base::Bind(&FileSystemOperationImpl::DidFinishOperation, - AsWeakPtr(), callback)); + weak_factory_.GetWeakPtr(), callback)); } void FileSystemOperationImpl::CopyFileLocal( const FileSystemURL& src_url, const FileSystemURL& dest_url, + const CopyFileProgressCallback& progress_callback, const StatusCallback& callback) { DCHECK(SetPendingOperationType(kOperationCopy)); DCHECK(src_url.IsInSameFileSystem(dest_url)); + GetUsageAndQuotaThenRunTask( dest_url, base::Bind(&FileSystemOperationImpl::DoCopyFileLocal, - AsWeakPtr(), src_url, dest_url, callback), + weak_factory_.GetWeakPtr(), src_url, dest_url, + progress_callback, callback), base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED)); } @@ -316,10 +306,38 @@ void FileSystemOperationImpl::MoveFileLocal( GetUsageAndQuotaThenRunTask( dest_url, base::Bind(&FileSystemOperationImpl::DoMoveFileLocal, - AsWeakPtr(), src_url, dest_url, callback), + weak_factory_.GetWeakPtr(), src_url, dest_url, callback), base::Bind(callback, base::PLATFORM_FILE_ERROR_FAILED)); } +base::PlatformFileError FileSystemOperationImpl::SyncGetPlatformPath( + const FileSystemURL& url, + base::FilePath* platform_path) { + DCHECK(SetPendingOperationType(kOperationGetLocalPath)); + if (!file_system_context()->IsSandboxFileSystem(url.type())) + return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; + FileSystemFileUtil* file_util = + file_system_context()->sandbox_delegate()->sync_file_util(); + file_util->GetLocalFilePath(operation_context_.get(), url, platform_path); + return base::PLATFORM_FILE_OK; +} + +FileSystemOperationImpl::FileSystemOperationImpl( + const FileSystemURL& url, + FileSystemContext* file_system_context, + scoped_ptr<FileSystemOperationContext> operation_context) + : file_system_context_(file_system_context), + operation_context_(operation_context.Pass()), + async_file_util_(NULL), + peer_handle_(base::kNullProcessHandle), + pending_operation_(kOperationNone), + weak_factory_(this) { + DCHECK(operation_context_.get()); + operation_context_->DetachUserDataThread(); + async_file_util_ = file_system_context_->GetAsyncFileUtil(url.type()); + DCHECK(async_file_util_); +} + void FileSystemOperationImpl::GetUsageAndQuotaThenRunTask( const FileSystemURL& url, const base::Closure& task, @@ -341,7 +359,7 @@ void FileSystemOperationImpl::GetUsageAndQuotaThenRunTask( url.origin(), FileSystemTypeToQuotaStorageType(url.type()), base::Bind(&FileSystemOperationImpl::DidGetUsageAndQuotaAndRunTask, - AsWeakPtr(), task, error_callback)); + weak_factory_.GetWeakPtr(), task, error_callback)); } void FileSystemOperationImpl::DidGetUsageAndQuotaAndRunTask( @@ -369,7 +387,7 @@ void FileSystemOperationImpl::DoCreateFile( exclusive ? &FileSystemOperationImpl::DidEnsureFileExistsExclusive : &FileSystemOperationImpl::DidEnsureFileExistsNonExclusive, - AsWeakPtr(), callback)); + weak_factory_.GetWeakPtr(), callback)); } void FileSystemOperationImpl::DoCreateDirectory( @@ -380,17 +398,18 @@ void FileSystemOperationImpl::DoCreateDirectory( operation_context_.Pass(), url, exclusive, recursive, base::Bind(&FileSystemOperationImpl::DidFinishOperation, - AsWeakPtr(), callback)); + weak_factory_.GetWeakPtr(), callback)); } void FileSystemOperationImpl::DoCopyFileLocal( const FileSystemURL& src_url, const FileSystemURL& dest_url, + const CopyFileProgressCallback& progress_callback, const StatusCallback& callback) { async_file_util_->CopyFileLocal( - operation_context_.Pass(), src_url, dest_url, + operation_context_.Pass(), src_url, dest_url, progress_callback, base::Bind(&FileSystemOperationImpl::DidFinishOperation, - AsWeakPtr(), callback)); + weak_factory_.GetWeakPtr(), callback)); } void FileSystemOperationImpl::DoMoveFileLocal( @@ -400,7 +419,7 @@ void FileSystemOperationImpl::DoMoveFileLocal( async_file_util_->MoveFileLocal( operation_context_.Pass(), src_url, dest_url, base::Bind(&FileSystemOperationImpl::DidFinishOperation, - AsWeakPtr(), callback)); + weak_factory_.GetWeakPtr(), callback)); } void FileSystemOperationImpl::DoCopyInForeignFile( @@ -411,7 +430,7 @@ void FileSystemOperationImpl::DoCopyInForeignFile( operation_context_.Pass(), src_local_disk_file_path, dest_url, base::Bind(&FileSystemOperationImpl::DidFinishOperation, - AsWeakPtr(), callback)); + weak_factory_.GetWeakPtr(), callback)); } void FileSystemOperationImpl::DoTruncate(const FileSystemURL& url, @@ -420,7 +439,7 @@ void FileSystemOperationImpl::DoTruncate(const FileSystemURL& url, async_file_util_->Truncate( operation_context_.Pass(), url, length, base::Bind(&FileSystemOperationImpl::DidFinishOperation, - AsWeakPtr(), callback)); + weak_factory_.GetWeakPtr(), callback)); } void FileSystemOperationImpl::DoOpenFile(const FileSystemURL& url, @@ -429,7 +448,7 @@ void FileSystemOperationImpl::DoOpenFile(const FileSystemURL& url, async_file_util_->CreateOrOpen( operation_context_.Pass(), url, file_flags, base::Bind(&FileSystemOperationImpl::DidOpenFile, - AsWeakPtr(), callback)); + weak_factory_.GetWeakPtr(), callback)); } void FileSystemOperationImpl::DidEnsureFileExistsExclusive( @@ -452,11 +471,13 @@ void FileSystemOperationImpl::DidFinishOperation( const StatusCallback& callback, base::PlatformFileError rv) { if (!cancel_callback_.is_null()) { - DCHECK_EQ(kOperationTruncate, pending_operation_); - StatusCallback cancel_callback = cancel_callback_; - callback.Run(base::PLATFORM_FILE_ERROR_ABORT); - cancel_callback.Run(base::PLATFORM_FILE_OK); + callback.Run(rv); + + // Return OK only if we succeeded to stop the operation. + cancel_callback.Run(rv == base::PLATFORM_FILE_ERROR_ABORT ? + base::PLATFORM_FILE_OK : + base::PLATFORM_FILE_ERROR_INVALID_OPERATION); } else { callback.Run(rv); } @@ -491,7 +512,7 @@ void FileSystemOperationImpl::DidDeleteRecursively( new RemoveOperationDelegate( file_system_context(), url, base::Bind(&FileSystemOperationImpl::DidFinishOperation, - AsWeakPtr(), callback))); + weak_factory_.GetWeakPtr(), callback))); recursive_operation_delegate_->RunRecursively(); return; } diff --git a/chromium/webkit/browser/fileapi/file_system_operation_impl.h b/chromium/webkit/browser/fileapi/file_system_operation_impl.h index 293ac5178d8..8433479f881 100644 --- a/chromium/webkit/browser/fileapi/file_system_operation_impl.h +++ b/chromium/webkit/browser/fileapi/file_system_operation_impl.h @@ -26,18 +26,8 @@ class RecursiveOperationDelegate; // The default implementation of FileSystemOperation for file systems. class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationImpl - : public NON_EXPORTED_BASE(FileSystemOperation), - public base::SupportsWeakPtr<FileSystemOperationImpl> { + : public NON_EXPORTED_BASE(FileSystemOperation) { public: - // NOTE: This constructor should not be called outside FileSystemBackends; - // instead please consider using - // file_system_context->CreateFileSystemOperation() to instantiate - // an appropriate FileSystemOperation. - FileSystemOperationImpl( - const FileSystemURL& url, - FileSystemContext* file_system_context, - scoped_ptr<FileSystemOperationContext> operation_context); - virtual ~FileSystemOperationImpl(); // FileSystemOperation overrides. @@ -50,6 +40,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationImpl const StatusCallback& callback) OVERRIDE; virtual void Copy(const FileSystemURL& src_url, const FileSystemURL& dest_url, + const CopyProgressCallback& progress_callback, const StatusCallback& callback) OVERRIDE; virtual void Move(const FileSystemURL& src_url, const FileSystemURL& dest_url, @@ -79,90 +70,39 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationImpl base::ProcessHandle peer_handle, const OpenFileCallback& callback) OVERRIDE; virtual void Cancel(const StatusCallback& cancel_callback) OVERRIDE; - virtual FileSystemOperationImpl* AsFileSystemOperationImpl() OVERRIDE; virtual void CreateSnapshotFile( const FileSystemURL& path, const SnapshotFileCallback& callback) OVERRIDE; - - // Copies in a single file from a different filesystem. - // - // This returns: - // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_file_path| - // or the parent directory of |dest_url| does not exist. - // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and - // is not a file. - // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and - // its parent path is a file. - // virtual void CopyInForeignFile(const base::FilePath& src_local_disk_path, const FileSystemURL& dest_url, - const StatusCallback& callback); - - // Removes a single file. - // - // This returns: - // - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist. - // - PLATFORM_FILE_ERROR_NOT_A_FILE if |url| is not a file. - // - void RemoveFile(const FileSystemURL& url, - const StatusCallback& callback); - - // Removes a single empty directory. - // - // This returns: - // - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist. - // - PLATFORM_FILE_ERROR_NOT_A_DIRECTORY if |url| is not a directory. - // - PLATFORM_FILE_ERROR_NOT_EMPTY if |url| is not empty. - // - void RemoveDirectory(const FileSystemURL& url, - const StatusCallback& callback); - - // Copies a file from |src_url| to |dest_url|. - // This must be called for files that belong to the same filesystem - // (i.e. type() and origin() of the |src_url| and |dest_url| must match). - // - // This returns: - // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_url| - // or the parent directory of |dest_url| does not exist. - // - PLATFORM_FILE_ERROR_NOT_A_FILE if |src_url| exists but is not a file. - // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and - // is not a file. - // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and - // its parent path is a file. - // - void CopyFileLocal(const FileSystemURL& src_url, - const FileSystemURL& dest_url, - const StatusCallback& callback); - - // Moves a local file from |src_url| to |dest_url|. - // This must be called for files that belong to the same filesystem - // (i.e. type() and origin() of the |src_url| and |dest_url| must match). - // - // This returns: - // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_url| - // or the parent directory of |dest_url| does not exist. - // - PLATFORM_FILE_ERROR_NOT_A_FILE if |src_url| exists but is not a file. - // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and - // is not a file. - // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and - // its parent path is a file. - // - void MoveFileLocal(const FileSystemURL& src_url, - const FileSystemURL& dest_url, - const StatusCallback& callback); - - // Synchronously gets the platform path for the given |url|. - // This may fail if |file_system_context| returns NULL on GetFileUtil(). - // In such a case, base::PLATFORM_FILE_ERROR_INVALID_OPERATION will be - // returned. - base::PlatformFileError SyncGetPlatformPath(const FileSystemURL& url, - base::FilePath* platform_path); + const StatusCallback& callback) OVERRIDE; + virtual void RemoveFile(const FileSystemURL& url, + const StatusCallback& callback) OVERRIDE; + virtual void RemoveDirectory(const FileSystemURL& url, + const StatusCallback& callback) OVERRIDE; + virtual void CopyFileLocal(const FileSystemURL& src_url, + const FileSystemURL& dest_url, + const CopyFileProgressCallback& progress_callback, + const StatusCallback& callback) OVERRIDE; + virtual void MoveFileLocal(const FileSystemURL& src_url, + const FileSystemURL& dest_url, + const StatusCallback& callback) OVERRIDE; + virtual base::PlatformFileError SyncGetPlatformPath( + const FileSystemURL& url, + base::FilePath* platform_path) OVERRIDE; FileSystemContext* file_system_context() const { return file_system_context_.get(); } - protected: + private: + friend class FileSystemOperation; + + FileSystemOperationImpl( + const FileSystemURL& url, + FileSystemContext* file_system_context, + scoped_ptr<FileSystemOperationContext> operation_context); + // Queries the quota and usage and then runs the given |task|. // If an error occurs during the quota query it runs |error_callback| instead. void GetUsageAndQuotaThenRunTask( @@ -191,6 +131,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationImpl bool recursive); void DoCopyFileLocal(const FileSystemURL& src, const FileSystemURL& dest, + const CopyFileProgressCallback& progress_callback, const StatusCallback& callback); void DoMoveFileLocal(const FileSystemURL& src, const FileSystemURL& dest, @@ -255,6 +196,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationImpl // A flag to make sure we call operation only once per instance. OperationType pending_operation_; + base::WeakPtrFactory<FileSystemOperationImpl> weak_factory_; + DISALLOW_COPY_AND_ASSIGN(FileSystemOperationImpl); }; diff --git a/chromium/webkit/browser/fileapi/file_system_operation_impl_unittest.cc b/chromium/webkit/browser/fileapi/file_system_operation_impl_unittest.cc index 083fdeb7dbd..7443aa066d1 100644 --- a/chromium/webkit/browser/fileapi/file_system_operation_impl_unittest.cc +++ b/chromium/webkit/browser/fileapi/file_system_operation_impl_unittest.cc @@ -10,7 +10,7 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" -#include "base/message_loop/message_loop.h" +#include "base/run_loop.h" #include "base/strings/stringprintf.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" @@ -226,7 +226,7 @@ class FileSystemOperationImplTest sandbox_file_system_.type(), usage, quota); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); ASSERT_EQ(quota::kQuotaStatusOk, status); } @@ -239,7 +239,7 @@ class FileSystemOperationImplTest operation_runner()->Remove(url, false /* recursive */, base::Bind(&AssertFileErrorEq, FROM_HERE, base::PLATFORM_FILE_OK)); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); change_observer()->ResetCount(); int64 total_usage; @@ -297,7 +297,7 @@ TEST_F(FileSystemOperationImplTest, TestMoveFailureSrcDoesntExist) { change_observer()->ResetCount(); operation_runner()->Move(URLForPath("a"), URLForPath("b"), RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -307,7 +307,7 @@ TEST_F(FileSystemOperationImplTest, TestMoveFailureContainsPath) { FileSystemURL dest_dir(CreateDirectory("src/dest")); operation_runner()->Move(src_dir, dest_dir, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -319,7 +319,7 @@ TEST_F(FileSystemOperationImplTest, TestMoveFailureSrcDirExistsDestFile) { FileSystemURL dest_file(CreateFile("dest/file")); operation_runner()->Move(src_dir, dest_file, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -332,7 +332,7 @@ TEST_F(FileSystemOperationImplTest, FileSystemURL dest_file(CreateFile("dest/file")); operation_runner()->Move(src_dir, dest_dir, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_EMPTY, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -344,7 +344,7 @@ TEST_F(FileSystemOperationImplTest, TestMoveFailureSrcFileExistsDestDir) { FileSystemURL dest_dir(CreateDirectory("dest")); operation_runner()->Move(src_file, dest_dir, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -354,7 +354,7 @@ TEST_F(FileSystemOperationImplTest, TestMoveFailureDestParentDoesntExist) { FileSystemURL src_dir(CreateDirectory("src")); operation_runner()->Move(src_dir, URLForPath("nonexistent/deset"), RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -364,7 +364,7 @@ TEST_F(FileSystemOperationImplTest, TestMoveSuccessSrcFileAndOverwrite) { FileSystemURL dest_file(CreateFile("dest")); operation_runner()->Move(src_file, dest_file, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(FileExists("dest")); @@ -379,7 +379,7 @@ TEST_F(FileSystemOperationImplTest, TestMoveSuccessSrcFileAndNew) { FileSystemURL src_file(CreateFile("src")); operation_runner()->Move(src_file, URLForPath("new"), RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(FileExists("new")); @@ -393,7 +393,7 @@ TEST_F(FileSystemOperationImplTest, TestMoveSuccessSrcDirAndOverwrite) { FileSystemURL dest_dir(CreateDirectory("dest")); operation_runner()->Move(src_dir, dest_dir, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_FALSE(DirectoryExists("src")); @@ -412,7 +412,7 @@ TEST_F(FileSystemOperationImplTest, TestMoveSuccessSrcDirAndNew) { operation_runner()->Move(src_dir, URLForPath("dest/new"), RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_FALSE(DirectoryExists("src")); EXPECT_TRUE(DirectoryExists("dest/new")); @@ -430,7 +430,7 @@ TEST_F(FileSystemOperationImplTest, TestMoveSuccessSrcDirRecursive) { FileSystemURL dest_dir(CreateDirectory("dest")); operation_runner()->Move(src_dir, dest_dir, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(DirectoryExists("dest/dir")); EXPECT_TRUE(FileExists("dest/dir/sub")); @@ -444,8 +444,9 @@ TEST_F(FileSystemOperationImplTest, TestMoveSuccessSrcDirRecursive) { TEST_F(FileSystemOperationImplTest, TestCopyFailureSrcDoesntExist) { operation_runner()->Copy(URLForPath("a"), URLForPath("b"), + FileSystemOperationRunner::CopyProgressCallback(), RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -454,8 +455,10 @@ TEST_F(FileSystemOperationImplTest, TestCopyFailureContainsPath) { FileSystemURL src_dir(CreateDirectory("src")); FileSystemURL dest_dir(CreateDirectory("src/dir")); - operation_runner()->Copy(src_dir, dest_dir, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + operation_runner()->Copy(src_dir, dest_dir, + FileSystemOperationRunner::CopyProgressCallback(), + RecordStatusCallback()); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -466,8 +469,10 @@ TEST_F(FileSystemOperationImplTest, TestCopyFailureSrcDirExistsDestFile) { FileSystemURL dest_dir(CreateDirectory("dest")); FileSystemURL dest_file(CreateFile("dest/file")); - operation_runner()->Copy(src_dir, dest_file, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + operation_runner()->Copy(src_dir, dest_file, + FileSystemOperationRunner::CopyProgressCallback(), + RecordStatusCallback()); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -479,8 +484,10 @@ TEST_F(FileSystemOperationImplTest, FileSystemURL dest_dir(CreateDirectory("dest")); FileSystemURL dest_file(CreateFile("dest/file")); - operation_runner()->Copy(src_dir, dest_dir, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + operation_runner()->Copy(src_dir, dest_dir, + FileSystemOperationRunner::CopyProgressCallback(), + RecordStatusCallback()); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_EMPTY, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -490,8 +497,10 @@ TEST_F(FileSystemOperationImplTest, TestCopyFailureSrcFileExistsDestDir) { FileSystemURL src_file(CreateFile("src")); FileSystemURL dest_dir(CreateDirectory("dest")); - operation_runner()->Copy(src_file, dest_dir, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + operation_runner()->Copy(src_file, dest_dir, + FileSystemOperationRunner::CopyProgressCallback(), + RecordStatusCallback()); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -501,8 +510,9 @@ TEST_F(FileSystemOperationImplTest, TestCopyFailureDestParentDoesntExist) { FileSystemURL src_dir(CreateDirectory("src")); operation_runner()->Copy(src_dir, URLForPath("nonexistent/dest"), + FileSystemOperationRunner::CopyProgressCallback(), RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -512,7 +522,7 @@ TEST_F(FileSystemOperationImplTest, TestCopyFailureByQuota) { FileSystemURL src_file(CreateFile("src/file")); FileSystemURL dest_dir(CreateDirectory("dest")); operation_runner()->Truncate(src_file, 6, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_EQ(6, GetFileSize("src/file")); @@ -521,8 +531,10 @@ TEST_F(FileSystemOperationImplTest, TestCopyFailureByQuota) { GrantQuotaForCurrentUsage(); AddQuota(6 + dest_path_cost - 1); - operation_runner()->Copy(src_file, dest_file, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + operation_runner()->Copy(src_file, dest_file, + FileSystemOperationRunner::CopyProgressCallback(), + RecordStatusCallback()); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status()); EXPECT_FALSE(FileExists("dest/file")); } @@ -531,8 +543,10 @@ TEST_F(FileSystemOperationImplTest, TestCopySuccessSrcFileAndOverwrite) { FileSystemURL src_file(CreateFile("src")); FileSystemURL dest_file(CreateFile("dest")); - operation_runner()->Copy(src_file, dest_file, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + operation_runner()->Copy(src_file, dest_file, + FileSystemOperationRunner::CopyProgressCallback(), + RecordStatusCallback()); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(FileExists("dest")); EXPECT_EQ(2, quota_manager_proxy()->notify_storage_accessed_count()); @@ -545,8 +559,9 @@ TEST_F(FileSystemOperationImplTest, TestCopySuccessSrcFileAndNew) { FileSystemURL src_file(CreateFile("src")); operation_runner()->Copy(src_file, URLForPath("new"), + FileSystemOperationRunner::CopyProgressCallback(), RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(FileExists("new")); EXPECT_EQ(2, quota_manager_proxy()->notify_storage_accessed_count()); @@ -559,8 +574,10 @@ TEST_F(FileSystemOperationImplTest, TestCopySuccessSrcDirAndOverwrite) { FileSystemURL src_dir(CreateDirectory("src")); FileSystemURL dest_dir(CreateDirectory("dest")); - operation_runner()->Copy(src_dir, dest_dir, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + operation_runner()->Copy(src_dir, dest_dir, + FileSystemOperationRunner::CopyProgressCallback(), + RecordStatusCallback()); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); // Make sure we've overwritten but not copied the source under the |dest_dir|. @@ -577,8 +594,10 @@ TEST_F(FileSystemOperationImplTest, TestCopySuccessSrcDirAndNew) { FileSystemURL src_dir(CreateDirectory("src")); FileSystemURL dest_dir_new(URLForPath("dest")); - operation_runner()->Copy(src_dir, dest_dir_new, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + operation_runner()->Copy(src_dir, dest_dir_new, + FileSystemOperationRunner::CopyProgressCallback(), + RecordStatusCallback()); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(DirectoryExists("dest")); EXPECT_GE(quota_manager_proxy()->notify_storage_accessed_count(), 2); @@ -594,8 +613,10 @@ TEST_F(FileSystemOperationImplTest, TestCopySuccessSrcDirRecursive) { FileSystemURL dest_dir(CreateDirectory("dest")); - operation_runner()->Copy(src_dir, dest_dir, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + operation_runner()->Copy(src_dir, dest_dir, + FileSystemOperationRunner::CopyProgressCallback(), + RecordStatusCallback()); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(DirectoryExists("dest/dir")); @@ -626,7 +647,7 @@ TEST_F(FileSystemOperationImplTest, TestCopyInForeignFileSuccess) { operation_runner()->CopyInForeignFile(src_local_disk_file_path, URLForPath("dest/file"), RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(1, change_observer()->create_file_count()); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); @@ -656,7 +677,7 @@ TEST_F(FileSystemOperationImplTest, TestCopyInForeignFileFailureByQuota) { operation_runner()->CopyInForeignFile(src_local_disk_file_path, URLForPath("dest/file"), RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_FALSE(FileExists("dest/file")); EXPECT_EQ(0, change_observer()->create_file_count()); @@ -667,7 +688,7 @@ TEST_F(FileSystemOperationImplTest, TestCreateFileFailure) { // Already existing file and exclusive true. FileSystemURL file(CreateFile("file")); operation_runner()->CreateFile(file, true, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_EXISTS, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -676,7 +697,7 @@ TEST_F(FileSystemOperationImplTest, TestCreateFileSuccessFileExists) { // Already existing file and exclusive false. FileSystemURL file(CreateFile("file")); operation_runner()->CreateFile(file, false, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(FileExists("file")); @@ -688,7 +709,7 @@ TEST_F(FileSystemOperationImplTest, TestCreateFileSuccessExclusive) { // File doesn't exist but exclusive is true. operation_runner()->CreateFile(URLForPath("new"), true, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(FileExists("new")); EXPECT_EQ(1, change_observer()->get_and_reset_create_file_count()); @@ -698,7 +719,7 @@ TEST_F(FileSystemOperationImplTest, TestCreateFileSuccessFileDoesntExist) { // Non existing file. operation_runner()->CreateFile(URLForPath("nonexistent"), false, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_EQ(1, change_observer()->get_and_reset_create_file_count()); } @@ -709,7 +730,7 @@ TEST_F(FileSystemOperationImplTest, operation_runner()->CreateDirectory( URLForPath("nonexistent/dir"), false, false, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -719,7 +740,7 @@ TEST_F(FileSystemOperationImplTest, TestCreateDirFailureDirExists) { FileSystemURL dir(CreateDirectory("dir")); operation_runner()->CreateDirectory(dir, true, false, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_EXISTS, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -729,7 +750,7 @@ TEST_F(FileSystemOperationImplTest, TestCreateDirFailureFileExists) { FileSystemURL file(CreateFile("file")); operation_runner()->CreateDirectory(file, true, false, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_EXISTS, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -739,14 +760,14 @@ TEST_F(FileSystemOperationImplTest, TestCreateDirSuccess) { FileSystemURL dir(CreateDirectory("dir")); operation_runner()->CreateDirectory(dir, false, false, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(change_observer()->HasNoChange()); // Dir doesn't exist. operation_runner()->CreateDirectory(URLForPath("new"), false, false, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(DirectoryExists("new")); EXPECT_EQ(1, change_observer()->get_and_reset_create_directory_count()); @@ -756,7 +777,7 @@ TEST_F(FileSystemOperationImplTest, TestCreateDirSuccessExclusive) { // Dir doesn't exist. operation_runner()->CreateDirectory(URLForPath("new"), true, false, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(DirectoryExists("new")); EXPECT_EQ(1, change_observer()->get_and_reset_create_directory_count()); @@ -766,17 +787,17 @@ TEST_F(FileSystemOperationImplTest, TestCreateDirSuccessExclusive) { TEST_F(FileSystemOperationImplTest, TestExistsAndMetadataFailure) { operation_runner()->GetMetadata(URLForPath("nonexistent"), RecordMetadataCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); operation_runner()->FileExists(URLForPath("nonexistent"), RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); operation_runner()->DirectoryExists(URLForPath("nonexistent"), RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -787,23 +808,23 @@ TEST_F(FileSystemOperationImplTest, TestExistsAndMetadataSuccess) { int read_access = 0; operation_runner()->DirectoryExists(dir, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); ++read_access; operation_runner()->GetMetadata(dir, RecordMetadataCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(info().is_directory); ++read_access; operation_runner()->FileExists(file, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); ++read_access; operation_runner()->GetMetadata(file, RecordMetadataCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_FALSE(info().is_directory); ++read_access; @@ -816,12 +837,12 @@ TEST_F(FileSystemOperationImplTest, TestExistsAndMetadataSuccess) { TEST_F(FileSystemOperationImplTest, TestTypeMismatchErrors) { FileSystemURL dir(CreateDirectory("dir")); operation_runner()->FileExists(dir, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_FILE, status()); FileSystemURL file(CreateFile("file")); operation_runner()->DirectoryExists(file, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY, status()); } @@ -829,13 +850,13 @@ TEST_F(FileSystemOperationImplTest, TestReadDirFailure) { // Path doesn't exist operation_runner()->ReadDirectory(URLForPath("nonexistent"), RecordReadDirectoryCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); // File exists. FileSystemURL file(CreateFile("file")); operation_runner()->ReadDirectory(file, RecordReadDirectoryCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -850,7 +871,7 @@ TEST_F(FileSystemOperationImplTest, TestReadDirSuccess) { FileSystemURL child_file(CreateFile("dir/child_file")); operation_runner()->ReadDirectory(parent_dir, RecordReadDirectoryCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_EQ(2u, entries().size()); @@ -868,7 +889,7 @@ TEST_F(FileSystemOperationImplTest, TestRemoveFailure) { // Path doesn't exist. operation_runner()->Remove(URLForPath("nonexistent"), false /* recursive */, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); // It's an error to try to remove a non-empty directory if recursive flag @@ -883,7 +904,7 @@ TEST_F(FileSystemOperationImplTest, TestRemoveFailure) { operation_runner()->Remove(parent_dir, false /* recursive */, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_EMPTY, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -893,7 +914,7 @@ TEST_F(FileSystemOperationImplTest, TestRemoveSuccess) { EXPECT_TRUE(DirectoryExists("empty_dir")); operation_runner()->Remove(empty_dir, false /* recursive */, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_FALSE(DirectoryExists("empty_dir")); @@ -919,7 +940,7 @@ TEST_F(FileSystemOperationImplTest, TestRemoveSuccessRecursive) { operation_runner()->Remove(parent_dir, true /* recursive */, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_FALSE(DirectoryExists("parent_dir")); @@ -939,7 +960,7 @@ TEST_F(FileSystemOperationImplTest, TestTruncate) { // Check that its length is the size of the data written. operation_runner()->GetMetadata(file, RecordMetadataCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_FALSE(info().is_directory); EXPECT_EQ(data_size, info().size); @@ -947,7 +968,7 @@ TEST_F(FileSystemOperationImplTest, TestTruncate) { // Extend the file by truncating it. int length = 17; operation_runner()->Truncate(file, length, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_EQ(1, change_observer()->get_and_reset_modify_file_count()); @@ -968,7 +989,7 @@ TEST_F(FileSystemOperationImplTest, TestTruncate) { // Shorten the file by truncating it. length = 3; operation_runner()->Truncate(file, length, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_EQ(1, change_observer()->get_and_reset_modify_file_count()); @@ -993,7 +1014,7 @@ TEST_F(FileSystemOperationImplTest, TestTruncateFailureByQuota) { AddQuota(10); operation_runner()->Truncate(file, 10, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_EQ(1, change_observer()->get_and_reset_modify_file_count()); EXPECT_TRUE(change_observer()->HasNoChange()); @@ -1001,7 +1022,7 @@ TEST_F(FileSystemOperationImplTest, TestTruncateFailureByQuota) { EXPECT_EQ(10, GetFileSize("dir/file")); operation_runner()->Truncate(file, 11, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status()); EXPECT_TRUE(change_observer()->HasNoChange()); @@ -1027,7 +1048,7 @@ TEST_F(FileSystemOperationImplTest, TestTouchFile) { operation_runner()->TouchFile(file, new_accessed_time, new_modified_time, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(change_observer()->HasNoChange()); @@ -1046,7 +1067,7 @@ TEST_F(FileSystemOperationImplTest, TestCreateSnapshotFile) { operation_runner()->DirectoryExists(dir, RecordStatusCallback()); FileSystemURL file(CreateFile("dir/file")); operation_runner()->FileExists(file, RecordStatusCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); // See if we can get a 'snapshot' file info for the file. @@ -1054,7 +1075,7 @@ TEST_F(FileSystemOperationImplTest, TestCreateSnapshotFile) { // directory it should just returns the same metadata and platform_path // as the file itself. operation_runner()->CreateSnapshotFile(file, RecordSnapshotFileCallback()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_FALSE(info().is_directory); EXPECT_EQ(PlatformPath("dir/file"), path()); @@ -1092,7 +1113,7 @@ TEST_F(FileSystemOperationImplTest, operation_runner()->Truncate( grandchild_file2, 2, base::Bind(&AssertFileErrorEq, FROM_HERE, base::PLATFORM_FILE_OK)); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 all_file_size = 5000 + 400 + 30 + 2; EXPECT_EQ(all_file_size, GetDataSizeOnDisk()); @@ -1101,7 +1122,7 @@ TEST_F(FileSystemOperationImplTest, operation_runner()->Move( src, dest, base::Bind(&AssertFileErrorEq, FROM_HERE, base::PLATFORM_FILE_OK)); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_FALSE(DirectoryExists("src/dir")); EXPECT_FALSE(FileExists("src/dir/file2")); @@ -1145,7 +1166,7 @@ TEST_F(FileSystemOperationImplTest, operation_runner()->Truncate( grandchild_file2, 5, base::Bind(&AssertFileErrorEq, FROM_HERE, base::PLATFORM_FILE_OK)); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 child_file_size = 8000 + 700; const int64 grandchild_file_size = 60 + 5; @@ -1159,8 +1180,9 @@ TEST_F(FileSystemOperationImplTest, // Copy src to dest1. operation_runner()->Copy( src, dest1, + FileSystemOperationRunner::CopyProgressCallback(), base::Bind(&AssertFileErrorEq, FROM_HERE, base::PLATFORM_FILE_OK)); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); expected_usage += all_file_size + child_path_cost + grandchild_path_cost; EXPECT_TRUE(DirectoryExists("src/dir")); @@ -1174,8 +1196,9 @@ TEST_F(FileSystemOperationImplTest, // Copy src/dir to dest2. operation_runner()->Copy( child_dir, dest2, + FileSystemOperationRunner::CopyProgressCallback(), base::Bind(&AssertFileErrorEq, FROM_HERE, base::PLATFORM_FILE_OK)); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); expected_usage += grandchild_file_size + grandchild_path_cost; usage = GetUsage(); diff --git a/chromium/webkit/browser/fileapi/file_system_operation_impl_write_unittest.cc b/chromium/webkit/browser/fileapi/file_system_operation_impl_write_unittest.cc index d8ecc280fc8..7fb9aa4ae86 100644 --- a/chromium/webkit/browser/fileapi/file_system_operation_impl_write_unittest.cc +++ b/chromium/webkit/browser/fileapi/file_system_operation_impl_write_unittest.cc @@ -7,15 +7,15 @@ #include "base/files/scoped_temp_dir.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" -#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_proxy.h" +#include "base/run_loop.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_job.h" #include "net/url_request/url_request_job_factory_impl.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" -#include "webkit/browser/blob/blob_storage_controller.h" +#include "webkit/browser/blob/blob_storage_context.h" #include "webkit/browser/blob/blob_url_request_job.h" #include "webkit/browser/blob/mock_blob_url_request_context.h" #include "webkit/browser/fileapi/file_system_context.h" @@ -88,7 +88,7 @@ class FileSystemOperationImplWriteTest virtual void TearDown() { quota_manager_ = NULL; file_system_context_ = NULL; - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } base::PlatformFileError status() const { return status_; } @@ -174,11 +174,12 @@ class FileSystemOperationImplWriteTest }; TEST_F(FileSystemOperationImplWriteTest, TestWriteSuccess) { - const GURL blob_url("blob:success"); - ScopedTextBlob blob(url_request_context(), blob_url, "Hello, world!\n"); - + ScopedTextBlob blob(url_request_context(), + "blob-id:success", + "Hello, world!\n"); file_system_context_->operation_runner()->Write( - &url_request_context(), URLForPath(virtual_path_), blob_url, + &url_request_context(), URLForPath(virtual_path_), + blob.GetBlobDataHandle(), 0, RecordWriteCallback()); base::MessageLoop::current()->Run(); @@ -190,19 +191,12 @@ TEST_F(FileSystemOperationImplWriteTest, TestWriteSuccess) { } TEST_F(FileSystemOperationImplWriteTest, TestWriteZero) { - GURL blob_url("blob:zero"); - scoped_refptr<webkit_blob::BlobData> blob_data(new webkit_blob::BlobData()); - - url_request_context().blob_storage_controller() - ->AddFinishedBlob(blob_url, blob_data.get()); - + ScopedTextBlob blob(url_request_context(), "blob_id:zero", ""); file_system_context_->operation_runner()->Write( &url_request_context(), URLForPath(virtual_path_), - blob_url, 0, RecordWriteCallback()); + blob.GetBlobDataHandle(), 0, RecordWriteCallback()); base::MessageLoop::current()->Run(); - url_request_context().blob_storage_controller()->RemoveBlob(blob_url); - EXPECT_EQ(0, bytes_written()); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(complete()); @@ -210,10 +204,12 @@ TEST_F(FileSystemOperationImplWriteTest, TestWriteZero) { EXPECT_EQ(1, change_observer()->get_and_reset_modify_file_count()); } + TEST_F(FileSystemOperationImplWriteTest, TestWriteInvalidBlobUrl) { + scoped_ptr<webkit_blob::BlobDataHandle> null_handle; file_system_context_->operation_runner()->Write( &url_request_context(), URLForPath(virtual_path_), - GURL("blob:invalid"), 0, RecordWriteCallback()); + null_handle.Pass(), 0, RecordWriteCallback()); base::MessageLoop::current()->Run(); EXPECT_EQ(0, bytes_written()); @@ -224,14 +220,12 @@ TEST_F(FileSystemOperationImplWriteTest, TestWriteInvalidBlobUrl) { } TEST_F(FileSystemOperationImplWriteTest, TestWriteInvalidFile) { - GURL blob_url("blob:writeinvalidfile"); - ScopedTextBlob blob(url_request_context(), blob_url, + ScopedTextBlob blob(url_request_context(), "blob_id:writeinvalidfile", "It\'ll not be written."); - file_system_context_->operation_runner()->Write( &url_request_context(), URLForPath(base::FilePath(FILE_PATH_LITERAL("nonexist"))), - blob_url, 0, RecordWriteCallback()); + blob.GetBlobDataHandle(), 0, RecordWriteCallback()); base::MessageLoop::current()->Run(); EXPECT_EQ(0, bytes_written()); @@ -248,13 +242,11 @@ TEST_F(FileSystemOperationImplWriteTest, TestWriteDir) { true /* exclusive */, false /* recursive */, base::Bind(&AssertStatusEq, base::PLATFORM_FILE_OK)); - GURL blob_url("blob:writedir"); - ScopedTextBlob blob(url_request_context(), blob_url, + ScopedTextBlob blob(url_request_context(), "blob:writedir", "It\'ll not be written, too."); - file_system_context_->operation_runner()->Write( &url_request_context(), URLForPath(virtual_dir_path), - blob_url, 0, RecordWriteCallback()); + blob.GetBlobDataHandle(), 0, RecordWriteCallback()); base::MessageLoop::current()->Run(); EXPECT_EQ(0, bytes_written()); @@ -269,14 +261,13 @@ TEST_F(FileSystemOperationImplWriteTest, TestWriteDir) { } TEST_F(FileSystemOperationImplWriteTest, TestWriteFailureByQuota) { - GURL blob_url("blob:success"); - ScopedTextBlob blob(url_request_context(), blob_url, "Hello, world!\n"); - + ScopedTextBlob blob(url_request_context(), "blob:success", + "Hello, world!\n"); quota_manager_->SetQuota( kOrigin, FileSystemTypeToQuotaStorageType(kFileSystemType), 10); file_system_context_->operation_runner()->Write( - &url_request_context(), URLForPath(virtual_path_), blob_url, - 0, RecordWriteCallback()); + &url_request_context(), URLForPath(virtual_path_), + blob.GetBlobDataHandle(), 0, RecordWriteCallback()); base::MessageLoop::current()->Run(); EXPECT_EQ(10, bytes_written()); @@ -287,18 +278,17 @@ TEST_F(FileSystemOperationImplWriteTest, TestWriteFailureByQuota) { } TEST_F(FileSystemOperationImplWriteTest, TestImmediateCancelSuccessfulWrite) { - GURL blob_url("blob:success"); - ScopedTextBlob blob(url_request_context(), blob_url, "Hello, world!\n"); - + ScopedTextBlob blob(url_request_context(), "blob:success", + "Hello, world!\n"); FileSystemOperationRunner::OperationID id = file_system_context_->operation_runner()->Write( &url_request_context(), URLForPath(virtual_path_), - blob_url, 0, RecordWriteCallback()); + blob.GetBlobDataHandle(), 0, RecordWriteCallback()); file_system_context_->operation_runner()->Cancel(id, RecordCancelCallback()); // We use RunAllPendings() instead of Run() here, because we won't dispatch // callbacks after Cancel() is issued (so no chance to Quit) nor do we need // to run another write cycle. - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); // Issued Cancel() before receiving any response from Write(), // so nothing should have happen. @@ -311,20 +301,18 @@ TEST_F(FileSystemOperationImplWriteTest, TestImmediateCancelSuccessfulWrite) { } TEST_F(FileSystemOperationImplWriteTest, TestImmediateCancelFailingWrite) { - GURL blob_url("blob:writeinvalidfile"); - ScopedTextBlob blob(url_request_context(), blob_url, + ScopedTextBlob blob(url_request_context(), "blob:writeinvalidfile", "It\'ll not be written."); - FileSystemOperationRunner::OperationID id = file_system_context_->operation_runner()->Write( &url_request_context(), URLForPath(base::FilePath(FILE_PATH_LITERAL("nonexist"))), - blob_url, 0, RecordWriteCallback()); + blob.GetBlobDataHandle(), 0, RecordWriteCallback()); file_system_context_->operation_runner()->Cancel(id, RecordCancelCallback()); // We use RunAllPendings() instead of Run() here, because we won't dispatch // callbacks after Cancel() is issued (so no chance to Quit) nor do we need // to run another write cycle. - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); // Issued Cancel() before receiving any response from Write(), // so nothing should have happen. diff --git a/chromium/webkit/browser/fileapi/file_system_operation_runner.cc b/chromium/webkit/browser/fileapi/file_system_operation_runner.cc index 351536b6226..5a31ecc44ec 100644 --- a/chromium/webkit/browser/fileapi/file_system_operation_runner.cc +++ b/chromium/webkit/browser/fileapi/file_system_operation_runner.cc @@ -5,11 +5,14 @@ #include "webkit/browser/fileapi/file_system_operation_runner.h" #include "base/bind.h" +#include "base/message_loop/message_loop_proxy.h" +#include "base/stl_util.h" #include "net/url_request/url_request_context.h" +#include "webkit/browser/blob/blob_url_request_job_factory.h" #include "webkit/browser/fileapi/file_observers.h" #include "webkit/browser/fileapi/file_stream_writer.h" #include "webkit/browser/fileapi/file_system_context.h" -#include "webkit/browser/fileapi/file_system_operation_impl.h" +#include "webkit/browser/fileapi/file_system_operation.h" #include "webkit/browser/fileapi/file_writer_delegate.h" #include "webkit/common/blob/shareable_file_reference.h" @@ -17,7 +20,17 @@ namespace fileapi { typedef FileSystemOperationRunner::OperationID OperationID; -const OperationID FileSystemOperationRunner::kErrorOperationID = -1; +class FileSystemOperationRunner::BeginOperationScoper + : public base::SupportsWeakPtr< + FileSystemOperationRunner::BeginOperationScoper> { + public: + BeginOperationScoper() {} + private: + DISALLOW_COPY_AND_ASSIGN(BeginOperationScoper); +}; + +FileSystemOperationRunner::OperationHandle::OperationHandle() {} +FileSystemOperationRunner::OperationHandle::~OperationHandle() {} FileSystemOperationRunner::~FileSystemOperationRunner() { } @@ -33,17 +46,19 @@ OperationID FileSystemOperationRunner::CreateFile( base::PlatformFileError error = base::PLATFORM_FILE_OK; FileSystemOperation* operation = file_system_context_->CreateFileSystemOperation(url, &error); + + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error); - return kErrorOperationID; + DidFinish(handle, callback, error); + return handle.id; } - OperationID id = operations_.Add(operation); - PrepareForWrite(id, url); + PrepareForWrite(handle.id, url); operation->CreateFile( url, exclusive, base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } OperationID FileSystemOperationRunner::CreateDirectory( @@ -54,38 +69,45 @@ OperationID FileSystemOperationRunner::CreateDirectory( base::PlatformFileError error = base::PLATFORM_FILE_OK; FileSystemOperation* operation = file_system_context_->CreateFileSystemOperation(url, &error); + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error); - return kErrorOperationID; + DidFinish(handle, callback, error); + return handle.id; } - OperationID id = operations_.Add(operation); - PrepareForWrite(id, url); + PrepareForWrite(handle.id, url); operation->CreateDirectory( url, exclusive, recursive, base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } OperationID FileSystemOperationRunner::Copy( const FileSystemURL& src_url, const FileSystemURL& dest_url, + const CopyProgressCallback& progress_callback, const StatusCallback& callback) { base::PlatformFileError error = base::PLATFORM_FILE_OK; FileSystemOperation* operation = file_system_context_->CreateFileSystemOperation(dest_url, &error); + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error); - return kErrorOperationID; + DidFinish(handle, callback, error); + return handle.id; } - OperationID id = operations_.Add(operation); - PrepareForWrite(id, dest_url); - PrepareForRead(id, src_url); + PrepareForWrite(handle.id, dest_url); + PrepareForRead(handle.id, src_url); operation->Copy( src_url, dest_url, + progress_callback.is_null() ? + CopyProgressCallback() : + base::Bind(&FileSystemOperationRunner::OnCopyProgress, AsWeakPtr(), + handle, progress_callback), base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } OperationID FileSystemOperationRunner::Move( @@ -95,18 +117,19 @@ OperationID FileSystemOperationRunner::Move( base::PlatformFileError error = base::PLATFORM_FILE_OK; FileSystemOperation* operation = file_system_context_->CreateFileSystemOperation(dest_url, &error); + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error); - return kErrorOperationID; + DidFinish(handle, callback, error); + return handle.id; } - OperationID id = operations_.Add(operation); - PrepareForWrite(id, dest_url); - PrepareForWrite(id, src_url); + PrepareForWrite(handle.id, dest_url); + PrepareForWrite(handle.id, src_url); operation->Move( src_url, dest_url, base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } OperationID FileSystemOperationRunner::DirectoryExists( @@ -115,17 +138,18 @@ OperationID FileSystemOperationRunner::DirectoryExists( base::PlatformFileError error = base::PLATFORM_FILE_OK; FileSystemOperation* operation = file_system_context_->CreateFileSystemOperation(url, &error); + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error); - return kErrorOperationID; + DidFinish(handle, callback, error); + return handle.id; } - OperationID id = operations_.Add(operation); - PrepareForRead(id, url); + PrepareForRead(handle.id, url); operation->DirectoryExists( url, base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } OperationID FileSystemOperationRunner::FileExists( @@ -134,17 +158,18 @@ OperationID FileSystemOperationRunner::FileExists( base::PlatformFileError error = base::PLATFORM_FILE_OK; FileSystemOperation* operation = file_system_context_->CreateFileSystemOperation(url, &error); + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error); - return kErrorOperationID; + DidFinish(handle, callback, error); + return handle.id; } - OperationID id = operations_.Add(operation); - PrepareForRead(id, url); + PrepareForRead(handle.id, url); operation->FileExists( url, base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } OperationID FileSystemOperationRunner::GetMetadata( @@ -153,17 +178,18 @@ OperationID FileSystemOperationRunner::GetMetadata( base::PlatformFileError error = base::PLATFORM_FILE_OK; FileSystemOperation* operation = file_system_context_->CreateFileSystemOperation(url, &error); + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error, base::PlatformFileInfo()); - return kErrorOperationID; + DidGetMetadata(handle, callback, error, base::PlatformFileInfo()); + return handle.id; } - OperationID id = operations_.Add(operation); - PrepareForRead(id, url); + PrepareForRead(handle.id, url); operation->GetMetadata( url, base::Bind(&FileSystemOperationRunner::DidGetMetadata, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } OperationID FileSystemOperationRunner::ReadDirectory( @@ -172,17 +198,19 @@ OperationID FileSystemOperationRunner::ReadDirectory( base::PlatformFileError error = base::PLATFORM_FILE_OK; FileSystemOperation* operation = file_system_context_->CreateFileSystemOperation(url, &error); + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error, std::vector<DirectoryEntry>(), false); - return kErrorOperationID; + DidReadDirectory(handle, callback, error, std::vector<DirectoryEntry>(), + false); + return handle.id; } - OperationID id = operations_.Add(operation); - PrepareForRead(id, url); + PrepareForRead(handle.id, url); operation->ReadDirectory( url, base::Bind(&FileSystemOperationRunner::DidReadDirectory, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } OperationID FileSystemOperationRunner::Remove( @@ -191,54 +219,60 @@ OperationID FileSystemOperationRunner::Remove( base::PlatformFileError error = base::PLATFORM_FILE_OK; FileSystemOperation* operation = file_system_context_->CreateFileSystemOperation(url, &error); + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error); - return kErrorOperationID; + DidFinish(handle, callback, error); + return handle.id; } - OperationID id = operations_.Add(operation); - PrepareForWrite(id, url); + PrepareForWrite(handle.id, url); operation->Remove( url, recursive, base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } OperationID FileSystemOperationRunner::Write( const net::URLRequestContext* url_request_context, const FileSystemURL& url, - const GURL& blob_url, + scoped_ptr<webkit_blob::BlobDataHandle> blob, int64 offset, const WriteCallback& callback) { base::PlatformFileError error = base::PLATFORM_FILE_OK; FileSystemOperation* operation = file_system_context_->CreateFileSystemOperation(url, &error); + + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error, 0, true); - return kErrorOperationID; + DidWrite(handle, callback, error, 0, true); + return handle.id; } scoped_ptr<FileStreamWriter> writer( file_system_context_->CreateFileStreamWriter(url, offset)); if (!writer) { // Write is not supported. - callback.Run(base::PLATFORM_FILE_ERROR_SECURITY, 0, true); - return kErrorOperationID; + DidWrite(handle, callback, base::PLATFORM_FILE_ERROR_SECURITY, 0, true); + return handle.id; } - DCHECK(blob_url.is_valid()); scoped_ptr<FileWriterDelegate> writer_delegate( new FileWriterDelegate(writer.Pass())); - scoped_ptr<net::URLRequest> blob_request(url_request_context->CreateRequest( - blob_url, writer_delegate.get())); - OperationID id = operations_.Add(operation); - PrepareForWrite(id, url); + scoped_ptr<net::URLRequest> blob_request( + webkit_blob::BlobProtocolHandler::CreateBlobRequest( + blob.Pass(), + url_request_context, + writer_delegate.get())); + + PrepareForWrite(handle.id, url); operation->Write( url, writer_delegate.Pass(), blob_request.Pass(), base::Bind(&FileSystemOperationRunner::DidWrite, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } OperationID FileSystemOperationRunner::Truncate( @@ -247,25 +281,31 @@ OperationID FileSystemOperationRunner::Truncate( base::PlatformFileError error = base::PLATFORM_FILE_OK; FileSystemOperation* operation = file_system_context_->CreateFileSystemOperation(url, &error); + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error); - return kErrorOperationID; + DidFinish(handle, callback, error); + return handle.id; } - OperationID id = operations_.Add(operation); - PrepareForWrite(id, url); + PrepareForWrite(handle.id, url); operation->Truncate( url, length, base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } void FileSystemOperationRunner::Cancel( OperationID id, const StatusCallback& callback) { + if (ContainsKey(finished_operations_, id)) { + DCHECK(!ContainsKey(stray_cancel_callbacks_, id)); + stray_cancel_callbacks_[id] = callback; + return; + } FileSystemOperation* operation = operations_.Lookup(id); if (!operation) { - // The operation is already finished; report that we failed to stop it. + // There is no operation with |id|. callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); return; } @@ -280,17 +320,18 @@ OperationID FileSystemOperationRunner::TouchFile( base::PlatformFileError error = base::PLATFORM_FILE_OK; FileSystemOperation* operation = file_system_context_->CreateFileSystemOperation(url, &error); + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error); - return kErrorOperationID; + DidFinish(handle, callback, error); + return handle.id; } - OperationID id = operations_.Add(operation); - PrepareForWrite(id, url); + PrepareForWrite(handle.id, url); operation->TouchFile( url, last_access_time, last_modified_time, base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } OperationID FileSystemOperationRunner::OpenFile( @@ -301,27 +342,28 @@ OperationID FileSystemOperationRunner::OpenFile( base::PlatformFileError error = base::PLATFORM_FILE_OK; FileSystemOperation* operation = file_system_context_->CreateFileSystemOperation(url, &error); + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error, base::kInvalidPlatformFileValue, - base::Closure(), base::ProcessHandle()); - return kErrorOperationID; + DidOpenFile(handle, callback, error, base::kInvalidPlatformFileValue, + base::Closure(), base::ProcessHandle()); + return handle.id; } - OperationID id = operations_.Add(operation); if (file_flags & (base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_OPEN_ALWAYS | base::PLATFORM_FILE_CREATE_ALWAYS | base::PLATFORM_FILE_OPEN_TRUNCATED | base::PLATFORM_FILE_WRITE | base::PLATFORM_FILE_EXCLUSIVE_WRITE | base::PLATFORM_FILE_DELETE_ON_CLOSE | base::PLATFORM_FILE_WRITE_ATTRIBUTES)) { - PrepareForWrite(id, url); + PrepareForWrite(handle.id, url); } else { - PrepareForRead(id, url); + PrepareForRead(handle.id, url); } operation->OpenFile( url, file_flags, peer_handle, base::Bind(&FileSystemOperationRunner::DidOpenFile, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } OperationID FileSystemOperationRunner::CreateSnapshotFile( @@ -330,17 +372,19 @@ OperationID FileSystemOperationRunner::CreateSnapshotFile( base::PlatformFileError error = base::PLATFORM_FILE_OK; FileSystemOperation* operation = file_system_context_->CreateFileSystemOperation(url, &error); + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error, base::PlatformFileInfo(), base::FilePath(), NULL); - return kErrorOperationID; + DidCreateSnapshot(handle, callback, error, base::PlatformFileInfo(), + base::FilePath(), NULL); + return handle.id; } - OperationID id = operations_.Add(operation); - PrepareForRead(id, url); + PrepareForRead(handle.id, url); operation->CreateSnapshotFile( url, base::Bind(&FileSystemOperationRunner::DidCreateSnapshot, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } OperationID FileSystemOperationRunner::CopyInForeignFile( @@ -348,71 +392,78 @@ OperationID FileSystemOperationRunner::CopyInForeignFile( const FileSystemURL& dest_url, const StatusCallback& callback) { base::PlatformFileError error = base::PLATFORM_FILE_OK; - FileSystemOperation* operation = CreateFileSystemOperationImpl( - dest_url, &error); + FileSystemOperation* operation = + file_system_context_->CreateFileSystemOperation(dest_url, &error); + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error); - return kErrorOperationID; + DidFinish(handle, callback, error); + return handle.id; } - OperationID id = operations_.Add(operation); - operation->AsFileSystemOperationImpl()->CopyInForeignFile( + operation->CopyInForeignFile( src_local_disk_path, dest_url, base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } OperationID FileSystemOperationRunner::RemoveFile( const FileSystemURL& url, const StatusCallback& callback) { base::PlatformFileError error = base::PLATFORM_FILE_OK; - FileSystemOperation* operation = CreateFileSystemOperationImpl(url, &error); + FileSystemOperation* operation = + file_system_context_->CreateFileSystemOperation(url, &error); + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error); - return kErrorOperationID; + DidFinish(handle, callback, error); + return handle.id; } - OperationID id = operations_.Add(operation); - operation->AsFileSystemOperationImpl()->RemoveFile( + operation->RemoveFile( url, base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } OperationID FileSystemOperationRunner::RemoveDirectory( const FileSystemURL& url, const StatusCallback& callback) { base::PlatformFileError error = base::PLATFORM_FILE_OK; - FileSystemOperation* operation = CreateFileSystemOperationImpl(url, &error); + FileSystemOperation* operation = + file_system_context_->CreateFileSystemOperation(url, &error); + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error); - return kErrorOperationID; + DidFinish(handle, callback, error); + return handle.id; } - OperationID id = operations_.Add(operation); - operation->AsFileSystemOperationImpl()->RemoveDirectory( + operation->RemoveDirectory( url, base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } OperationID FileSystemOperationRunner::CopyFileLocal( const FileSystemURL& src_url, const FileSystemURL& dest_url, + const CopyFileProgressCallback& progress_callback, const StatusCallback& callback) { base::PlatformFileError error = base::PLATFORM_FILE_OK; - FileSystemOperation* operation = CreateFileSystemOperationImpl( - src_url, &error); + FileSystemOperation* operation = + file_system_context_->CreateFileSystemOperation(src_url, &error); + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error); - return kErrorOperationID; + DidFinish(handle, callback, error); + return handle.id; } - OperationID id = operations_.Add(operation); - operation->AsFileSystemOperationImpl()->CopyFileLocal( - src_url, dest_url, + operation->CopyFileLocal( + src_url, dest_url, progress_callback, base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } OperationID FileSystemOperationRunner::MoveFileLocal( @@ -420,30 +471,30 @@ OperationID FileSystemOperationRunner::MoveFileLocal( const FileSystemURL& dest_url, const StatusCallback& callback) { base::PlatformFileError error = base::PLATFORM_FILE_OK; - FileSystemOperation* operation = CreateFileSystemOperationImpl( - src_url, &error); + FileSystemOperation* operation = + file_system_context_->CreateFileSystemOperation(src_url, &error); + BeginOperationScoper scope; + OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); if (!operation) { - callback.Run(error); - return kErrorOperationID; + DidFinish(handle, callback, error); + return handle.id; } - OperationID id = operations_.Add(operation); - operation->AsFileSystemOperationImpl()->MoveFileLocal( + operation->MoveFileLocal( src_url, dest_url, base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(), - id, callback)); - return id; + handle, callback)); + return handle.id; } base::PlatformFileError FileSystemOperationRunner::SyncGetPlatformPath( const FileSystemURL& url, base::FilePath* platform_path) { base::PlatformFileError error = base::PLATFORM_FILE_OK; - FileSystemOperation* operation = CreateFileSystemOperationImpl(url, &error); + FileSystemOperation* operation = + file_system_context_->CreateFileSystemOperation(url, &error); if (!operation) return error; - - return operation->AsFileSystemOperationImpl()->SyncGetPlatformPath( - url, platform_path); + return operation->SyncGetPlatformPath(url, platform_path); } FileSystemOperationRunner::FileSystemOperationRunner( @@ -451,79 +502,126 @@ FileSystemOperationRunner::FileSystemOperationRunner( : file_system_context_(file_system_context) {} void FileSystemOperationRunner::DidFinish( - OperationID id, + const OperationHandle& handle, const StatusCallback& callback, base::PlatformFileError rv) { + if (handle.scope) { + finished_operations_.insert(handle.id); + base::MessageLoopProxy::current()->PostTask( + FROM_HERE, base::Bind(&FileSystemOperationRunner::DidFinish, + AsWeakPtr(), handle, callback, rv)); + return; + } callback.Run(rv); - FinishOperation(id); + FinishOperation(handle.id); } void FileSystemOperationRunner::DidGetMetadata( - OperationID id, + const OperationHandle& handle, const GetMetadataCallback& callback, base::PlatformFileError rv, const base::PlatformFileInfo& file_info) { + if (handle.scope) { + finished_operations_.insert(handle.id); + base::MessageLoopProxy::current()->PostTask( + FROM_HERE, base::Bind(&FileSystemOperationRunner::DidGetMetadata, + AsWeakPtr(), handle, callback, rv, file_info)); + return; + } callback.Run(rv, file_info); - FinishOperation(id); + FinishOperation(handle.id); } void FileSystemOperationRunner::DidReadDirectory( - OperationID id, + const OperationHandle& handle, const ReadDirectoryCallback& callback, base::PlatformFileError rv, const std::vector<DirectoryEntry>& entries, bool has_more) { + if (handle.scope) { + finished_operations_.insert(handle.id); + base::MessageLoopProxy::current()->PostTask( + FROM_HERE, base::Bind(&FileSystemOperationRunner::DidReadDirectory, + AsWeakPtr(), handle, callback, rv, + entries, has_more)); + return; + } callback.Run(rv, entries, has_more); if (rv != base::PLATFORM_FILE_OK || !has_more) - FinishOperation(id); + FinishOperation(handle.id); } void FileSystemOperationRunner::DidWrite( - OperationID id, + const OperationHandle& handle, const WriteCallback& callback, base::PlatformFileError rv, int64 bytes, bool complete) { + if (handle.scope) { + finished_operations_.insert(handle.id); + base::MessageLoopProxy::current()->PostTask( + FROM_HERE, base::Bind(&FileSystemOperationRunner::DidWrite, AsWeakPtr(), + handle, callback, rv, bytes, complete)); + return; + } callback.Run(rv, bytes, complete); if (rv != base::PLATFORM_FILE_OK || complete) - FinishOperation(id); + FinishOperation(handle.id); } void FileSystemOperationRunner::DidOpenFile( - OperationID id, + const OperationHandle& handle, const OpenFileCallback& callback, base::PlatformFileError rv, base::PlatformFile file, const base::Closure& on_close_callback, base::ProcessHandle peer_handle) { + if (handle.scope) { + finished_operations_.insert(handle.id); + base::MessageLoopProxy::current()->PostTask( + FROM_HERE, base::Bind(&FileSystemOperationRunner::DidOpenFile, + AsWeakPtr(), handle, callback, rv, file, + on_close_callback, peer_handle)); + return; + } callback.Run(rv, file, on_close_callback, peer_handle); - FinishOperation(id); + FinishOperation(handle.id); } void FileSystemOperationRunner::DidCreateSnapshot( - OperationID id, + const OperationHandle& handle, const SnapshotFileCallback& callback, base::PlatformFileError rv, const base::PlatformFileInfo& file_info, const base::FilePath& platform_path, const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { + if (handle.scope) { + finished_operations_.insert(handle.id); + base::MessageLoopProxy::current()->PostTask( + FROM_HERE, base::Bind(&FileSystemOperationRunner::DidCreateSnapshot, + AsWeakPtr(), handle, callback, rv, file_info, + platform_path, file_ref)); + return; + } callback.Run(rv, file_info, platform_path, file_ref); - FinishOperation(id); + FinishOperation(handle.id); } -FileSystemOperation* -FileSystemOperationRunner::CreateFileSystemOperationImpl( - const FileSystemURL& url, base::PlatformFileError* error) { - FileSystemOperation* operation = - file_system_context_->CreateFileSystemOperation(url, error); - if (!operation) - return NULL; - if (!operation->AsFileSystemOperationImpl()) { - *error = base::PLATFORM_FILE_ERROR_INVALID_OPERATION; - delete operation; - return NULL; +void FileSystemOperationRunner::OnCopyProgress( + const OperationHandle& handle, + const CopyProgressCallback& callback, + FileSystemOperation::CopyProgressType type, + const FileSystemURL& source_url, + const FileSystemURL& dest_url, + int64 size) { + if (handle.scope) { + base::MessageLoopProxy::current()->PostTask( + FROM_HERE, base::Bind( + &FileSystemOperationRunner::OnCopyProgress, + AsWeakPtr(), handle, callback, type, source_url, dest_url, size)); + return; } - return operation; + callback.Run(type, source_url, dest_url, size); } void FileSystemOperationRunner::PrepareForWrite(OperationID id, @@ -543,6 +641,16 @@ void FileSystemOperationRunner::PrepareForRead(OperationID id, } } +FileSystemOperationRunner::OperationHandle +FileSystemOperationRunner::BeginOperation( + FileSystemOperation* operation, + base::WeakPtr<BeginOperationScoper> scope) { + OperationHandle handle; + handle.id = operations_.Add(operation); + handle.scope = scope; + return handle; +} + void FileSystemOperationRunner::FinishOperation(OperationID id) { OperationToURLSet::iterator found = write_target_urls_.find(id); if (found != write_target_urls_.end()) { @@ -556,8 +664,22 @@ void FileSystemOperationRunner::FinishOperation(OperationID id) { } write_target_urls_.erase(found); } - DCHECK(operations_.Lookup(id)); + + // IDMap::Lookup fails if the operation is NULL, so we don't check + // operations_.Lookup(id) here. + operations_.Remove(id); + finished_operations_.erase(id); + + // Dispatch stray cancel callback if exists. + std::map<OperationID, StatusCallback>::iterator found_cancel = + stray_cancel_callbacks_.find(id); + if (found_cancel != stray_cancel_callbacks_.end()) { + // This cancel has been requested after the operation has finished, + // so report that we failed to stop it. + found_cancel->second.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); + stray_cancel_callbacks_.erase(found_cancel); + } } } // namespace fileapi diff --git a/chromium/webkit/browser/fileapi/file_system_operation_runner.h b/chromium/webkit/browser/fileapi/file_system_operation_runner.h index 67f30b89b17..ea93f38e1fc 100644 --- a/chromium/webkit/browser/fileapi/file_system_operation_runner.h +++ b/chromium/webkit/browser/fileapi/file_system_operation_runner.h @@ -11,6 +11,7 @@ #include "base/id_map.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" +#include "webkit/browser/blob/blob_data_handle.h" #include "webkit/browser/fileapi/file_system_operation.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/webkit_storage_browser_export.h" @@ -31,12 +32,6 @@ class FileSystemContext; // operation fails, in addition to dispatching the callback with an error // code (therefore in most cases the caller does not need to check the // returned operation ID). -// -// Some operations (e.g. CopyInForeignFile, RemoveFile, RemoveDirectory, -// CopyFileLocal, MoveFileLocal and SyncGetPlatformPath) are only supported -// by filesystems which implement FileSystemOperationImpl. -// If they are called on other filesystems -// base::PLATFORM_FILE_ERROR_INVALID_OPERATION is returned via callback. class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationRunner : public base::SupportsWeakPtr<FileSystemOperationRunner> { public: @@ -46,11 +41,12 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationRunner typedef FileSystemOperation::StatusCallback StatusCallback; typedef FileSystemOperation::WriteCallback WriteCallback; typedef FileSystemOperation::OpenFileCallback OpenFileCallback; + typedef FileSystemOperation::CopyProgressCallback CopyProgressCallback; + typedef FileSystemOperation::CopyFileProgressCallback + CopyFileProgressCallback; typedef int OperationID; - static const OperationID kErrorOperationID; - virtual ~FileSystemOperationRunner(); // Cancels all inflight operations. @@ -71,8 +67,10 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationRunner // |src_url| is a directory, the contents of |src_url| are copied to // |dest_url| recursively. A new file or directory is created at // |dest_url| as needed. + // For |progress_callback|, see file_system_operation.h for details. OperationID Copy(const FileSystemURL& src_url, const FileSystemURL& dest_url, + const CopyProgressCallback& progress_callback, const StatusCallback& callback); // Moves a file or directory from |src_url| to |dest_url|. A new file @@ -103,10 +101,10 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationRunner const StatusCallback& callback); // Writes contents of |blob_url| to |url| at |offset|. - // |url_request_context| is used to read contents in |blob_url|. + // |url_request_context| is used to read contents in |blob|. OperationID Write(const net::URLRequestContext* url_request_context, const FileSystemURL& url, - const GURL& blob_url, + scoped_ptr<webkit_blob::BlobDataHandle> blob, int64 offset, const WriteCallback& callback); @@ -190,6 +188,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationRunner // Copies a file from |src_url| to |dest_url|. // This must be called for files that belong to the same filesystem // (i.e. type() and origin() of the |src_url| and |dest_url| must match). + // For |progress_callback|, see file_system_operation.h for details. // // This returns: // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_url| @@ -202,6 +201,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationRunner // OperationID CopyFileLocal(const FileSystemURL& src_url, const FileSystemURL& dest_url, + const CopyFileProgressCallback& progress_callback, const StatusCallback& callback); // Moves a local file from |src_url| to |dest_url|. @@ -228,54 +228,65 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationRunner base::FilePath* platform_path); private: + class BeginOperationScoper; + + struct OperationHandle { + OperationID id; + base::WeakPtr<BeginOperationScoper> scope; + + OperationHandle(); + ~OperationHandle(); + }; + friend class FileSystemContext; explicit FileSystemOperationRunner(FileSystemContext* file_system_context); - void DidFinish(OperationID id, + void DidFinish(const OperationHandle& handle, const StatusCallback& callback, base::PlatformFileError rv); - void DidGetMetadata(OperationID id, + void DidGetMetadata(const OperationHandle& handle, const GetMetadataCallback& callback, base::PlatformFileError rv, const base::PlatformFileInfo& file_info); - void DidReadDirectory(OperationID id, + void DidReadDirectory(const OperationHandle& handle, const ReadDirectoryCallback& callback, base::PlatformFileError rv, const std::vector<DirectoryEntry>& entries, bool has_more); - void DidWrite(OperationID id, + void DidWrite(const OperationHandle& handle, const WriteCallback& callback, base::PlatformFileError rv, int64 bytes, bool complete); void DidOpenFile( - OperationID id, + const OperationHandle& handle, const OpenFileCallback& callback, base::PlatformFileError rv, base::PlatformFile file, const base::Closure& on_close_callback, base::ProcessHandle peer_handle); void DidCreateSnapshot( - OperationID id, + const OperationHandle& handle, const SnapshotFileCallback& callback, base::PlatformFileError rv, const base::PlatformFileInfo& file_info, const base::FilePath& platform_path, const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); - // A helper method for creating FileSystemOperationImpl for operations - // that are supported only in FileSystemOperationImpl. - // Note that this returns FileSystemOperation, so the caller needs to - // call AsFileSystemOperationImpl() (which is guaranteed to be non-null - // if this method returns without error). - FileSystemOperation* CreateFileSystemOperationImpl( - const FileSystemURL& url, - base::PlatformFileError* error); + void OnCopyProgress( + const OperationHandle& handle, + const CopyProgressCallback& callback, + FileSystemOperation::CopyProgressType type, + const FileSystemURL& source_url, + const FileSystemURL& dest_url, + int64 size); void PrepareForWrite(OperationID id, const FileSystemURL& url); void PrepareForRead(OperationID id, const FileSystemURL& url); - // This must be called at the end of any async operations. + // These must be called at the beginning and end of any async operations. + OperationHandle BeginOperation(FileSystemOperation* operation, + base::WeakPtr<BeginOperationScoper> scope); void FinishOperation(OperationID id); // Not owned; file_system_context owns this. @@ -289,6 +300,12 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationRunner typedef std::map<OperationID, FileSystemURLSet> OperationToURLSet; OperationToURLSet write_target_urls_; + // Operations that are finished but not yet fire their callbacks. + std::set<OperationID> finished_operations_; + + // Callbacks for stray cancels whose target operation is already finished. + std::map<OperationID, StatusCallback> stray_cancel_callbacks_; + DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); }; diff --git a/chromium/webkit/browser/fileapi/file_system_operation_runner_unittest.cc b/chromium/webkit/browser/fileapi/file_system_operation_runner_unittest.cc new file mode 100644 index 00000000000..086c9999ad5 --- /dev/null +++ b/chromium/webkit/browser/fileapi/file_system_operation_runner_unittest.cc @@ -0,0 +1,162 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/basictypes.h" +#include "base/files/file_path.h" +#include "base/files/scoped_temp_dir.h" +#include "base/platform_file.h" +#include "base/run_loop.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "webkit/browser/fileapi/file_system_context.h" +#include "webkit/browser/fileapi/file_system_operation_runner.h" +#include "webkit/browser/fileapi/mock_file_system_context.h" + +namespace fileapi { + +void GetStatus(bool* done, + base::PlatformFileError *status_out, + base::PlatformFileError status) { + ASSERT_FALSE(*done); + *done = true; + *status_out = status; +} + +void GetCancelStatus(bool* operation_done, + bool* cancel_done, + base::PlatformFileError *status_out, + base::PlatformFileError status) { + // Cancel callback must be always called after the operation's callback. + ASSERT_TRUE(*operation_done); + ASSERT_FALSE(*cancel_done); + *cancel_done = true; + *status_out = status; +} + +class FileSystemOperationRunnerTest : public testing::Test { + protected: + FileSystemOperationRunnerTest() {} + virtual ~FileSystemOperationRunnerTest() {} + + virtual void SetUp() OVERRIDE { + ASSERT_TRUE(base_.CreateUniqueTempDir()); + base::FilePath base_dir = base_.path(); + file_system_context_ = + CreateFileSystemContextForTesting(NULL, base_dir); + } + + virtual void TearDown() OVERRIDE { + file_system_context_ = NULL; + base::RunLoop().RunUntilIdle(); + } + + FileSystemURL URL(const std::string& path) { + return file_system_context_->CreateCrackedFileSystemURL( + GURL("http://example.com"), kFileSystemTypeTemporary, + base::FilePath::FromUTF8Unsafe(path)); + } + + FileSystemOperationRunner* operation_runner() { + return file_system_context_->operation_runner(); + } + + private: + base::ScopedTempDir base_; + base::MessageLoop message_loop_; + scoped_refptr<FileSystemContext> file_system_context_; + + DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunnerTest); +}; + +TEST_F(FileSystemOperationRunnerTest, NotFoundError) { + bool done = false; + base::PlatformFileError status = base::PLATFORM_FILE_ERROR_FAILED; + + // Regular NOT_FOUND error, which is called asynchronously. + operation_runner()->Truncate(URL("foo"), 0, + base::Bind(&GetStatus, &done, &status)); + ASSERT_FALSE(done); + base::RunLoop().RunUntilIdle(); + ASSERT_TRUE(done); + ASSERT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status); +} + +TEST_F(FileSystemOperationRunnerTest, InvalidURLError) { + bool done = false; + base::PlatformFileError status = base::PLATFORM_FILE_ERROR_FAILED; + + // Invalid URL error, which calls DidFinish synchronously. + operation_runner()->Truncate(FileSystemURL(), 0, + base::Bind(&GetStatus, &done, &status)); + // The error call back shouldn't be fired synchronously. + ASSERT_FALSE(done); + + base::RunLoop().RunUntilIdle(); + ASSERT_TRUE(done); + ASSERT_EQ(base::PLATFORM_FILE_ERROR_INVALID_URL, status); +} + +TEST_F(FileSystemOperationRunnerTest, NotFoundErrorAndCancel) { + bool done = false; + bool cancel_done = false; + base::PlatformFileError status = base::PLATFORM_FILE_ERROR_FAILED; + base::PlatformFileError cancel_status = base::PLATFORM_FILE_ERROR_FAILED; + + // Call Truncate with non-existent URL, and try to cancel it immediately + // after that (before its callback is fired). + FileSystemOperationRunner::OperationID id = + operation_runner()->Truncate(URL("foo"), 0, + base::Bind(&GetStatus, &done, &status)); + operation_runner()->Cancel(id, base::Bind(&GetCancelStatus, + &done, &cancel_done, + &cancel_status)); + + ASSERT_FALSE(done); + ASSERT_FALSE(cancel_done); + base::RunLoop().RunUntilIdle(); + + ASSERT_TRUE(done); + ASSERT_TRUE(cancel_done); + ASSERT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status); + ASSERT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, cancel_status); +} + +TEST_F(FileSystemOperationRunnerTest, InvalidURLErrorAndCancel) { + bool done = false; + bool cancel_done = false; + base::PlatformFileError status = base::PLATFORM_FILE_ERROR_FAILED; + base::PlatformFileError cancel_status = base::PLATFORM_FILE_ERROR_FAILED; + + // Call Truncate with invalid URL, and try to cancel it immediately + // after that (before its callback is fired). + FileSystemOperationRunner::OperationID id = + operation_runner()->Truncate(FileSystemURL(), 0, + base::Bind(&GetStatus, &done, &status)); + operation_runner()->Cancel(id, base::Bind(&GetCancelStatus, + &done, &cancel_done, + &cancel_status)); + + ASSERT_FALSE(done); + ASSERT_FALSE(cancel_done); + base::RunLoop().RunUntilIdle(); + + ASSERT_TRUE(done); + ASSERT_TRUE(cancel_done); + ASSERT_EQ(base::PLATFORM_FILE_ERROR_INVALID_URL, status); + ASSERT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, cancel_status); +} + +TEST_F(FileSystemOperationRunnerTest, CancelWithInvalidId) { + const FileSystemOperationRunner::OperationID kInvalidId = -1; + bool done = true; // The operation is not running. + bool cancel_done = false; + base::PlatformFileError cancel_status = base::PLATFORM_FILE_ERROR_FAILED; + operation_runner()->Cancel(kInvalidId, base::Bind(&GetCancelStatus, + &done, &cancel_done, + &cancel_status)); + + ASSERT_TRUE(cancel_done); + ASSERT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, cancel_status); +} + +} // namespace fileapi diff --git a/chromium/webkit/browser/fileapi/file_system_quota_client.cc b/chromium/webkit/browser/fileapi/file_system_quota_client.cc index 343a6e6ee5c..76725df31a8 100644 --- a/chromium/webkit/browser/fileapi/file_system_quota_client.cc +++ b/chromium/webkit/browser/fileapi/file_system_quota_client.cc @@ -197,6 +197,12 @@ void FileSystemQuotaClient::DeleteOriginData( callback); } +bool FileSystemQuotaClient::DoesSupport(quota::StorageType storage_type) const { + FileSystemType type = QuotaStorageTypeToFileSystemType(storage_type); + DCHECK(type != kFileSystemTypeUnknown); + return file_system_context_->IsSandboxFileSystem(type); +} + base::SequencedTaskRunner* FileSystemQuotaClient::file_task_runner() const { return file_system_context_->default_file_task_runner(); } diff --git a/chromium/webkit/browser/fileapi/file_system_quota_client.h b/chromium/webkit/browser/fileapi/file_system_quota_client.h index f2168043f1b..f3cf68ddf13 100644 --- a/chromium/webkit/browser/fileapi/file_system_quota_client.h +++ b/chromium/webkit/browser/fileapi/file_system_quota_client.h @@ -56,6 +56,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemQuotaClient const GURL& origin, quota::StorageType type, const DeletionCallback& callback) OVERRIDE; + virtual bool DoesSupport(quota::StorageType type) const OVERRIDE; private: base::SequencedTaskRunner* file_task_runner() const; diff --git a/chromium/webkit/browser/fileapi/file_system_quota_client_unittest.cc b/chromium/webkit/browser/fileapi/file_system_quota_client_unittest.cc index 477bb77e95e..1a9121c1a7a 100644 --- a/chromium/webkit/browser/fileapi/file_system_quota_client_unittest.cc +++ b/chromium/webkit/browser/fileapi/file_system_quota_client_unittest.cc @@ -6,13 +6,13 @@ #include "base/bind.h" #include "base/file_util.h" #include "base/files/scoped_temp_dir.h" -#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_proxy.h" #include "base/platform_file.h" +#include "base/run_loop.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" +#include "webkit/browser/fileapi/async_file_test_helper.h" #include "webkit/browser/fileapi/file_system_context.h" -#include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_quota_client.h" #include "webkit/browser/fileapi/file_system_usage_cache.h" #include "webkit/browser/fileapi/mock_file_system_context.h" @@ -74,7 +74,7 @@ class FileSystemQuotaClientTest : public testing::Test { const std::string& origin_url, quota::StorageType type) { GetOriginUsageAsync(quota_client, origin_url, type); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); return usage_; } @@ -85,7 +85,7 @@ class FileSystemQuotaClientTest : public testing::Test { type, base::Bind(&FileSystemQuotaClientTest::OnGetOrigins, weak_factory_.GetWeakPtr())); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); return origins_; } @@ -97,7 +97,7 @@ class FileSystemQuotaClientTest : public testing::Test { type, host, base::Bind(&FileSystemQuotaClientTest::OnGetOrigins, weak_factory_.GetWeakPtr())); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); return origins_; } @@ -110,32 +110,16 @@ class FileSystemQuotaClientTest : public testing::Test { weak_factory_.GetWeakPtr())); } - FileSystemOperationContext* CreateFileSystemOperationContext( - FileSystemType type) { - FileSystemOperationContext* context = - new FileSystemOperationContext(file_system_context_.get()); - context->set_allowed_bytes_growth(100000000); - context->set_update_observers( - *file_system_context_->GetUpdateObservers(type)); - return context; - } - bool CreateFileSystemDirectory(const base::FilePath& file_path, const std::string& origin_url, quota::StorageType storage_type) { FileSystemType type = QuotaStorageTypeToFileSystemType(storage_type); - FileSystemFileUtil* file_util = file_system_context_->GetFileUtil(type); - FileSystemURL url = file_system_context_->CreateCrackedFileSystemURL( GURL(origin_url), type, file_path); - scoped_ptr<FileSystemOperationContext> context( - CreateFileSystemOperationContext(type)); base::PlatformFileError result = - file_util->CreateDirectory(context.get(), url, false, false); - if (result != base::PLATFORM_FILE_OK) - return false; - return true; + AsyncFileTestHelper::CreateDirectory(file_system_context_, url); + return result == base::PLATFORM_FILE_OK; } bool CreateFileSystemFile(const base::FilePath& file_path, @@ -146,22 +130,17 @@ class FileSystemQuotaClientTest : public testing::Test { return false; FileSystemType type = QuotaStorageTypeToFileSystemType(storage_type); - FileSystemFileUtil* file_util = file_system_context_->GetFileUtil(type); - FileSystemURL url = file_system_context_->CreateCrackedFileSystemURL( GURL(origin_url), type, file_path); - scoped_ptr<FileSystemOperationContext> context( - CreateFileSystemOperationContext(type)); - bool created = false; - if (base::PLATFORM_FILE_OK != - file_util->EnsureFileExists(context.get(), url, &created)) - return false; - EXPECT_TRUE(created); - if (base::PLATFORM_FILE_OK != - file_util->Truncate(context.get(), url, file_size)) + base::PlatformFileError result = + AsyncFileTestHelper::CreateFile(file_system_context_, url); + if (result != base::PLATFORM_FILE_OK) return false; - return true; + + result = AsyncFileTestHelper::TruncateFile( + file_system_context_, url, file_size); + return result == base::PLATFORM_FILE_OK; } void InitializeOriginFiles(FileSystemQuotaClient* quota_client, @@ -428,7 +407,7 @@ TEST_F(FileSystemQuotaClientTest, GetUsage_MultipleTasks) { GetOriginUsageAsync(quota_client.get(), kDummyURL1, kTemporary); RunAdditionalOriginUsageTask(quota_client.get(), kDummyURL1, kTemporary); RunAdditionalOriginUsageTask(quota_client.get(), kDummyURL1, kTemporary); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(11 + 22 + file_paths_cost, usage()); EXPECT_EQ(2, additional_callback_count()); @@ -437,7 +416,7 @@ TEST_F(FileSystemQuotaClientTest, GetUsage_MultipleTasks) { RunAdditionalOriginUsageTask(quota_client.get(), kDummyURL1, kTemporary); GetOriginUsageAsync(quota_client.get(), kDummyURL1, kTemporary); RunAdditionalOriginUsageTask(quota_client.get(), kDummyURL1, kTemporary); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(11 + 22 + file_paths_cost, usage()); EXPECT_EQ(2, additional_callback_count()); } @@ -539,15 +518,15 @@ TEST_F(FileSystemQuotaClientTest, DeleteOriginTest) { "https://bar.com/", kPersistent); DeleteOriginData(quota_client.get(), "http://foo.com/", kTemporary); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(quota::kQuotaStatusOk, status()); DeleteOriginData(quota_client.get(), "http://bar.com/", kPersistent); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(quota::kQuotaStatusOk, status()); DeleteOriginData(quota_client.get(), "http://buz.com/", kTemporary); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(quota::kQuotaStatusOk, status()); EXPECT_EQ(0, GetOriginUsage( diff --git a/chromium/webkit/browser/fileapi/file_system_quota_util.h b/chromium/webkit/browser/fileapi/file_system_quota_util.h index be98936c2f5..5f3c7dd77ae 100644 --- a/chromium/webkit/browser/fileapi/file_system_quota_util.h +++ b/chromium/webkit/browser/fileapi/file_system_quota_util.h @@ -56,11 +56,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemQuotaUtil { const GURL& origin_url, fileapi::FileSystemType type) = 0; - virtual void InvalidateUsageCache(const GURL& origin_url, - fileapi::FileSystemType type) = 0; - virtual void StickyInvalidateUsageCache(const GURL& origin, - fileapi::FileSystemType type) = 0; - virtual void AddFileUpdateObserver( FileSystemType type, FileUpdateObserver* observer, @@ -73,6 +68,9 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemQuotaUtil { FileSystemType type, FileAccessObserver* observer, base::SequencedTaskRunner* task_runner) = 0; + + // Returns the observer list for |type|, or returns NULL if any observers + // have not been registered on |type|. virtual const UpdateObserverList* GetUpdateObservers( FileSystemType type) const = 0; virtual const ChangeObserverList* GetChangeObservers( diff --git a/chromium/webkit/browser/fileapi/file_system_url.cc b/chromium/webkit/browser/fileapi/file_system_url.cc index 6269296a684..2f8875a701b 100644 --- a/chromium/webkit/browser/fileapi/file_system_url.cc +++ b/chromium/webkit/browser/fileapi/file_system_url.cc @@ -46,9 +46,6 @@ bool FileSystemURL::ParseFileSystemSchemeURL( if (!url.is_valid() || !url.SchemeIsFileSystem()) return false; - DCHECK(url.inner_url()); - - std::string inner_path = url.inner_url()->path(); const struct { FileSystemType type; @@ -61,8 +58,11 @@ bool FileSystemURL::ParseFileSystemSchemeURL( { kFileSystemTypeTest, kTestDir }, }; + // A path of the inner_url contains only mount type part (e.g. "/temporary"). + DCHECK(url.inner_url()); + std::string inner_path = url.inner_url()->path(); for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kValidTypes); ++i) { - if (StartsWithASCII(inner_path, kValidTypes[i].dir, true)) { + if (inner_path == kValidTypes[i].dir) { file_system_type = kValidTypes[i].type; break; } @@ -135,6 +135,20 @@ FileSystemURL::FileSystemURL(const GURL& origin, FileSystemURL::~FileSystemURL() {} +GURL FileSystemURL::ToGURL() const { + if (!is_valid_) + return GURL(); + + std::string url = GetFileSystemRootURI(origin_, mount_type_).spec(); + if (url.empty()) + return GURL(); + + url.append(virtual_path_.AsUTF8Unsafe()); + + // Build nested GURL. + return GURL(url); +} + std::string FileSystemURL::DebugString() const { if (!is_valid_) return "invalid filesystem: URL"; diff --git a/chromium/webkit/browser/fileapi/file_system_url.h b/chromium/webkit/browser/fileapi/file_system_url.h index 6ac875d6310..d6443e69189 100644 --- a/chromium/webkit/browser/fileapi/file_system_url.h +++ b/chromium/webkit/browser/fileapi/file_system_url.h @@ -118,6 +118,9 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemURL { FileSystemType mount_type() const { return mount_type_; } + // Returns the formatted URL of this instance. + GURL ToGURL() const; + std::string DebugString() const; // Returns true if this URL is a strict parent of the |child|. @@ -127,6 +130,10 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemURL { bool operator==(const FileSystemURL& that) const; + bool operator!=(const FileSystemURL& that) const { + return !(*this == that); + } + struct WEBKIT_STORAGE_BROWSER_EXPORT Comparator { bool operator() (const FileSystemURL& lhs, const FileSystemURL& rhs) const; }; diff --git a/chromium/webkit/browser/fileapi/file_system_url_request_job.cc b/chromium/webkit/browser/fileapi/file_system_url_request_job.cc index d93c14089f2..7d1f8613138 100644 --- a/chromium/webkit/browser/fileapi/file_system_url_request_job.cc +++ b/chromium/webkit/browser/fileapi/file_system_url_request_job.cc @@ -157,6 +157,11 @@ void FileSystemURLRequestJob::StartAsync() { return; DCHECK(!reader_.get()); url_ = file_system_context_->CrackURL(request_->url()); + if (!file_system_context_->CanServeURLRequest(url_)) { + // In incognito mode the API is not usable and there should be no data. + NotifyFailed(net::ERR_FILE_NOT_FOUND); + return; + } file_system_context_->operation_runner()->GetMetadata( url_, base::Bind(&FileSystemURLRequestJob::DidGetMetadata, diff --git a/chromium/webkit/browser/fileapi/file_system_url_request_job_unittest.cc b/chromium/webkit/browser/fileapi/file_system_url_request_job_unittest.cc index a8f6cabbffe..8f54e62b984 100644 --- a/chromium/webkit/browser/fileapi/file_system_url_request_job_unittest.cc +++ b/chromium/webkit/browser/fileapi/file_system_url_request_job_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -16,6 +16,7 @@ #include "base/message_loop/message_loop_proxy.h" #include "base/platform_file.h" #include "base/rand_util.h" +#include "base/run_loop.h" #include "base/strings/string_piece.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" @@ -28,9 +29,10 @@ #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_test_util.h" #include "testing/gtest/include/gtest/gtest.h" +#include "webkit/browser/fileapi/async_file_test_helper.h" +#include "webkit/browser/fileapi/external_mount_points.h" #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_file_util.h" -#include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/mock_file_system_context.h" namespace fileapi { @@ -66,7 +68,7 @@ class FileSystemURLRequestJobTest : public testing::Test { OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, base::Bind(&FileSystemURLRequestJobTest::OnOpenFileSystem, weak_factory_.GetWeakPtr())); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); net::URLRequest::Deprecated::RegisterProtocolFactory( "filesystem", &FileSystemURLRequestJobFactory); @@ -80,7 +82,7 @@ class FileSystemURLRequestJobTest : public testing::Test { pending_job_ = NULL; } // FileReader posts a task to close the file in destructor. - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } void OnOpenFileSystem(base::PlatformFileError result, @@ -91,7 +93,8 @@ class FileSystemURLRequestJobTest : public testing::Test { void TestRequestHelper(const GURL& url, const net::HttpRequestHeaders* headers, - bool run_to_completion) { + bool run_to_completion, + FileSystemContext* file_system_context) { delegate_.reset(new net::TestDelegate()); // Make delegate_ exit the MessageLoop when the request is done. delegate_->set_quit_on_complete(true); @@ -101,7 +104,7 @@ class FileSystemURLRequestJobTest : public testing::Test { request_->SetExtraRequestHeaders(*headers); ASSERT_TRUE(!job_); job_ = new FileSystemURLRequestJob( - request_.get(), NULL, file_system_context_.get()); + request_.get(), NULL, file_system_context); pending_job_ = job_; request_->Start(); @@ -111,61 +114,41 @@ class FileSystemURLRequestJobTest : public testing::Test { } void TestRequest(const GURL& url) { - TestRequestHelper(url, NULL, true); + TestRequestHelper(url, NULL, true, file_system_context_.get()); + } + + void TestRequestWithContext(const GURL& url, + FileSystemContext* file_system_context) { + TestRequestHelper(url, NULL, true, file_system_context); } void TestRequestWithHeaders(const GURL& url, const net::HttpRequestHeaders* headers) { - TestRequestHelper(url, headers, true); + TestRequestHelper(url, headers, true, file_system_context_.get()); } void TestRequestNoRun(const GURL& url) { - TestRequestHelper(url, NULL, false); + TestRequestHelper(url, NULL, false, file_system_context_.get()); } void CreateDirectory(const base::StringPiece& dir_name) { - FileSystemFileUtil* file_util = file_system_context_->GetFileUtil( - kFileSystemTypeTemporary); FileSystemURL url = file_system_context_->CreateCrackedFileSystemURL( GURL("http://remote"), kFileSystemTypeTemporary, base::FilePath().AppendASCII(dir_name)); - - FileSystemOperationContext context(file_system_context_.get()); - context.set_allowed_bytes_growth(1024); - - ASSERT_EQ(base::PLATFORM_FILE_OK, file_util->CreateDirectory( - &context, - url, - false /* exclusive */, - false /* recursive */)); + ASSERT_EQ(base::PLATFORM_FILE_OK, AsyncFileTestHelper::CreateDirectory( + file_system_context_, url)); } void WriteFile(const base::StringPiece& file_name, const char* buf, int buf_size) { - FileSystemFileUtil* file_util = file_system_context_->GetFileUtil( - kFileSystemTypeTemporary); FileSystemURL url = file_system_context_->CreateCrackedFileSystemURL( GURL("http://remote"), kFileSystemTypeTemporary, base::FilePath().AppendASCII(file_name)); - - FileSystemOperationContext context(file_system_context_.get()); - context.set_allowed_bytes_growth(1024); - - base::PlatformFile handle = base::kInvalidPlatformFileValue; - bool created = false; - ASSERT_EQ(base::PLATFORM_FILE_OK, file_util->CreateOrOpen( - &context, - url, - base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_WRITE, - &handle, - &created)); - EXPECT_TRUE(created); - ASSERT_NE(base::kInvalidPlatformFileValue, handle); - ASSERT_EQ(buf_size, - base::WritePlatformFile(handle, 0 /* offset */, buf, buf_size)); - base::ClosePlatformFile(handle); + ASSERT_EQ(base::PLATFORM_FILE_OK, + AsyncFileTestHelper::CreateFileWithData( + file_system_context_, url, buf, buf_size)); } GURL CreateFileSystemURL(const std::string& path) { @@ -335,7 +318,7 @@ TEST_F(FileSystemURLRequestJobTest, Cancel) { // Run StartAsync() and only StartAsync(). base::MessageLoop::current()->DeleteSoon(FROM_HERE, request_.release()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); // If we get here, success! we didn't crash! } @@ -357,5 +340,26 @@ TEST_F(FileSystemURLRequestJobTest, GetMimeType) { EXPECT_EQ(mime_type_direct, mime_type_from_job); } +TEST_F(FileSystemURLRequestJobTest, Incognito) { + WriteFile("file", kTestFileData, arraysize(kTestFileData) - 1); + + // Creates a new filesystem context for incognito mode. + scoped_refptr<FileSystemContext> file_system_context = + CreateIncognitoFileSystemContextForTesting(NULL, temp_dir_.path()); + + // The request should return NOT_FOUND error if it's in incognito mode. + TestRequestWithContext(CreateFileSystemURL("file"), + file_system_context.get()); + ASSERT_FALSE(request_->is_pending()); + EXPECT_TRUE(delegate_->request_failed()); + EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); + + // Make sure it returns success with regular (non-incognito) context. + TestRequest(CreateFileSystemURL("file")); + ASSERT_FALSE(request_->is_pending()); + EXPECT_EQ(kTestFileData, delegate_->data_received()); + EXPECT_EQ(200, request_->GetResponseCode()); +} + } // namespace } // namespace fileapi diff --git a/chromium/webkit/browser/fileapi/file_system_url_unittest.cc b/chromium/webkit/browser/fileapi/file_system_url_unittest.cc index ace67007cb3..c5a632c735c 100644 --- a/chromium/webkit/browser/fileapi/file_system_url_unittest.cc +++ b/chromium/webkit/browser/fileapi/file_system_url_unittest.cc @@ -84,6 +84,8 @@ TEST(FileSystemURLTest, UnescapePath) { TEST(FileSystemURLTest, RejectBadType) { EXPECT_FALSE(CreateFileSystemURL( "filesystem:http://c.org/foobar/file").is_valid()); + EXPECT_FALSE(CreateFileSystemURL( + "filesystem:http://c.org/temporaryfoo/file").is_valid()); } TEST(FileSystemURLTest, RejectMalformedURL) { @@ -156,6 +158,23 @@ TEST(FileSystemURLTest, IsParent) { CreateFileSystemURL(root3 + child))); } +TEST(FileSystemURLTest, ToGURL) { + EXPECT_TRUE(FileSystemURL().ToGURL().is_empty()); + const char* kTestURL[] = { + "filesystem:http://chromium.org/persistent/directory/file0", + "filesystem:http://chromium.org/temporary/directory/file1", + "filesystem:http://chromium.org/isolated/directory/file2", + "filesystem:http://chromium.org/external/directory/file2", + "filesystem:http://chromium.org/test/directory/file3", + }; + + for (size_t i = 0; i < arraysize(kTestURL); ++i) { + EXPECT_EQ( + kTestURL[i], + FileSystemURL::CreateForTest(GURL(kTestURL[i])).ToGURL().spec()); + } +} + TEST(FileSystemURLTest, DebugString) { const GURL kOrigin("http://example.com"); const base::FilePath kPath(FPL("dir/file")); diff --git a/chromium/webkit/browser/fileapi/file_writer_delegate_unittest.cc b/chromium/webkit/browser/fileapi/file_writer_delegate_unittest.cc index 340fcb0120e..28c93e8a0db 100644 --- a/chromium/webkit/browser/fileapi/file_writer_delegate_unittest.cc +++ b/chromium/webkit/browser/fileapi/file_writer_delegate_unittest.cc @@ -9,7 +9,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "base/files/scoped_temp_dir.h" -#include "base/message_loop/message_loop.h" +#include "base/run_loop.h" #include "net/base/io_buffer.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_context.h" @@ -17,9 +17,8 @@ #include "net/url_request/url_request_status.h" #include "testing/platform_test.h" #include "url/gurl.h" +#include "webkit/browser/fileapi/async_file_test_helper.h" #include "webkit/browser/fileapi/file_system_context.h" -#include "webkit/browser/fileapi/file_system_file_util.h" -#include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_quota_util.h" #include "webkit/browser/fileapi/file_writer_delegate.h" #include "webkit/browser/fileapi/mock_file_system_context.h" @@ -80,10 +79,6 @@ class FileWriterDelegateTest : public PlatformTest { virtual void SetUp() OVERRIDE; virtual void TearDown() OVERRIDE; - FileSystemFileUtil* file_util() { - return file_system_context_->GetFileUtil(kFileSystemType); - } - int64 usage() { return file_system_context_->GetQuotaUtil(kFileSystemType) ->GetOriginUsageOnFileThread( @@ -94,14 +89,13 @@ class FileWriterDelegateTest : public PlatformTest { // There might be in-flight flush/write. base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&base::DoNothing)); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); FileSystemURL url = GetFileSystemURL(test_file_path); base::PlatformFileInfo file_info; - base::FilePath platform_path; EXPECT_EQ(base::PLATFORM_FILE_OK, - file_util()->GetFileInfo(NewOperationContext().get(), url, - &file_info, &platform_path)); + AsyncFileTestHelper::GetMetadata( + file_system_context_, url, &file_info)); return file_info.size; } @@ -110,15 +104,6 @@ class FileWriterDelegateTest : public PlatformTest { kOrigin, kFileSystemType, base::FilePath().FromUTF8Unsafe(file_name)); } - scoped_ptr<FileSystemOperationContext> NewOperationContext() { - FileSystemOperationContext* context = - new FileSystemOperationContext(file_system_context_.get()); - context->set_update_observers( - *file_system_context_->GetUpdateObservers(kFileSystemType)); - context->set_root_path(dir_.path()); - return make_scoped_ptr(context); - } - FileWriterDelegate* CreateWriterDelegate( const char* test_file_path, int64 offset, @@ -231,23 +216,16 @@ void FileWriterDelegateTest::SetUp() { file_system_context_ = CreateFileSystemContextForTesting( NULL, dir_.path()); - - bool created = false; - scoped_ptr<FileSystemOperationContext> context = NewOperationContext(); - context->set_allowed_bytes_growth(kint64max); - base::PlatformFileError error = file_util()->EnsureFileExists( - context.get(), - GetFileSystemURL("test"), - &created); - ASSERT_EQ(base::PLATFORM_FILE_OK, error); - ASSERT_TRUE(created); + ASSERT_EQ(base::PLATFORM_FILE_OK, + AsyncFileTestHelper::CreateFile( + file_system_context_, GetFileSystemURL("test"))); net::URLRequest::Deprecated::RegisterProtocolFactory("blob", &Factory); } void FileWriterDelegateTest::TearDown() { net::URLRequest::Deprecated::RegisterProtocolFactory("blob", NULL); file_system_context_ = NULL; - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } TEST_F(FileWriterDelegateTest, WriteSuccessWithoutQuotaLimit) { @@ -336,11 +314,9 @@ TEST_F(FileWriterDelegateTest, WriteSuccessWithoutQuotaLimitConcurrent) { scoped_ptr<FileWriterDelegate> file_writer_delegate2; scoped_ptr<net::URLRequest> request2; - bool created = false; - file_util()->EnsureFileExists(NewOperationContext().get(), - GetFileSystemURL("test2"), - &created); - ASSERT_TRUE(created); + ASSERT_EQ(base::PLATFORM_FILE_OK, + AsyncFileTestHelper::CreateFile( + file_system_context_, GetFileSystemURL("test2"))); const GURL kBlobURL("blob:nolimitconcurrent"); const GURL kBlobURL2("blob:nolimitconcurrent2"); diff --git a/chromium/webkit/browser/fileapi/isolated_file_system_backend.cc b/chromium/webkit/browser/fileapi/isolated_file_system_backend.cc index db59e35c857..f83ae15d8f3 100644 --- a/chromium/webkit/browser/fileapi/isolated_file_system_backend.cc +++ b/chromium/webkit/browser/fileapi/isolated_file_system_backend.cc @@ -13,16 +13,15 @@ #include "base/message_loop/message_loop_proxy.h" #include "base/platform_file.h" #include "base/sequenced_task_runner.h" -#include "webkit/browser/blob/local_file_stream_reader.h" +#include "webkit/browser/blob/file_stream_reader.h" #include "webkit/browser/fileapi/async_file_util_adapter.h" #include "webkit/browser/fileapi/copy_or_move_file_validator.h" +#include "webkit/browser/fileapi/dragged_file_util.h" +#include "webkit/browser/fileapi/file_stream_writer.h" #include "webkit/browser/fileapi/file_system_context.h" -#include "webkit/browser/fileapi/file_system_file_stream_reader.h" +#include "webkit/browser/fileapi/file_system_operation.h" #include "webkit/browser/fileapi/file_system_operation_context.h" -#include "webkit/browser/fileapi/file_system_operation_impl.h" #include "webkit/browser/fileapi/isolated_context.h" -#include "webkit/browser/fileapi/isolated_file_util.h" -#include "webkit/browser/fileapi/local_file_stream_writer.h" #include "webkit/browser/fileapi/native_file_util.h" #include "webkit/browser/fileapi/transient_file_util.h" #include "webkit/common/fileapi/file_system_types.h" @@ -31,7 +30,7 @@ namespace fileapi { IsolatedFileSystemBackend::IsolatedFileSystemBackend() - : isolated_file_util_(new AsyncFileUtilAdapter(new IsolatedFileUtil())), + : isolated_file_util_(new AsyncFileUtilAdapter(new LocalFileUtil())), dragged_file_util_(new AsyncFileUtilAdapter(new DraggedFileUtil())), transient_file_util_(new AsyncFileUtilAdapter(new TransientFileUtil())) { } @@ -72,21 +71,6 @@ void IsolatedFileSystemBackend::OpenFileSystem( base::PLATFORM_FILE_ERROR_SECURITY)); } -FileSystemFileUtil* IsolatedFileSystemBackend::GetFileUtil( - FileSystemType type) { - switch (type) { - case kFileSystemTypeNativeLocal: - return isolated_file_util_->sync_file_util(); - case kFileSystemTypeDragged: - return dragged_file_util_->sync_file_util(); - case kFileSystemTypeForTransientFile: - return transient_file_util_->sync_file_util(); - default: - NOTREACHED(); - } - return NULL; -} - AsyncFileUtil* IsolatedFileSystemBackend::GetAsyncFileUtil( FileSystemType type) { switch (type) { @@ -114,7 +98,7 @@ FileSystemOperation* IsolatedFileSystemBackend::CreateFileSystemOperation( const FileSystemURL& url, FileSystemContext* context, base::PlatformFileError* error_code) const { - return new FileSystemOperationImpl( + return FileSystemOperation::Create( url, context, make_scoped_ptr(new FileSystemOperationContext(context))); } @@ -125,7 +109,7 @@ IsolatedFileSystemBackend::CreateFileStreamReader( const base::Time& expected_modification_time, FileSystemContext* context) const { return scoped_ptr<webkit_blob::FileStreamReader>( - new webkit_blob::LocalFileStreamReader( + webkit_blob::FileStreamReader::CreateForLocalFile( context->default_file_task_runner(), url.path(), offset, expected_modification_time)); } @@ -134,7 +118,7 @@ scoped_ptr<FileStreamWriter> IsolatedFileSystemBackend::CreateFileStreamWriter( const FileSystemURL& url, int64 offset, FileSystemContext* context) const { - return scoped_ptr<FileStreamWriter>(new LocalFileStreamWriter( + return scoped_ptr<FileStreamWriter>(FileStreamWriter::CreateForLocalFile( context->default_file_task_runner(), url.path(), offset)); } diff --git a/chromium/webkit/browser/fileapi/isolated_file_system_backend.h b/chromium/webkit/browser/fileapi/isolated_file_system_backend.h index cdc70969214..aa038442dc6 100644 --- a/chromium/webkit/browser/fileapi/isolated_file_system_backend.h +++ b/chromium/webkit/browser/fileapi/isolated_file_system_backend.h @@ -25,7 +25,6 @@ class IsolatedFileSystemBackend : public FileSystemBackend { FileSystemType type, OpenFileSystemMode mode, const OpenFileSystemCallback& callback) OVERRIDE; - virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) OVERRIDE; virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) OVERRIDE; virtual CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory( FileSystemType type, diff --git a/chromium/webkit/browser/fileapi/local_file_stream_writer.cc b/chromium/webkit/browser/fileapi/local_file_stream_writer.cc index 3f779c969ed..75c2cad8bae 100644 --- a/chromium/webkit/browser/fileapi/local_file_stream_writer.cc +++ b/chromium/webkit/browser/fileapi/local_file_stream_writer.cc @@ -20,14 +20,12 @@ const int kOpenFlagsForWrite = base::PLATFORM_FILE_OPEN | } // namespace -LocalFileStreamWriter::LocalFileStreamWriter(base::TaskRunner* task_runner, - const base::FilePath& file_path, - int64 initial_offset) - : file_path_(file_path), - initial_offset_(initial_offset), - has_pending_operation_(false), - weak_factory_(this), - task_runner_(task_runner) {} +FileStreamWriter* FileStreamWriter::CreateForLocalFile( + base::TaskRunner* task_runner, + const base::FilePath& file_path, + int64 initial_offset) { + return new LocalFileStreamWriter(task_runner, file_path, initial_offset); +} LocalFileStreamWriter::~LocalFileStreamWriter() { // Invalidate weak pointers so that we won't receive any callbacks from @@ -81,6 +79,15 @@ int LocalFileStreamWriter::Flush(const net::CompletionCallback& callback) { return result; } +LocalFileStreamWriter::LocalFileStreamWriter(base::TaskRunner* task_runner, + const base::FilePath& file_path, + int64 initial_offset) + : file_path_(file_path), + initial_offset_(initial_offset), + has_pending_operation_(false), + weak_factory_(this), + task_runner_(task_runner) {} + int LocalFileStreamWriter::InitiateOpen( const net::CompletionCallback& error_callback, const base::Closure& main_operation) { diff --git a/chromium/webkit/browser/fileapi/local_file_stream_writer.h b/chromium/webkit/browser/fileapi/local_file_stream_writer.h index 08e12e80e41..dce428a56bd 100644 --- a/chromium/webkit/browser/fileapi/local_file_stream_writer.h +++ b/chromium/webkit/browser/fileapi/local_file_stream_writer.h @@ -10,6 +10,7 @@ #include "base/callback.h" #include "base/compiler_specific.h" #include "base/files/file_path.h" +#include "base/gtest_prod_util.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/platform_file.h" @@ -24,13 +25,9 @@ class FileStream; namespace fileapi { // This class is a thin wrapper around net::FileStream for writing local files. -class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE LocalFileStreamWriter - : public FileStreamWriter { +class WEBKIT_STORAGE_BROWSER_EXPORT LocalFileStreamWriter + : public NON_EXPORTED_BASE(FileStreamWriter) { public: - // Creates a writer for the existing file in the path |file_path| starting - // from |initial_offset|. Uses |task_runner| for async file operations. - LocalFileStreamWriter(base::TaskRunner* task_runner, - const base::FilePath& file_path, int64 initial_offset); virtual ~LocalFileStreamWriter(); // FileStreamWriter overrides. @@ -40,6 +37,12 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE LocalFileStreamWriter virtual int Flush(const net::CompletionCallback& callback) OVERRIDE; private: + friend class FileStreamWriter; + friend class LocalFileStreamWriterTest; + LocalFileStreamWriter(base::TaskRunner* task_runner, + const base::FilePath& file_path, + int64 initial_offset); + // Opens |file_path_| and if it succeeds, proceeds to InitiateSeek(). // If failed, the error code is returned by calling |error_callback|. int InitiateOpen(const net::CompletionCallback& error_callback, diff --git a/chromium/webkit/browser/fileapi/local_file_stream_writer_unittest.cc b/chromium/webkit/browser/fileapi/local_file_stream_writer_unittest.cc index bed037d7b09..cf3c06a18cd 100644 --- a/chromium/webkit/browser/fileapi/local_file_stream_writer_unittest.cc +++ b/chromium/webkit/browser/fileapi/local_file_stream_writer_unittest.cc @@ -12,14 +12,13 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" +#include "base/run_loop.h" #include "base/threading/thread.h" #include "net/base/io_buffer.h" #include "net/base/test_completion_callback.h" #include "testing/gtest/include/gtest/gtest.h" -namespace { - -using fileapi::LocalFileStreamWriter; +namespace fileapi { class LocalFileStreamWriterTest : public testing::Test { public: @@ -34,9 +33,9 @@ class LocalFileStreamWriterTest : public testing::Test { virtual void TearDown() OVERRIDE { // Give another chance for deleted streams to perform Close. - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); file_thread_.Stop(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } protected: @@ -65,7 +64,7 @@ class LocalFileStreamWriterTest : public testing::Test { std::string GetFileContent(const base::FilePath& path) { std::string content; - file_util::ReadFileToString(path, &content); + base::ReadFileToString(path, &content); return content; } @@ -80,6 +79,11 @@ class LocalFileStreamWriterTest : public testing::Test { return file_thread_.message_loop_proxy().get(); } + LocalFileStreamWriter* CreateWriter(const base::FilePath& path, + int64 offset) { + return new LocalFileStreamWriter(file_task_runner(), path, offset); + } + private: base::MessageLoop message_loop_; base::Thread file_thread_; @@ -90,38 +94,33 @@ void NeverCalled(int unused) { ADD_FAILURE(); } -} // namespace - TEST_F(LocalFileStreamWriterTest, Write) { base::FilePath path = CreateFileWithContent("file_a", std::string()); - scoped_ptr<LocalFileStreamWriter> writer( - new LocalFileStreamWriter(file_task_runner(), path, 0)); + scoped_ptr<LocalFileStreamWriter> writer(CreateWriter(path, 0)); EXPECT_EQ(net::OK, WriteStringToWriter(writer.get(), "foo")); EXPECT_EQ(net::OK, WriteStringToWriter(writer.get(), "bar")); writer.reset(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(base::PathExists(path)); EXPECT_EQ("foobar", GetFileContent(path)); } TEST_F(LocalFileStreamWriterTest, WriteMiddle) { base::FilePath path = CreateFileWithContent("file_a", "foobar"); - scoped_ptr<LocalFileStreamWriter> writer( - new LocalFileStreamWriter(file_task_runner(), path, 2)); + scoped_ptr<LocalFileStreamWriter> writer(CreateWriter(path, 2)); EXPECT_EQ(net::OK, WriteStringToWriter(writer.get(), "xxx")); writer.reset(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(base::PathExists(path)); EXPECT_EQ("foxxxr", GetFileContent(path)); } TEST_F(LocalFileStreamWriterTest, WriteEnd) { base::FilePath path = CreateFileWithContent("file_a", "foobar"); - scoped_ptr<LocalFileStreamWriter> writer( - new LocalFileStreamWriter(file_task_runner(), path, 6)); + scoped_ptr<LocalFileStreamWriter> writer(CreateWriter(path, 6)); EXPECT_EQ(net::OK, WriteStringToWriter(writer.get(), "xxx")); writer.reset(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(base::PathExists(path)); EXPECT_EQ("foobarxxx", GetFileContent(path)); } @@ -129,18 +128,16 @@ TEST_F(LocalFileStreamWriterTest, WriteEnd) { TEST_F(LocalFileStreamWriterTest, WriteFailForNonexistingFile) { base::FilePath path = Path("file_a"); ASSERT_FALSE(base::PathExists(path)); - scoped_ptr<LocalFileStreamWriter> writer( - new LocalFileStreamWriter(file_task_runner(), path, 0)); + scoped_ptr<LocalFileStreamWriter> writer(CreateWriter(path, 0)); EXPECT_EQ(net::ERR_FILE_NOT_FOUND, WriteStringToWriter(writer.get(), "foo")); writer.reset(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_FALSE(base::PathExists(path)); } TEST_F(LocalFileStreamWriterTest, CancelBeforeOperation) { base::FilePath path = Path("file_a"); - scoped_ptr<LocalFileStreamWriter> writer( - new LocalFileStreamWriter(file_task_runner(), path, 0)); + scoped_ptr<LocalFileStreamWriter> writer(CreateWriter(path, 0)); // Cancel immediately fails when there's no in-flight operation. int cancel_result = writer->Cancel(base::Bind(&NeverCalled)); EXPECT_EQ(net::ERR_UNEXPECTED, cancel_result); @@ -148,8 +145,7 @@ TEST_F(LocalFileStreamWriterTest, CancelBeforeOperation) { TEST_F(LocalFileStreamWriterTest, CancelAfterFinishedOperation) { base::FilePath path = CreateFileWithContent("file_a", std::string()); - scoped_ptr<LocalFileStreamWriter> writer( - new LocalFileStreamWriter(file_task_runner(), path, 0)); + scoped_ptr<LocalFileStreamWriter> writer(CreateWriter(path, 0)); EXPECT_EQ(net::OK, WriteStringToWriter(writer.get(), "foo")); // Cancel immediately fails when there's no in-flight operation. @@ -157,7 +153,7 @@ TEST_F(LocalFileStreamWriterTest, CancelAfterFinishedOperation) { EXPECT_EQ(net::ERR_UNEXPECTED, cancel_result); writer.reset(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); // Write operation is already completed. EXPECT_TRUE(base::PathExists(path)); EXPECT_EQ("foo", GetFileContent(path)); @@ -165,8 +161,7 @@ TEST_F(LocalFileStreamWriterTest, CancelAfterFinishedOperation) { TEST_F(LocalFileStreamWriterTest, CancelWrite) { base::FilePath path = CreateFileWithContent("file_a", "foobar"); - scoped_ptr<LocalFileStreamWriter> writer( - new LocalFileStreamWriter(file_task_runner(), path, 0)); + scoped_ptr<LocalFileStreamWriter> writer(CreateWriter(path, 0)); scoped_refptr<net::StringIOBuffer> buffer(new net::StringIOBuffer("xxx")); int result = @@ -178,3 +173,5 @@ TEST_F(LocalFileStreamWriterTest, CancelWrite) { int cancel_result = callback.WaitForResult(); EXPECT_EQ(net::OK, cancel_result); } + +} // namespace fileapi diff --git a/chromium/webkit/browser/fileapi/local_file_util.cc b/chromium/webkit/browser/fileapi/local_file_util.cc index f13af8d207f..d2d653ac78c 100644 --- a/chromium/webkit/browser/fileapi/local_file_util.cc +++ b/chromium/webkit/browser/fileapi/local_file_util.cc @@ -8,6 +8,7 @@ #include "base/files/file_enumerator.h" #include "base/files/file_util_proxy.h" #include "url/gurl.h" +#include "webkit/browser/fileapi/async_file_util_adapter.h" #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_url.h" @@ -17,6 +18,10 @@ namespace fileapi { +AsyncFileUtil* AsyncFileUtil::CreateForLocalFileSystem() { + return new AsyncFileUtilAdapter(new LocalFileUtil()); +} + using base::PlatformFileError; class LocalFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator { @@ -69,11 +74,9 @@ bool LocalFileEnumerator::IsDirectory() { return file_util_info_.IsDirectory(); } -LocalFileUtil::LocalFileUtil() { -} +LocalFileUtil::LocalFileUtil() {} -LocalFileUtil::~LocalFileUtil() { -} +LocalFileUtil::~LocalFileUtil() {} PlatformFileError LocalFileUtil::CreateOrOpen( FileSystemOperationContext* context, @@ -157,10 +160,13 @@ PlatformFileError LocalFileUtil::GetLocalFilePath( FileSystemOperationContext* context, const FileSystemURL& url, base::FilePath* local_file_path) { - base::FilePath root = context->root_path(); - if (root.empty()) - return base::PLATFORM_FILE_ERROR_NOT_FOUND; - *local_file_path = root.Append(url.path()); + DCHECK(local_file_path); + DCHECK(url.is_valid()); + if (url.path().empty()) { + // Root direcory case, which should not be accessed. + return base::PLATFORM_FILE_ERROR_ACCESS_DENIED; + } + *local_file_path = url.path(); return base::PLATFORM_FILE_OK; } diff --git a/chromium/webkit/browser/fileapi/local_file_util.h b/chromium/webkit/browser/fileapi/local_file_util.h index abd6b54e1c3..38f285a6b04 100644 --- a/chromium/webkit/browser/fileapi/local_file_util.h +++ b/chromium/webkit/browser/fileapi/local_file_util.h @@ -6,13 +6,13 @@ #define WEBKIT_BROWSER_FILEAPI_LOCAL_FILE_UTIL_H_ #include "base/compiler_specific.h" +#include "base/files/file_path.h" #include "base/memory/scoped_ptr.h" #include "base/platform_file.h" #include "webkit/browser/fileapi/file_system_file_util.h" #include "webkit/browser/webkit_storage_browser_export.h" namespace base { -class FilePath; class Time; } @@ -24,7 +24,7 @@ class FileSystemOperationContext; class FileSystemURL; // An instance of this class is created and owned by *FileSystemBackend. -class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE LocalFileUtil +class WEBKIT_STORAGE_BROWSER_EXPORT LocalFileUtil : public FileSystemFileUtil { public: LocalFileUtil(); diff --git a/chromium/webkit/browser/fileapi/local_file_util_unittest.cc b/chromium/webkit/browser/fileapi/local_file_util_unittest.cc index b0b52e718db..bdd2d879925 100644 --- a/chromium/webkit/browser/fileapi/local_file_util_unittest.cc +++ b/chromium/webkit/browser/fileapi/local_file_util_unittest.cc @@ -7,13 +7,14 @@ #include "base/file_util.h" #include "base/files/file_path.h" #include "base/files/scoped_temp_dir.h" -#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_proxy.h" #include "base/platform_file.h" +#include "base/run_loop.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/fileapi/async_file_test_helper.h" +#include "webkit/browser/fileapi/async_file_util_adapter.h" #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_file_util.h" #include "webkit/browser/fileapi/file_system_operation_context.h" @@ -43,7 +44,7 @@ class LocalFileUtilTest : public testing::Test { virtual void TearDown() { file_system_context_ = NULL; - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } protected: @@ -52,13 +53,13 @@ class LocalFileUtilTest : public testing::Test { new FileSystemOperationContext(file_system_context_.get()); context->set_update_observers( *file_system_context_->GetUpdateObservers(kFileSystemType)); - context->set_root_path(data_dir_.path()); return context; } LocalFileUtil* file_util() { - return static_cast<LocalFileUtil*>( - file_system_context_->GetFileUtil(kFileSystemType)); + AsyncFileUtilAdapter* adapter = static_cast<AsyncFileUtilAdapter*>( + file_system_context_->GetAsyncFileUtil(kFileSystemType)); + return static_cast<LocalFileUtil*>(adapter->sync_file_util()); } FileSystemURL CreateURL(const std::string& file_name) { diff --git a/chromium/webkit/browser/fileapi/mock_file_system_context.cc b/chromium/webkit/browser/fileapi/mock_file_system_context.cc index e2556d5da13..ed1715c2bbe 100644 --- a/chromium/webkit/browser/fileapi/mock_file_system_context.cc +++ b/chromium/webkit/browser/fileapi/mock_file_system_context.cc @@ -39,4 +39,19 @@ FileSystemContext* CreateFileSystemContextWithAdditionalProvidersForTesting( CreateAllowFileAccessOptions()); } +FileSystemContext* CreateIncognitoFileSystemContextForTesting( + quota::QuotaManagerProxy* quota_manager_proxy, + const base::FilePath& base_path) { + ScopedVector<FileSystemBackend> additional_providers; + return new FileSystemContext( + base::MessageLoopProxy::current().get(), + base::MessageLoopProxy::current().get(), + ExternalMountPoints::CreateRefCounted().get(), + make_scoped_refptr(new quota::MockSpecialStoragePolicy()).get(), + quota_manager_proxy, + additional_providers.Pass(), + base_path, + CreateIncognitoFileSystemOptions()); +} + } // namespace fileapi diff --git a/chromium/webkit/browser/fileapi/mock_file_system_context.h b/chromium/webkit/browser/fileapi/mock_file_system_context.h index bf01ba1594d..83b904d6fde 100644 --- a/chromium/webkit/browser/fileapi/mock_file_system_context.h +++ b/chromium/webkit/browser/fileapi/mock_file_system_context.h @@ -29,6 +29,10 @@ FileSystemContext* CreateFileSystemContextWithAdditionalProvidersForTesting( ScopedVector<FileSystemBackend> additional_providers, const base::FilePath& base_path); +FileSystemContext* CreateIncognitoFileSystemContextForTesting( + quota::QuotaManagerProxy* quota_manager_proxy, + const base::FilePath& base_path); + } // namespace fileapi #endif // WEBKIT_BROWSER_FILEAPI_MOCK_FILE_SYSTEM_CONTEXT_H_ diff --git a/chromium/webkit/browser/fileapi/obfuscated_file_util.cc b/chromium/webkit/browser/fileapi/obfuscated_file_util.cc index 77e2d86a7e7..341f7d0a8bb 100644 --- a/chromium/webkit/browser/fileapi/obfuscated_file_util.cc +++ b/chromium/webkit/browser/fileapi/obfuscated_file_util.cc @@ -12,6 +12,7 @@ #include "base/format_macros.h" #include "base/logging.h" #include "base/message_loop/message_loop.h" +#include "base/metrics/histogram.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" @@ -99,6 +100,12 @@ const base::FilePath::CharType kTemporaryDirectoryName[] = FILE_PATH_LITERAL("t" const base::FilePath::CharType kPersistentDirectoryName[] = FILE_PATH_LITERAL("p"); const base::FilePath::CharType kSyncableDirectoryName[] = FILE_PATH_LITERAL("s"); +enum IsolatedOriginStatus { + kIsolatedOriginMatch, + kIsolatedOriginDontMatch, + kIsolatedOriginStatusMax, +}; + } // namespace using base::PlatformFile; @@ -276,7 +283,7 @@ PlatformFileError ObfuscatedFileUtil::CreateOrOpen( file_flags & base::PLATFORM_FILE_WRITE && context->quota_limit_type() == quota::kQuotaLimitTypeUnlimited) { DCHECK_EQ(base::PLATFORM_FILE_OK, error); - context->file_system_context()->GetQuotaUtil(url.type())-> + context->file_system_context()->sandbox_delegate()-> StickyInvalidateUsageCache(url.origin(), url.type()); } return error; @@ -380,10 +387,9 @@ PlatformFileError ObfuscatedFileUtil::CreateDirectory( int64 growth = UsageForPath(file_info.name.size()); if (!AllocateQuota(context, growth)) return base::PLATFORM_FILE_ERROR_NO_SPACE; - if (!db->AddFileInfo(file_info, &parent_id)) { - NOTREACHED(); - return base::PLATFORM_FILE_ERROR_FAILED; - } + base::PlatformFileError error = db->AddFileInfo(file_info, &parent_id); + if (error != base::PLATFORM_FILE_OK) + return error; UpdateUsage(context, url, growth); context->change_observers()->Notify( &FileChangeObserver::OnCreateDirectory, MakeTuple(url)); @@ -1123,6 +1129,7 @@ PlatformFileError ObfuscatedFileUtil::CreateFile( DCHECK_NE(base::kInvalidPlatformFileValue, *handle); base::ClosePlatformFile(*handle); base::DeleteFile(dest_local_path, false /* recursive */); + *handle = base::kInvalidPlatformFileValue; } return base::PLATFORM_FILE_ERROR_FAILED; } @@ -1133,13 +1140,15 @@ PlatformFileError ObfuscatedFileUtil::CreateFile( dest_local_path.value().substr(root.value().length() + 1)); FileId file_id; - if (!db->AddFileInfo(*dest_file_info, &file_id)) { + error = db->AddFileInfo(*dest_file_info, &file_id); + if (error != base::PLATFORM_FILE_OK) { if (handle) { DCHECK_NE(base::kInvalidPlatformFileValue, *handle); base::ClosePlatformFile(*handle); + *handle = base::kInvalidPlatformFileValue; } base::DeleteFile(dest_local_path, false /* recursive */); - return base::PLATFORM_FILE_ERROR_FAILED; + return error; } TouchDirectory(db, dest_file_info->parent_id); @@ -1261,7 +1270,7 @@ void ObfuscatedFileUtil::InvalidateUsageCache( FileSystemOperationContext* context, const GURL& origin, FileSystemType type) { - context->file_system_context()->GetQuotaUtil(type)-> + context->file_system_context()->sandbox_delegate()-> InvalidateUsageCache(origin, type); } @@ -1436,6 +1445,15 @@ bool ObfuscatedFileUtil::HasIsolatedStorage(const GURL& origin) { isolated_origin_ = origin; // Record isolated_origin_, but always disable for now. // crbug.com/264429 + if (isolated_origin_ != origin) { + UMA_HISTOGRAM_ENUMERATION("FileSystem.IsolatedOriginStatus", + kIsolatedOriginDontMatch, + kIsolatedOriginStatusMax); + } else { + UMA_HISTOGRAM_ENUMERATION("FileSystem.IsolatedOriginStatus", + kIsolatedOriginMatch, + kIsolatedOriginStatusMax); + } return false; } return false; diff --git a/chromium/webkit/browser/fileapi/obfuscated_file_util_unittest.cc b/chromium/webkit/browser/fileapi/obfuscated_file_util_unittest.cc index c4f409f76ed..c37b17caa23 100644 --- a/chromium/webkit/browser/fileapi/obfuscated_file_util_unittest.cc +++ b/chromium/webkit/browser/fileapi/obfuscated_file_util_unittest.cc @@ -11,8 +11,8 @@ #include "base/files/file_path.h" #include "base/files/scoped_temp_dir.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop.h" #include "base/platform_file.h" +#include "base/run_loop.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/fileapi/async_file_test_helper.h" #include "webkit/browser/fileapi/external_mount_points.h" @@ -248,7 +248,7 @@ class ObfuscatedFileUtilTest : public testing::Test { } int64 SizeInUsageFile() { - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 usage = 0; return usage_cache()->GetUsage( sandbox_file_system_.GetUsageCachePath(), &usage) ? usage : -1; @@ -375,7 +375,7 @@ class ObfuscatedFileUtilTest : public testing::Test { expected_usage_(expected_usage) {} ~UsageVerifyHelper() { - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); Check(); } @@ -2269,7 +2269,7 @@ TEST_F(ObfuscatedFileUtilTest, MaybeDropDatabasesAliveCase) { // Callback to Drop DB is called while ObfuscatedFileUtilTest is still alive. file_util.db_flush_delay_seconds_ = 0; file_util.MarkUsed(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); ASSERT_TRUE(file_util.origin_database_ == NULL); } @@ -2287,7 +2287,7 @@ TEST_F(ObfuscatedFileUtilTest, MaybeDropDatabasesAlreadyDeletedCase) { } // At this point the callback is still in the message queue but OFU is gone. - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } TEST_F(ObfuscatedFileUtilTest, DestroyDirectoryDatabase_Isolated) { @@ -2367,9 +2367,37 @@ TEST_F(ObfuscatedFileUtilTest, MigrationBackFromIsolated) { // Check we see the same contents in the new origin directory. std::string origin_db_data; EXPECT_TRUE(base::PathExists(origin_directory.AppendASCII("dummy"))); - EXPECT_TRUE(file_util::ReadFileToString( + EXPECT_TRUE(base::ReadFileToString( origin_directory.AppendASCII("dummy"), &origin_db_data)); EXPECT_EQ(kFakeDirectoryData, origin_db_data); } +TEST_F(ObfuscatedFileUtilTest, OpenPathInNonDirectory) { + FileSystemURL file(CreateURLFromUTF8("file")); + FileSystemURL path_in_file(CreateURLFromUTF8("file/file")); + bool created; + + ASSERT_EQ(base::PLATFORM_FILE_OK, + ofu()->EnsureFileExists(UnlimitedContext().get(), file, &created)); + ASSERT_TRUE(created); + + created = false; + base::PlatformFile file_handle = base::kInvalidPlatformFileValue; + int file_flags = base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_WRITE; + ASSERT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY, + ofu()->CreateOrOpen(UnlimitedContext().get(), + path_in_file, + file_flags, + &file_handle, + &created)); + ASSERT_FALSE(created); + ASSERT_EQ(base::kInvalidPlatformFileValue, file_handle); + + ASSERT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY, + ofu()->CreateDirectory(UnlimitedContext().get(), + path_in_file, + false /* exclusive */, + false /* recursive */)); +} + } // namespace fileapi diff --git a/chromium/webkit/browser/fileapi/recursive_operation_delegate.cc b/chromium/webkit/browser/fileapi/recursive_operation_delegate.cc index c91c74cf148..81f26ff1c71 100644 --- a/chromium/webkit/browser/fileapi/recursive_operation_delegate.cc +++ b/chromium/webkit/browser/fileapi/recursive_operation_delegate.cc @@ -18,79 +18,88 @@ const int kMaxInflightOperations = 5; RecursiveOperationDelegate::RecursiveOperationDelegate( FileSystemContext* file_system_context) : file_system_context_(file_system_context), - inflight_operations_(0) { + inflight_operations_(0), + canceled_(false) { } RecursiveOperationDelegate::~RecursiveOperationDelegate() { } +void RecursiveOperationDelegate::Cancel() { + canceled_ = true; +} + void RecursiveOperationDelegate::StartRecursiveOperation( const FileSystemURL& root, const StatusCallback& callback) { + DCHECK(pending_directory_stack_.empty()); + DCHECK(pending_files_.empty()); + DCHECK_EQ(0, inflight_operations_); + callback_ = callback; - pending_directories_.push(root); - ProcessNextDirectory(); + ++inflight_operations_; + ProcessFile( + root, + base::Bind(&RecursiveOperationDelegate::DidTryProcessFile, + AsWeakPtr(), root)); } FileSystemOperationRunner* RecursiveOperationDelegate::operation_runner() { return file_system_context_->operation_runner(); } -void RecursiveOperationDelegate::ProcessNextDirectory() { +void RecursiveOperationDelegate::DidTryProcessFile( + const FileSystemURL& root, + base::PlatformFileError error) { + DCHECK(pending_directory_stack_.empty()); DCHECK(pending_files_.empty()); - if (inflight_operations_ > 0) - return; - if (pending_directories_.empty()) { - callback_.Run(base::PLATFORM_FILE_OK); - return; - } - FileSystemURL url = pending_directories_.front(); - pending_directories_.pop(); - inflight_operations_++; - ProcessDirectory( - url, base::Bind(&RecursiveOperationDelegate::DidProcessDirectory, - AsWeakPtr(), url)); -} + DCHECK_EQ(1, inflight_operations_); -void RecursiveOperationDelegate::ProcessPendingFiles() { - if (pending_files_.empty()) { - ProcessNextDirectory(); + --inflight_operations_; + if (canceled_ || error != base::PLATFORM_FILE_ERROR_NOT_A_FILE) { + Done(error); return; } - while (!pending_files_.empty() && - inflight_operations_ < kMaxInflightOperations) { - FileSystemURL url = pending_files_.front(); - pending_files_.pop(); - inflight_operations_++; - base::MessageLoopProxy::current()->PostTask( - FROM_HERE, - base::Bind(&RecursiveOperationDelegate::ProcessFile, - AsWeakPtr(), url, - base::Bind(&RecursiveOperationDelegate::DidProcessFile, - AsWeakPtr()))); - } + + pending_directory_stack_.push(std::queue<FileSystemURL>()); + pending_directory_stack_.top().push(root); + ProcessNextDirectory(); } -void RecursiveOperationDelegate::DidProcessFile(base::PlatformFileError error) { - inflight_operations_--; - DCHECK_GE(inflight_operations_, 0); - if (error != base::PLATFORM_FILE_OK) { - callback_.Run(error); - return; - } - ProcessPendingFiles(); +void RecursiveOperationDelegate::ProcessNextDirectory() { + DCHECK(pending_files_.empty()); + DCHECK(!pending_directory_stack_.empty()); + DCHECK(!pending_directory_stack_.top().empty()); + DCHECK_EQ(0, inflight_operations_); + + const FileSystemURL& url = pending_directory_stack_.top().front(); + + ++inflight_operations_; + ProcessDirectory( + url, + base::Bind( + &RecursiveOperationDelegate::DidProcessDirectory, AsWeakPtr())); } void RecursiveOperationDelegate::DidProcessDirectory( - const FileSystemURL& url, base::PlatformFileError error) { - if (error != base::PLATFORM_FILE_OK) { - callback_.Run(error); + DCHECK(pending_files_.empty()); + DCHECK(!pending_directory_stack_.empty()); + DCHECK(!pending_directory_stack_.top().empty()); + DCHECK_EQ(1, inflight_operations_); + + --inflight_operations_; + if (canceled_ || error != base::PLATFORM_FILE_OK) { + Done(error); return; } + + const FileSystemURL& parent = pending_directory_stack_.top().front(); + pending_directory_stack_.push(std::queue<FileSystemURL>()); operation_runner()->ReadDirectory( - url, base::Bind(&RecursiveOperationDelegate::DidReadDirectory, - AsWeakPtr(), url)); + parent, + base::Bind(&RecursiveOperationDelegate::DidReadDirectory, + AsWeakPtr(), parent)); } void RecursiveOperationDelegate::DidReadDirectory( @@ -98,44 +107,130 @@ void RecursiveOperationDelegate::DidReadDirectory( base::PlatformFileError error, const FileEntryList& entries, bool has_more) { - if (error != base::PLATFORM_FILE_OK) { - if (error == base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY) { - // The given path may have been a file, so try RemoveFile now. - ProcessFile(parent, - base::Bind(&RecursiveOperationDelegate::DidTryProcessFile, - AsWeakPtr(), error)); - return; - } - callback_.Run(error); + DCHECK(pending_files_.empty()); + DCHECK(!pending_directory_stack_.empty()); + DCHECK_EQ(0, inflight_operations_); + + if (canceled_ || error != base::PLATFORM_FILE_OK) { + Done(error); return; } + for (size_t i = 0; i < entries.size(); i++) { FileSystemURL url = file_system_context_->CreateCrackedFileSystemURL( parent.origin(), parent.mount_type(), parent.virtual_path().Append(entries[i].name)); if (entries[i].is_directory) - pending_directories_.push(url); + pending_directory_stack_.top().push(url); else pending_files_.push(url); } + + // Wait for next entries. if (has_more) return; - inflight_operations_--; - DCHECK_GE(inflight_operations_, 0); ProcessPendingFiles(); } -void RecursiveOperationDelegate::DidTryProcessFile( - base::PlatformFileError previous_error, +void RecursiveOperationDelegate::ProcessPendingFiles() { + DCHECK(!pending_directory_stack_.empty()); + + if ((pending_files_.empty() || canceled_) && inflight_operations_ == 0) { + ProcessSubDirectory(); + return; + } + + // Do not post any new tasks. + if (canceled_) + return; + + // Run ProcessFile in parallel (upto kMaxInflightOperations). + scoped_refptr<base::MessageLoopProxy> current_message_loop = + base::MessageLoopProxy::current(); + while (!pending_files_.empty() && + inflight_operations_ < kMaxInflightOperations) { + ++inflight_operations_; + current_message_loop->PostTask( + FROM_HERE, + base::Bind(&RecursiveOperationDelegate::ProcessFile, + AsWeakPtr(), pending_files_.front(), + base::Bind(&RecursiveOperationDelegate::DidProcessFile, + AsWeakPtr()))); + pending_files_.pop(); + } +} + +void RecursiveOperationDelegate::DidProcessFile( + base::PlatformFileError error) { + --inflight_operations_; + if (error != base::PLATFORM_FILE_OK) { + // If an error occurs, invoke Done immediately (even if there remain + // running operations). It is because in the callback, this instance is + // deleted. + Done(error); + return; + } + + ProcessPendingFiles(); +} + +void RecursiveOperationDelegate::ProcessSubDirectory() { + DCHECK(pending_files_.empty()); + DCHECK(!pending_directory_stack_.empty()); + DCHECK_EQ(0, inflight_operations_); + + if (canceled_) { + Done(base::PLATFORM_FILE_ERROR_ABORT); + return; + } + + if (!pending_directory_stack_.top().empty()) { + // There remain some sub directories. Process them first. + ProcessNextDirectory(); + return; + } + + // All subdirectories are processed. + pending_directory_stack_.pop(); + if (pending_directory_stack_.empty()) { + // All files/directories are processed. + Done(base::PLATFORM_FILE_OK); + return; + } + + DCHECK(!pending_directory_stack_.top().empty()); + ++inflight_operations_; + PostProcessDirectory( + pending_directory_stack_.top().front(), + base::Bind(&RecursiveOperationDelegate::DidPostProcessDirectory, + AsWeakPtr())); +} + +void RecursiveOperationDelegate::DidPostProcessDirectory( base::PlatformFileError error) { - if (error == base::PLATFORM_FILE_ERROR_NOT_A_FILE) { - // It wasn't a file either; returns with the previous error. - callback_.Run(previous_error); + DCHECK(pending_files_.empty()); + DCHECK(!pending_directory_stack_.empty()); + DCHECK(!pending_directory_stack_.top().empty()); + DCHECK_EQ(1, inflight_operations_); + + --inflight_operations_; + pending_directory_stack_.top().pop(); + if (canceled_ || error != base::PLATFORM_FILE_OK) { + Done(error); return; } - DidProcessFile(error); + + ProcessSubDirectory(); +} + +void RecursiveOperationDelegate::Done(base::PlatformFileError error) { + if (canceled_ && error == base::PLATFORM_FILE_OK) { + callback_.Run(base::PLATFORM_FILE_ERROR_ABORT); + } else { + callback_.Run(error); + } } } // namespace fileapi diff --git a/chromium/webkit/browser/fileapi/recursive_operation_delegate.h b/chromium/webkit/browser/fileapi/recursive_operation_delegate.h index 551d875d125..a5266777341 100644 --- a/chromium/webkit/browser/fileapi/recursive_operation_delegate.h +++ b/chromium/webkit/browser/fileapi/recursive_operation_delegate.h @@ -6,6 +6,7 @@ #define WEBKIT_BROWSER_FILEAPI_RECURSIVE_OPERATION_DELEGATE_H_ #include <queue> +#include <stack> #include "base/basictypes.h" #include "base/callback.h" @@ -19,23 +20,16 @@ class FileSystemContext; class FileSystemOperationRunner; // A base class for recursive operation delegates. -// This also provides some convenient default implementations for subclasses -// like StartRecursiveOperation() and NewNestedOperation(). // // In short, each subclass should override ProcessFile and ProcessDirectory // to process a directory or a file. To start the recursive operation it // should also call StartRecursiveOperation. -// -// Each subclass can call NewNestedOperation to create a new file system -// operation to perform a sub-operations, e.g. can call RemoveFile for -// recursive Remove. -class RecursiveOperationDelegate +class WEBKIT_STORAGE_BROWSER_EXPORT RecursiveOperationDelegate : public base::SupportsWeakPtr<RecursiveOperationDelegate> { public: typedef FileSystemOperation::StatusCallback StatusCallback; typedef FileSystemOperation::FileEntryList FileEntryList; - RecursiveOperationDelegate(FileSystemContext* file_system_context); virtual ~RecursiveOperationDelegate(); // This is called when the consumer of this instance starts a non-recursive @@ -56,10 +50,58 @@ class RecursiveOperationDelegate virtual void ProcessDirectory(const FileSystemURL& url, const StatusCallback& callback) = 0; + + // This is called each time after files and subdirectories for a + // directory is processed while recursively performing an operation. + virtual void PostProcessDirectory(const FileSystemURL& url, + const StatusCallback& callback) = 0; + + // Cancels the currently running operation. + void Cancel(); + protected: + explicit RecursiveOperationDelegate(FileSystemContext* file_system_context); + // Starts to process files/directories recursively from the given |root|. - // This will call ProcessFile and ProcessDirectory on each directory or file. - // If the given |root| is a file this simply calls ProcessFile and exits. + // This will call ProcessFile and ProcessDirectory on each file or directory. + // + // First, this tries to call ProcessFile with |root| regardless whether it is + // actually a file or a directory. If it is a directory, ProcessFile should + // return PLATFORM_FILE_NOT_A_FILE. + // + // For each directory, the recursive operation works as follows: + // ProcessDirectory is called first for the directory. + // Then the directory contents are read (to obtain its sub directories and + // files in it). + // ProcessFile is called for found files. This may run in parallel. + // The same step is recursively applied to each subdirectory. + // After all files and subdirectories in a directory are processed, + // PostProcessDirectory is called for the directory. + // Here is an example; + // a_dir/ -+- b1_dir/ -+- c1_dir/ -+- d1_file + // | | | + // | +- c2_file +- d2_file + // | + // +- b2_dir/ --- e_dir/ + // | + // +- b3_file + // | + // +- b4_file + // Then traverse order is: + // ProcessFile(a_dir) (This should return PLATFORM_FILE_NOT_A_FILE). + // ProcessDirectory(a_dir). + // ProcessFile(b3_file), ProcessFile(b4_file). (in parallel). + // ProcessDirectory(b1_dir). + // ProcessFile(c2_file) + // ProcessDirectory(c1_dir). + // ProcessFile(d1_file), ProcessFile(d2_file). (in parallel). + // PostProcessDirectory(c1_dir) + // PostProcessDirectory(b1_dir). + // ProcessDirectory(b2_dir) + // ProcessDirectory(e_dir) + // PostProcessDirectory(e_dir) + // PostProcessDirectory(b2_dir) + // PostProcessDirectory(a_dir) // // |callback| is fired with base::PLATFORM_FILE_OK when every file/directory // under |root| is processed, or fired earlier when any suboperation fails. @@ -74,24 +116,29 @@ class RecursiveOperationDelegate FileSystemOperationRunner* operation_runner(); private: + void DidTryProcessFile(const FileSystemURL& root, + base::PlatformFileError error); void ProcessNextDirectory(); + void DidProcessDirectory(base::PlatformFileError error); + void DidReadDirectory(const FileSystemURL& parent, + base::PlatformFileError error, + const FileEntryList& entries, + bool has_more); void ProcessPendingFiles(); void DidProcessFile(base::PlatformFileError error); - void DidProcessDirectory(const FileSystemURL& url, - base::PlatformFileError error); - void DidReadDirectory( - const FileSystemURL& parent, - base::PlatformFileError error, - const FileEntryList& entries, - bool has_more); - void DidTryProcessFile(base::PlatformFileError previous_error, - base::PlatformFileError error); + void ProcessSubDirectory(); + void DidPostProcessDirectory(base::PlatformFileError error); + + // Called when all recursive operation is done (or an error occurs). + void Done(base::PlatformFileError error); FileSystemContext* file_system_context_; StatusCallback callback_; - std::queue<FileSystemURL> pending_directories_; + std::stack<FileSystemURL> pending_directories_; + std::stack<std::queue<FileSystemURL> > pending_directory_stack_; std::queue<FileSystemURL> pending_files_; int inflight_operations_; + bool canceled_; DISALLOW_COPY_AND_ASSIGN(RecursiveOperationDelegate); }; diff --git a/chromium/webkit/browser/fileapi/recursive_operation_delegate_unittest.cc b/chromium/webkit/browser/fileapi/recursive_operation_delegate_unittest.cc new file mode 100644 index 00000000000..b3842279420 --- /dev/null +++ b/chromium/webkit/browser/fileapi/recursive_operation_delegate_unittest.cc @@ -0,0 +1,280 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "webkit/browser/fileapi/recursive_operation_delegate.h" + +#include <vector> + +#include "base/basictypes.h" +#include "base/bind.h" +#include "base/callback.h" +#include "base/files/scoped_temp_dir.h" +#include "base/message_loop/message_loop.h" +#include "base/message_loop/message_loop_proxy.h" +#include "base/run_loop.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "webkit/browser/fileapi/file_system_file_util.h" +#include "webkit/browser/fileapi/file_system_operation.h" +#include "webkit/browser/fileapi/file_system_operation_runner.h" +#include "webkit/browser/fileapi/sandbox_file_system_test_helper.h" + +namespace fileapi { +namespace { + +class LoggingRecursiveOperation : public RecursiveOperationDelegate { + public: + struct LogEntry { + enum Type { + PROCESS_FILE, + PROCESS_DIRECTORY, + POST_PROCESS_DIRECTORY + }; + Type type; + FileSystemURL url; + }; + + LoggingRecursiveOperation(FileSystemContext* file_system_context, + const FileSystemURL& root, + const StatusCallback& callback) + : RecursiveOperationDelegate(file_system_context), + root_(root), + callback_(callback), + weak_factory_(this) { + } + virtual ~LoggingRecursiveOperation() {} + + const std::vector<LogEntry>& log_entries() const { return log_entries_; } + + // RecursiveOperationDelegate overrides. + virtual void Run() OVERRIDE { + NOTREACHED(); + } + + virtual void RunRecursively() OVERRIDE { + StartRecursiveOperation(root_, callback_); + } + + virtual void ProcessFile(const FileSystemURL& url, + const StatusCallback& callback) OVERRIDE { + RecordLogEntry(LogEntry::PROCESS_FILE, url); + operation_runner()->GetMetadata( + url, + base::Bind(&LoggingRecursiveOperation::DidGetMetadata, + weak_factory_.GetWeakPtr(), callback)); + } + + virtual void ProcessDirectory(const FileSystemURL& url, + const StatusCallback& callback) OVERRIDE { + RecordLogEntry(LogEntry::PROCESS_DIRECTORY, url); + callback.Run(base::PLATFORM_FILE_OK); + } + + virtual void PostProcessDirectory(const FileSystemURL& url, + const StatusCallback& callback) OVERRIDE { + RecordLogEntry(LogEntry::POST_PROCESS_DIRECTORY, url); + callback.Run(base::PLATFORM_FILE_OK); + } + + private: + void RecordLogEntry(LogEntry::Type type, const FileSystemURL& url) { + LogEntry entry; + entry.type = type; + entry.url = url; + log_entries_.push_back(entry); + } + + void DidGetMetadata(const StatusCallback& callback, + base::PlatformFileError result, + const base::PlatformFileInfo& file_info) { + if (result != base::PLATFORM_FILE_OK) { + callback.Run(result); + return; + } + + callback.Run(file_info.is_directory ? + base::PLATFORM_FILE_ERROR_NOT_A_FILE : + base::PLATFORM_FILE_OK); + } + + FileSystemURL root_; + StatusCallback callback_; + std::vector<LogEntry> log_entries_; + + base::WeakPtrFactory<LoggingRecursiveOperation> weak_factory_; + DISALLOW_COPY_AND_ASSIGN(LoggingRecursiveOperation); +}; + +void ReportStatus(base::PlatformFileError* out_error, + base::PlatformFileError error) { + DCHECK(out_error); + *out_error = error; +} + +// To test the Cancel() during operation, calls Cancel() of |operation| +// after |counter| times message posting. +void CallCancelLater(RecursiveOperationDelegate* operation, int counter) { + if (counter > 0) { + base::MessageLoopProxy::current()->PostTask( + FROM_HERE, + base::Bind(&CallCancelLater, base::Unretained(operation), counter - 1)); + return; + } + + operation->Cancel(); +} + +} // namespace + +class RecursiveOperationDelegateTest : public testing::Test { + protected: + virtual void SetUp() OVERRIDE { + EXPECT_TRUE(base_.CreateUniqueTempDir()); + sandbox_file_system_.SetUp(base_.path().AppendASCII("filesystem")); + } + + virtual void TearDown() OVERRIDE { + sandbox_file_system_.TearDown(); + } + + scoped_ptr<FileSystemOperationContext> NewContext() { + FileSystemOperationContext* context = + sandbox_file_system_.NewOperationContext(); + // Grant enough quota for all test cases. + context->set_allowed_bytes_growth(1000000); + return make_scoped_ptr(context); + } + + FileSystemFileUtil* file_util() { + return sandbox_file_system_.file_util(); + } + + FileSystemURL URLForPath(const std::string& path) const { + return sandbox_file_system_.CreateURLFromUTF8(path); + } + + FileSystemURL CreateFile(const std::string& path) { + FileSystemURL url = URLForPath(path); + bool created = false; + EXPECT_EQ(base::PLATFORM_FILE_OK, + file_util()->EnsureFileExists(NewContext().get(), + url, &created)); + EXPECT_TRUE(created); + return url; + } + + FileSystemURL CreateDirectory(const std::string& path) { + FileSystemURL url = URLForPath(path); + EXPECT_EQ(base::PLATFORM_FILE_OK, + file_util()->CreateDirectory(NewContext().get(), url, + false /* exclusive */, true)); + return url; + } + + private: + base::MessageLoop message_loop_; + + // Common temp base for nondestructive uses. + base::ScopedTempDir base_; + SandboxFileSystemTestHelper sandbox_file_system_; +}; + +TEST_F(RecursiveOperationDelegateTest, RootIsFile) { + FileSystemURL src_file(CreateFile("src")); + + base::PlatformFileError error = base::PLATFORM_FILE_ERROR_FAILED; + scoped_ptr<FileSystemOperationContext> context = NewContext(); + scoped_ptr<LoggingRecursiveOperation> operation( + new LoggingRecursiveOperation( + context->file_system_context(), src_file, + base::Bind(&ReportStatus, &error))); + operation->RunRecursively(); + base::RunLoop().RunUntilIdle(); + ASSERT_EQ(base::PLATFORM_FILE_OK, error); + + const std::vector<LoggingRecursiveOperation::LogEntry>& log_entries = + operation->log_entries(); + ASSERT_EQ(1U, log_entries.size()); + const LoggingRecursiveOperation::LogEntry& entry = log_entries[0]; + EXPECT_EQ(LoggingRecursiveOperation::LogEntry::PROCESS_FILE, entry.type); + EXPECT_EQ(src_file, entry.url); +} + +TEST_F(RecursiveOperationDelegateTest, RootIsDirectory) { + FileSystemURL src_root(CreateDirectory("src")); + FileSystemURL src_dir1(CreateDirectory("src/dir1")); + FileSystemURL src_file1(CreateFile("src/file1")); + FileSystemURL src_file2(CreateFile("src/dir1/file2")); + FileSystemURL src_file3(CreateFile("src/dir1/file3")); + + base::PlatformFileError error = base::PLATFORM_FILE_ERROR_FAILED; + scoped_ptr<FileSystemOperationContext> context = NewContext(); + scoped_ptr<LoggingRecursiveOperation> operation( + new LoggingRecursiveOperation( + context->file_system_context(), src_root, + base::Bind(&ReportStatus, &error))); + operation->RunRecursively(); + base::RunLoop().RunUntilIdle(); + ASSERT_EQ(base::PLATFORM_FILE_OK, error); + + const std::vector<LoggingRecursiveOperation::LogEntry>& log_entries = + operation->log_entries(); + ASSERT_EQ(8U, log_entries.size()); + + EXPECT_EQ(LoggingRecursiveOperation::LogEntry::PROCESS_FILE, + log_entries[0].type); + EXPECT_EQ(src_root, log_entries[0].url); + + EXPECT_EQ(LoggingRecursiveOperation::LogEntry::PROCESS_DIRECTORY, + log_entries[1].type); + EXPECT_EQ(src_root, log_entries[1].url); + + EXPECT_EQ(LoggingRecursiveOperation::LogEntry::PROCESS_FILE, + log_entries[2].type); + EXPECT_EQ(src_file1, log_entries[2].url); + + EXPECT_EQ(LoggingRecursiveOperation::LogEntry::PROCESS_DIRECTORY, + log_entries[3].type); + EXPECT_EQ(src_dir1, log_entries[3].url); + + // The order of src/dir1/file2 and src/dir1/file3 depends on the file system + // implementation (can be swapped). + EXPECT_EQ(LoggingRecursiveOperation::LogEntry::PROCESS_FILE, + log_entries[4].type); + EXPECT_EQ(LoggingRecursiveOperation::LogEntry::PROCESS_FILE, + log_entries[5].type); + EXPECT_TRUE((src_file2 == log_entries[4].url && + src_file3 == log_entries[5].url) || + (src_file3 == log_entries[4].url && + src_file2 == log_entries[5].url)); + + EXPECT_EQ(LoggingRecursiveOperation::LogEntry::POST_PROCESS_DIRECTORY, + log_entries[6].type); + EXPECT_EQ(src_dir1, log_entries[6].url); + + EXPECT_EQ(LoggingRecursiveOperation::LogEntry::POST_PROCESS_DIRECTORY, + log_entries[7].type); + EXPECT_EQ(src_root, log_entries[7].url); +} + +TEST_F(RecursiveOperationDelegateTest, Cancel) { + FileSystemURL src_root(CreateDirectory("src")); + FileSystemURL src_dir1(CreateDirectory("src/dir1")); + FileSystemURL src_file1(CreateFile("src/file1")); + FileSystemURL src_file2(CreateFile("src/dir1/file2")); + + base::PlatformFileError error = base::PLATFORM_FILE_ERROR_FAILED; + scoped_ptr<FileSystemOperationContext> context = NewContext(); + scoped_ptr<LoggingRecursiveOperation> operation( + new LoggingRecursiveOperation( + context->file_system_context(), src_root, + base::Bind(&ReportStatus, &error))); + operation->RunRecursively(); + + // Invoke Cancel(), after 5 times message posting. + CallCancelLater(operation.get(), 5); + base::RunLoop().RunUntilIdle(); + ASSERT_EQ(base::PLATFORM_FILE_ERROR_ABORT, error); +} + +} // namespace fileapi diff --git a/chromium/webkit/browser/fileapi/remove_operation_delegate.cc b/chromium/webkit/browser/fileapi/remove_operation_delegate.cc index fcd9ba9cee2..4819f0164e5 100644 --- a/chromium/webkit/browser/fileapi/remove_operation_delegate.cc +++ b/chromium/webkit/browser/fileapi/remove_operation_delegate.cc @@ -28,38 +28,47 @@ void RemoveOperationDelegate::Run() { } void RemoveOperationDelegate::RunRecursively() { - StartRecursiveOperation( - url_, - base::Bind(&RemoveOperationDelegate::RemoveNextDirectory, - weak_factory_.GetWeakPtr())); + StartRecursiveOperation(url_, callback_); } void RemoveOperationDelegate::ProcessFile(const FileSystemURL& url, const StatusCallback& callback) { - if (to_remove_directories_.size() == 1u && - to_remove_directories_.top() == url) { - // We seem to have been re-directed from ProcessDirectory. - to_remove_directories_.pop(); - } - operation_runner()->RemoveFile(url, base::Bind( - &RemoveOperationDelegate::DidRemoveFile, - weak_factory_.GetWeakPtr(), callback)); + operation_runner()->RemoveFile( + url, + base::Bind(&RemoveOperationDelegate::DidRemoveFile, + weak_factory_.GetWeakPtr(), callback)); } void RemoveOperationDelegate::ProcessDirectory(const FileSystemURL& url, const StatusCallback& callback) { - to_remove_directories_.push(url); callback.Run(base::PLATFORM_FILE_OK); } +void RemoveOperationDelegate::PostProcessDirectory( + const FileSystemURL& url, const StatusCallback& callback) { + operation_runner()->RemoveDirectory(url, callback); +} + void RemoveOperationDelegate::DidTryRemoveFile( base::PlatformFileError error) { - if (error == base::PLATFORM_FILE_OK || - error != base::PLATFORM_FILE_ERROR_NOT_A_FILE) { + if (error != base::PLATFORM_FILE_ERROR_NOT_A_FILE && + error != base::PLATFORM_FILE_ERROR_SECURITY) { callback_.Run(error); return; } - operation_runner()->RemoveDirectory(url_, callback_); + operation_runner()->RemoveDirectory( + url_, + base::Bind(&RemoveOperationDelegate::DidTryRemoveDirectory, + weak_factory_.GetWeakPtr(), error)); +} + +void RemoveOperationDelegate::DidTryRemoveDirectory( + base::PlatformFileError remove_file_error, + base::PlatformFileError remove_directory_error) { + callback_.Run( + remove_directory_error == base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY ? + remove_file_error : + remove_directory_error); } void RemoveOperationDelegate::DidRemoveFile(const StatusCallback& callback, @@ -71,18 +80,4 @@ void RemoveOperationDelegate::DidRemoveFile(const StatusCallback& callback, callback.Run(error); } -void RemoveOperationDelegate::RemoveNextDirectory( - base::PlatformFileError error) { - if (error != base::PLATFORM_FILE_OK || - to_remove_directories_.empty()) { - callback_.Run(error); - return; - } - FileSystemURL url = to_remove_directories_.top(); - to_remove_directories_.pop(); - operation_runner()->RemoveDirectory(url, base::Bind( - &RemoveOperationDelegate::RemoveNextDirectory, - weak_factory_.GetWeakPtr())); -} - } // namespace fileapi diff --git a/chromium/webkit/browser/fileapi/remove_operation_delegate.h b/chromium/webkit/browser/fileapi/remove_operation_delegate.h index ef9e1a09409..22d25cb9833 100644 --- a/chromium/webkit/browser/fileapi/remove_operation_delegate.h +++ b/chromium/webkit/browser/fileapi/remove_operation_delegate.h @@ -11,8 +11,7 @@ namespace fileapi { -class RemoveOperationDelegate - : public RecursiveOperationDelegate { +class RemoveOperationDelegate : public RecursiveOperationDelegate { public: RemoveOperationDelegate(FileSystemContext* file_system_context, const FileSystemURL& url, @@ -26,20 +25,19 @@ class RemoveOperationDelegate const StatusCallback& callback) OVERRIDE; virtual void ProcessDirectory(const FileSystemURL& url, const StatusCallback& callback) OVERRIDE; + virtual void PostProcessDirectory(const FileSystemURL& url, + const StatusCallback& callback) OVERRIDE; private: void DidTryRemoveFile(base::PlatformFileError error); + void DidTryRemoveDirectory(base::PlatformFileError remove_file_error, + base::PlatformFileError remove_directory_error); void DidRemoveFile(const StatusCallback& callback, base::PlatformFileError error); - void RemoveNextDirectory(base::PlatformFileError error); FileSystemURL url_; StatusCallback callback_; - - std::stack<FileSystemURL> to_remove_directories_; - base::WeakPtrFactory<RemoveOperationDelegate> weak_factory_; - DISALLOW_COPY_AND_ASSIGN(RemoveOperationDelegate); }; diff --git a/chromium/webkit/browser/fileapi/sandbox_directory_database.cc b/chromium/webkit/browser/fileapi/sandbox_directory_database.cc index 8a90bd33479..06ab1e50acf 100644 --- a/chromium/webkit/browser/fileapi/sandbox_directory_database.cc +++ b/chromium/webkit/browser/fileapi/sandbox_directory_database.cc @@ -518,10 +518,10 @@ bool SandboxDirectoryDatabase::GetFileInfo(FileId file_id, FileInfo* info) { return false; } -bool SandboxDirectoryDatabase::AddFileInfo( +base::PlatformFileError SandboxDirectoryDatabase::AddFileInfo( const FileInfo& info, FileId* file_id) { if (!Init(REPAIR_ON_CORRUPTION)) - return false; + return base::PLATFORM_FILE_ERROR_FAILED; DCHECK(file_id); std::string child_key = GetChildLookupKey(info.parent_id, info.name); std::string child_id_string; @@ -529,36 +529,36 @@ bool SandboxDirectoryDatabase::AddFileInfo( db_->Get(leveldb::ReadOptions(), child_key, &child_id_string); if (status.ok()) { LOG(ERROR) << "File exists already!"; - return false; + return base::PLATFORM_FILE_ERROR_EXISTS; } if (!status.IsNotFound()) { HandleError(FROM_HERE, status); - return false; + return base::PLATFORM_FILE_ERROR_NOT_FOUND; } if (!VerifyIsDirectory(info.parent_id)) - return false; + return base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY; // This would be a fine place to limit the number of files in a directory, if // we decide to add that restriction. FileId temp_id; if (!GetLastFileId(&temp_id)) - return false; + return base::PLATFORM_FILE_ERROR_FAILED; ++temp_id; leveldb::WriteBatch batch; if (!AddFileInfoHelper(info, temp_id, &batch)) - return false; + return base::PLATFORM_FILE_ERROR_FAILED; batch.Put(LastFileIdKey(), base::Int64ToString(temp_id)); status = db_->Write(leveldb::WriteOptions(), &batch); if (!status.ok()) { HandleError(FROM_HERE, status); - return false; + return base::PLATFORM_FILE_ERROR_FAILED; } *file_id = temp_id; - return true; + return base::PLATFORM_FILE_OK; } bool SandboxDirectoryDatabase::RemoveFileInfo(FileId file_id) { @@ -715,7 +715,7 @@ bool SandboxDirectoryDatabase::Init(RecoveryOption recovery_option) { FilePathToString(filesystem_data_directory_.Append( kDirectoryDatabaseName)); leveldb::Options options; - options.max_open_files = 64; // Use minimum. + options.max_open_files = 0; // Use minimum. options.create_if_missing = true; leveldb::DB* db; leveldb::Status status = leveldb::DB::Open(options, path, &db); @@ -763,7 +763,7 @@ bool SandboxDirectoryDatabase::Init(RecoveryOption recovery_option) { bool SandboxDirectoryDatabase::RepairDatabase(const std::string& db_path) { DCHECK(!db_.get()); leveldb::Options options; - options.max_open_files = 64; // Use minimum. + options.max_open_files = 0; // Use minimum. if (!leveldb::RepairDB(db_path, options).ok()) return false; if (!Init(FAIL_ON_CORRUPTION)) diff --git a/chromium/webkit/browser/fileapi/sandbox_directory_database.h b/chromium/webkit/browser/fileapi/sandbox_directory_database.h index 4cbd43b6cbd..0ad948d630f 100644 --- a/chromium/webkit/browser/fileapi/sandbox_directory_database.h +++ b/chromium/webkit/browser/fileapi/sandbox_directory_database.h @@ -10,6 +10,7 @@ #include "base/files/file_path.h" #include "base/memory/scoped_ptr.h" +#include "base/platform_file.h" #include "base/time/time.h" #include "webkit/browser/webkit_storage_browser_export.h" @@ -68,7 +69,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE SandboxDirectoryDatabase { // exist. bool ListChildren(FileId parent_id, std::vector<FileId>* children); bool GetFileInfo(FileId file_id, FileInfo* info); - bool AddFileInfo(const FileInfo& info, FileId* file_id); + base::PlatformFileError AddFileInfo(const FileInfo& info, FileId* file_id); bool RemoveFileInfo(FileId file_id); // This does a full update of the FileInfo, and is what you'd use for moves // and renames. If you just want to update the modification_time, use diff --git a/chromium/webkit/browser/fileapi/sandbox_directory_database_unittest.cc b/chromium/webkit/browser/fileapi/sandbox_directory_database_unittest.cc index 593ead96efb..9281446e2fd 100644 --- a/chromium/webkit/browser/fileapi/sandbox_directory_database_unittest.cc +++ b/chromium/webkit/browser/fileapi/sandbox_directory_database_unittest.cc @@ -51,7 +51,8 @@ class SandboxDirectoryDatabaseTest : public testing::Test { db_.reset(); } - bool AddFileInfo(FileId parent_id, const base::FilePath::StringType& name) { + base::PlatformFileError AddFileInfo( + FileId parent_id, const base::FilePath::StringType& name) { FileId file_id; FileInfo info; info.parent_id = parent_id; @@ -65,7 +66,7 @@ class SandboxDirectoryDatabaseTest : public testing::Test { FileInfo info; info.parent_id = parent_id; info.name = name; - ASSERT_TRUE(db_->AddFileInfo(info, file_id_out)); + ASSERT_EQ(base::PLATFORM_FILE_OK, db_->AddFileInfo(info, file_id_out)); } void CreateFile(FileId parent_id, @@ -78,7 +79,7 @@ class SandboxDirectoryDatabaseTest : public testing::Test { info.parent_id = parent_id; info.name = name; info.data_path = base::FilePath(data_path).NormalizePathSeparators(); - ASSERT_TRUE(db_->AddFileInfo(info, &file_id)); + ASSERT_EQ(base::PLATFORM_FILE_OK, db_->AddFileInfo(info, &file_id)); base::FilePath local_path = path().Append(data_path); if (!base::DirectoryExists(local_path.DirName())) @@ -160,7 +161,8 @@ TEST_F(SandboxDirectoryDatabaseTest, TestGetRootFileInfoBeforeCreate) { TEST_F(SandboxDirectoryDatabaseTest, TestMissingParentAddFileInfo) { FileId parent_id = 7; - EXPECT_FALSE(AddFileInfo(parent_id, FILE_PATH_LITERAL("foo"))); + EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY, + AddFileInfo(parent_id, FILE_PATH_LITERAL("foo"))); } TEST_F(SandboxDirectoryDatabaseTest, TestAddNameClash) { @@ -168,21 +170,21 @@ TEST_F(SandboxDirectoryDatabaseTest, TestAddNameClash) { FileId file_id; info.parent_id = 0; info.name = FILE_PATH_LITERAL("dir 0"); - EXPECT_TRUE(db()->AddFileInfo(info, &file_id)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info, &file_id)); // Check for name clash in the root directory. base::FilePath::StringType name = info.name; - EXPECT_FALSE(AddFileInfo(0, name)); + EXPECT_EQ(base::PLATFORM_FILE_ERROR_EXISTS, AddFileInfo(0, name)); name = FILE_PATH_LITERAL("dir 1"); - EXPECT_TRUE(AddFileInfo(0, name)); + EXPECT_EQ(base::PLATFORM_FILE_OK, AddFileInfo(0, name)); name = FILE_PATH_LITERAL("subdir 0"); - EXPECT_TRUE(AddFileInfo(file_id, name)); + EXPECT_EQ(base::PLATFORM_FILE_OK, AddFileInfo(file_id, name)); // Check for name clash in a subdirectory. - EXPECT_FALSE(AddFileInfo(file_id, name)); + EXPECT_EQ(base::PLATFORM_FILE_ERROR_EXISTS, AddFileInfo(file_id, name)); name = FILE_PATH_LITERAL("subdir 1"); - EXPECT_TRUE(AddFileInfo(file_id, name)); + EXPECT_EQ(base::PLATFORM_FILE_OK, AddFileInfo(file_id, name)); } TEST_F(SandboxDirectoryDatabaseTest, TestRenameNoMoveNameClash) { @@ -193,8 +195,8 @@ TEST_F(SandboxDirectoryDatabaseTest, TestRenameNoMoveNameClash) { base::FilePath::StringType name2 = FILE_PATH_LITERAL("bas"); info.parent_id = 0; info.name = name0; - EXPECT_TRUE(db()->AddFileInfo(info, &file_id0)); - EXPECT_TRUE(AddFileInfo(0, name1)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info, &file_id0)); + EXPECT_EQ(base::PLATFORM_FILE_OK, AddFileInfo(0, name1)); info.name = name1; EXPECT_FALSE(db()->UpdateFileInfo(file_id0, info)); info.name = name2; @@ -209,9 +211,9 @@ TEST_F(SandboxDirectoryDatabaseTest, TestMoveSameNameNameClash) { base::FilePath::StringType name1 = FILE_PATH_LITERAL("bar"); info.parent_id = 0; info.name = name0; - EXPECT_TRUE(db()->AddFileInfo(info, &file_id0)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info, &file_id0)); info.parent_id = file_id0; - EXPECT_TRUE(db()->AddFileInfo(info, &file_id1)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info, &file_id1)); info.parent_id = 0; EXPECT_FALSE(db()->UpdateFileInfo(file_id1, info)); info.name = name1; @@ -227,10 +229,10 @@ TEST_F(SandboxDirectoryDatabaseTest, TestMoveRenameNameClash) { base::FilePath::StringType name2 = FILE_PATH_LITERAL("bas"); info.parent_id = 0; info.name = name0; - EXPECT_TRUE(db()->AddFileInfo(info, &file_id0)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info, &file_id0)); info.parent_id = file_id0; info.name = name1; - EXPECT_TRUE(db()->AddFileInfo(info, &file_id1)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info, &file_id1)); info.parent_id = 0; info.name = name0; EXPECT_FALSE(db()->UpdateFileInfo(file_id1, info)); @@ -248,9 +250,9 @@ TEST_F(SandboxDirectoryDatabaseTest, TestRemoveWithChildren) { FileId file_id1; info.parent_id = 0; info.name = FILE_PATH_LITERAL("foo"); - EXPECT_TRUE(db()->AddFileInfo(info, &file_id0)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info, &file_id0)); info.parent_id = file_id0; - EXPECT_TRUE(db()->AddFileInfo(info, &file_id1)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info, &file_id1)); EXPECT_FALSE(db()->RemoveFileInfo(file_id0)); EXPECT_TRUE(db()->RemoveFileInfo(file_id1)); EXPECT_TRUE(db()->RemoveFileInfo(file_id0)); @@ -264,10 +266,10 @@ TEST_F(SandboxDirectoryDatabaseTest, TestGetChildWithName) { base::FilePath::StringType name1 = FILE_PATH_LITERAL("bar"); info.parent_id = 0; info.name = name0; - EXPECT_TRUE(db()->AddFileInfo(info, &file_id0)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info, &file_id0)); info.parent_id = file_id0; info.name = name1; - EXPECT_TRUE(db()->AddFileInfo(info, &file_id1)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info, &file_id1)); EXPECT_NE(file_id0, file_id1); FileId check_file_id; @@ -290,14 +292,14 @@ TEST_F(SandboxDirectoryDatabaseTest, TestGetFileWithPath) { info.parent_id = 0; info.name = name0; - EXPECT_TRUE(db()->AddFileInfo(info, &file_id0)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info, &file_id0)); info.parent_id = file_id0; info.name = name1; - EXPECT_TRUE(db()->AddFileInfo(info, &file_id1)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info, &file_id1)); EXPECT_NE(file_id0, file_id1); info.parent_id = file_id1; info.name = name2; - EXPECT_TRUE(db()->AddFileInfo(info, &file_id2)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info, &file_id2)); EXPECT_NE(file_id0, file_id2); EXPECT_NE(file_id1, file_id2); @@ -326,7 +328,7 @@ TEST_F(SandboxDirectoryDatabaseTest, TestListChildren) { FileInfo info; info.parent_id = 0; info.name = FILE_PATH_LITERAL("foo"); - EXPECT_TRUE(db()->AddFileInfo(info, &file_id0)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info, &file_id0)); EXPECT_TRUE(db()->ListChildren(0, &children)); EXPECT_EQ(children.size(), 1UL); EXPECT_EQ(children[0], file_id0); @@ -334,7 +336,7 @@ TEST_F(SandboxDirectoryDatabaseTest, TestListChildren) { // Two children in the root. FileId file_id1; info.name = FILE_PATH_LITERAL("bar"); - EXPECT_TRUE(db()->AddFileInfo(info, &file_id1)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info, &file_id1)); EXPECT_TRUE(db()->ListChildren(0, &children)); EXPECT_EQ(2UL, children.size()); if (children[0] == file_id0) { @@ -353,14 +355,14 @@ TEST_F(SandboxDirectoryDatabaseTest, TestListChildren) { info.name = FILE_PATH_LITERAL("foo"); FileId file_id2; FileId file_id3; - EXPECT_TRUE(db()->AddFileInfo(info, &file_id2)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info, &file_id2)); EXPECT_TRUE(db()->ListChildren(file_id0, &children)); EXPECT_EQ(1UL, children.size()); EXPECT_EQ(children[0], file_id2); // Two children in a subdirectory. info.name = FILE_PATH_LITERAL("bar"); - EXPECT_TRUE(db()->AddFileInfo(info, &file_id3)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info, &file_id3)); EXPECT_TRUE(db()->ListChildren(file_id0, &children)); EXPECT_EQ(2UL, children.size()); if (children[0] == file_id2) { @@ -378,7 +380,7 @@ TEST_F(SandboxDirectoryDatabaseTest, TestUpdateModificationTime) { info0.name = FILE_PATH_LITERAL("name"); info0.data_path = base::FilePath(FILE_PATH_LITERAL("fake path")); info0.modification_time = base::Time::Now(); - EXPECT_TRUE(db()->AddFileInfo(info0, &file_id)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info0, &file_id)); FileInfo info1; EXPECT_TRUE(db()->GetFileInfo(file_id, &info1)); EXPECT_EQ(info0.name, info1.name); @@ -409,7 +411,7 @@ TEST_F(SandboxDirectoryDatabaseTest, TestSimpleFileOperations) { info0.data_path = base::FilePath(FILE_PATH_LITERAL("foo")); info0.name = FILE_PATH_LITERAL("file name"); info0.modification_time = base::Time::Now(); - EXPECT_TRUE(db()->AddFileInfo(info0, &file_id)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info0, &file_id)); FileInfo info1; EXPECT_TRUE(db()->GetFileInfo(file_id, &info1)); EXPECT_EQ(info0.parent_id, info1.parent_id); @@ -426,7 +428,7 @@ TEST_F(SandboxDirectoryDatabaseTest, TestOverwritingMoveFileSrcDirectory) { info0.parent_id = 0; info0.name = FILE_PATH_LITERAL("directory"); info0.modification_time = base::Time::Now(); - EXPECT_TRUE(db()->AddFileInfo(info0, &directory_id)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info0, &directory_id)); FileId file_id; FileInfo info1; @@ -434,7 +436,7 @@ TEST_F(SandboxDirectoryDatabaseTest, TestOverwritingMoveFileSrcDirectory) { info1.data_path = base::FilePath(FILE_PATH_LITERAL("bar")); info1.name = FILE_PATH_LITERAL("file"); info1.modification_time = base::Time::UnixEpoch(); - EXPECT_TRUE(db()->AddFileInfo(info1, &file_id)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info1, &file_id)); EXPECT_FALSE(db()->OverwritingMoveFile(directory_id, file_id)); } @@ -446,14 +448,14 @@ TEST_F(SandboxDirectoryDatabaseTest, TestOverwritingMoveFileDestDirectory) { info0.name = FILE_PATH_LITERAL("file"); info0.data_path = base::FilePath(FILE_PATH_LITERAL("bar")); info0.modification_time = base::Time::Now(); - EXPECT_TRUE(db()->AddFileInfo(info0, &file_id)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info0, &file_id)); FileId directory_id; FileInfo info1; info1.parent_id = 0; info1.name = FILE_PATH_LITERAL("directory"); info1.modification_time = base::Time::UnixEpoch(); - EXPECT_TRUE(db()->AddFileInfo(info1, &directory_id)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info1, &directory_id)); EXPECT_FALSE(db()->OverwritingMoveFile(file_id, directory_id)); } @@ -465,13 +467,13 @@ TEST_F(SandboxDirectoryDatabaseTest, TestOverwritingMoveFileSuccess) { info0.data_path = base::FilePath(FILE_PATH_LITERAL("foo")); info0.name = FILE_PATH_LITERAL("file name 0"); info0.modification_time = base::Time::Now(); - EXPECT_TRUE(db()->AddFileInfo(info0, &file_id0)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info0, &file_id0)); FileInfo dir_info; FileId dir_id; dir_info.parent_id = 0; dir_info.name = FILE_PATH_LITERAL("directory name"); - EXPECT_TRUE(db()->AddFileInfo(dir_info, &dir_id)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(dir_info, &dir_id)); FileId file_id1; FileInfo info1; @@ -479,7 +481,7 @@ TEST_F(SandboxDirectoryDatabaseTest, TestOverwritingMoveFileSuccess) { info1.data_path = base::FilePath(FILE_PATH_LITERAL("bar")); info1.name = FILE_PATH_LITERAL("file name 1"); info1.modification_time = base::Time::UnixEpoch(); - EXPECT_TRUE(db()->AddFileInfo(info1, &file_id1)); + EXPECT_EQ(base::PLATFORM_FILE_OK, db()->AddFileInfo(info1, &file_id1)); EXPECT_TRUE(db()->OverwritingMoveFile(file_id0, file_id1)); diff --git a/chromium/webkit/browser/fileapi/sandbox_file_stream_writer.cc b/chromium/webkit/browser/fileapi/sandbox_file_stream_writer.cc index 2e075ce39fe..24fe1c947b1 100644 --- a/chromium/webkit/browser/fileapi/sandbox_file_stream_writer.cc +++ b/chromium/webkit/browser/fileapi/sandbox_file_stream_writer.cc @@ -9,11 +9,11 @@ #include "base/sequenced_task_runner.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" -#include "webkit/browser/blob/local_file_stream_reader.h" +#include "webkit/browser/blob/file_stream_reader.h" #include "webkit/browser/fileapi/file_observers.h" +#include "webkit/browser/fileapi/file_stream_writer.h" #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_operation_runner.h" -#include "webkit/browser/fileapi/local_file_stream_writer.h" #include "webkit/browser/quota/quota_manager.h" #include "webkit/common/fileapi/file_system_util.h" @@ -137,7 +137,7 @@ void SandboxFileStreamWriter::DidCreateSnapshotFile( initial_offset_ = file_size_; } DCHECK(!local_file_writer_.get()); - local_file_writer_.reset(new LocalFileStreamWriter( + local_file_writer_.reset(FileStreamWriter::CreateForLocalFile( file_system_context_->default_file_task_runner(), platform_path, initial_offset_)); diff --git a/chromium/webkit/browser/fileapi/sandbox_file_stream_writer.h b/chromium/webkit/browser/fileapi/sandbox_file_stream_writer.h index 43fb0cd7743..81123376f50 100644 --- a/chromium/webkit/browser/fileapi/sandbox_file_stream_writer.h +++ b/chromium/webkit/browser/fileapi/sandbox_file_stream_writer.h @@ -21,10 +21,10 @@ namespace fileapi { class FileSystemContext; class FileSystemQuotaUtil; -class LocalFileStreamWriter; +class FileStreamWriter; class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE SandboxFileStreamWriter - : public FileStreamWriter { + : public NON_EXPORTED_BASE(FileStreamWriter) { public: SandboxFileStreamWriter(FileSystemContext* file_system_context, const FileSystemURL& url, @@ -72,7 +72,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE SandboxFileStreamWriter scoped_refptr<FileSystemContext> file_system_context_; FileSystemURL url_; int64 initial_offset_; - scoped_ptr<LocalFileStreamWriter> local_file_writer_; + scoped_ptr<FileStreamWriter> local_file_writer_; net::CompletionCallback cancel_callback_; UpdateObserverList observers_; diff --git a/chromium/webkit/browser/fileapi/sandbox_file_system_backend.cc b/chromium/webkit/browser/fileapi/sandbox_file_system_backend.cc index 20f732989d4..a5adc63e85d 100644 --- a/chromium/webkit/browser/fileapi/sandbox_file_system_backend.cc +++ b/chromium/webkit/browser/fileapi/sandbox_file_system_backend.cc @@ -10,17 +10,17 @@ #include "base/metrics/histogram.h" #include "base/task_runner_util.h" #include "url/gurl.h" +#include "webkit/browser/blob/file_stream_reader.h" #include "webkit/browser/fileapi/async_file_util_adapter.h" #include "webkit/browser/fileapi/copy_or_move_file_validator.h" +#include "webkit/browser/fileapi/file_stream_writer.h" #include "webkit/browser/fileapi/file_system_context.h" -#include "webkit/browser/fileapi/file_system_file_stream_reader.h" +#include "webkit/browser/fileapi/file_system_operation.h" #include "webkit/browser/fileapi/file_system_operation_context.h" -#include "webkit/browser/fileapi/file_system_operation_impl.h" #include "webkit/browser/fileapi/file_system_options.h" #include "webkit/browser/fileapi/file_system_usage_cache.h" #include "webkit/browser/fileapi/obfuscated_file_util.h" -#include "webkit/browser/fileapi/sandbox_context.h" -#include "webkit/browser/fileapi/sandbox_file_stream_writer.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend_delegate.h" #include "webkit/browser/fileapi/sandbox_quota_observer.h" #include "webkit/browser/quota/quota_manager.h" #include "webkit/common/fileapi/file_system_types.h" @@ -31,16 +31,9 @@ using quota::SpecialStoragePolicy; namespace fileapi { -namespace { - -const char kTemporaryOriginsCountLabel[] = "FileSystem.TemporaryOriginsCount"; -const char kPersistentOriginsCountLabel[] = "FileSystem.PersistentOriginsCount"; - -} // anonymous namespace - SandboxFileSystemBackend::SandboxFileSystemBackend( - SandboxContext* sandbox_context) - : sandbox_context_(sandbox_context), + SandboxFileSystemBackendDelegate* delegate) + : delegate_(delegate), enable_temporary_file_system_in_incognito_(false) { } @@ -53,12 +46,24 @@ bool SandboxFileSystemBackend::CanHandleType(FileSystemType type) const { } void SandboxFileSystemBackend::Initialize(FileSystemContext* context) { + DCHECK(delegate_); + // Set quota observers. - update_observers_ = update_observers_.AddObserver( - sandbox_context_->quota_observer(), - sandbox_context_->file_task_runner()); - access_observers_ = access_observers_.AddObserver( - sandbox_context_->quota_observer(), NULL); + delegate_->AddFileUpdateObserver( + fileapi::kFileSystemTypeTemporary, + delegate_->quota_observer(), + delegate_->file_task_runner()); + delegate_->AddFileAccessObserver( + fileapi::kFileSystemTypeTemporary, + delegate_->quota_observer(), NULL); + + delegate_->AddFileUpdateObserver( + fileapi::kFileSystemTypePersistent, + delegate_->quota_observer(), + delegate_->file_task_runner()); + delegate_->AddFileAccessObserver( + fileapi::kFileSystemTypePersistent, + delegate_->quota_observer(), NULL); } void SandboxFileSystemBackend::OpenFileSystem( @@ -67,8 +72,8 @@ void SandboxFileSystemBackend::OpenFileSystem( OpenFileSystemMode mode, const OpenFileSystemCallback& callback) { DCHECK(CanHandleType(type)); - DCHECK(sandbox_context_); - if (sandbox_context_->file_system_options().is_incognito() && + DCHECK(delegate_); + if (delegate_->file_system_options().is_incognito() && !(type == kFileSystemTypeTemporary && enable_temporary_file_system_in_incognito_)) { // TODO(kinuko): return an isolated temporary directory. @@ -76,20 +81,15 @@ void SandboxFileSystemBackend::OpenFileSystem( return; } - sandbox_context_->OpenFileSystem( + delegate_->OpenFileSystem( origin_url, type, mode, callback, GetFileSystemRootURI(origin_url, type)); } -FileSystemFileUtil* SandboxFileSystemBackend::GetFileUtil( - FileSystemType type) { - return sandbox_context_->sync_file_util(); -} - AsyncFileUtil* SandboxFileSystemBackend::GetAsyncFileUtil( FileSystemType type) { - DCHECK(sandbox_context_); - return sandbox_context_->file_util(); + DCHECK(delegate_); + return delegate_->file_util(); } CopyOrMoveFileValidatorFactory* @@ -106,24 +106,21 @@ FileSystemOperation* SandboxFileSystemBackend::CreateFileSystemOperation( FileSystemContext* context, base::PlatformFileError* error_code) const { DCHECK(CanHandleType(url.type())); - DCHECK(sandbox_context_); - if (!sandbox_context_->IsAccessValid(url)) { - *error_code = base::PLATFORM_FILE_ERROR_SECURITY; - return NULL; - } + DCHECK(error_code); - scoped_ptr<FileSystemOperationContext> operation_context( - new FileSystemOperationContext(context)); - operation_context->set_update_observers(update_observers_); - operation_context->set_change_observers(change_observers_); + DCHECK(delegate_); + scoped_ptr<FileSystemOperationContext> operation_context = + delegate_->CreateFileSystemOperationContext(url, context, error_code); + if (!operation_context) + return NULL; - SpecialStoragePolicy* policy = sandbox_context_->special_storage_policy(); + SpecialStoragePolicy* policy = delegate_->special_storage_policy(); if (policy && policy->IsStorageUnlimited(url.origin())) operation_context->set_quota_limit_type(quota::kQuotaLimitTypeUnlimited); else operation_context->set_quota_limit_type(quota::kQuotaLimitTypeLimited); - return new FileSystemOperationImpl(url, context, operation_context.Pass()); + return FileSystemOperation::Create(url, context, operation_context.Pass()); } scoped_ptr<webkit_blob::FileStreamReader> @@ -133,12 +130,9 @@ SandboxFileSystemBackend::CreateFileStreamReader( const base::Time& expected_modification_time, FileSystemContext* context) const { DCHECK(CanHandleType(url.type())); - DCHECK(sandbox_context_); - if (!sandbox_context_->IsAccessValid(url)) - return scoped_ptr<webkit_blob::FileStreamReader>(); - return scoped_ptr<webkit_blob::FileStreamReader>( - new FileSystemFileStreamReader( - context, url, offset, expected_modification_time)); + DCHECK(delegate_); + return delegate_->CreateFileStreamReader( + url, offset, expected_modification_time, context); } scoped_ptr<fileapi::FileStreamWriter> @@ -147,128 +141,18 @@ SandboxFileSystemBackend::CreateFileStreamWriter( int64 offset, FileSystemContext* context) const { DCHECK(CanHandleType(url.type())); - DCHECK(sandbox_context_); - if (!sandbox_context_->IsAccessValid(url)) - return scoped_ptr<fileapi::FileStreamWriter>(); - return scoped_ptr<fileapi::FileStreamWriter>( - new SandboxFileStreamWriter(context, url, offset, update_observers_)); + DCHECK(delegate_); + return delegate_->CreateFileStreamWriter(url, offset, context, url.type()); } FileSystemQuotaUtil* SandboxFileSystemBackend::GetQuotaUtil() { - return this; + return delegate_; } -SandboxContext::OriginEnumerator* +SandboxFileSystemBackendDelegate::OriginEnumerator* SandboxFileSystemBackend::CreateOriginEnumerator() { - DCHECK(sandbox_context_); - return sandbox_context_->CreateOriginEnumerator(); -} - -base::PlatformFileError -SandboxFileSystemBackend::DeleteOriginDataOnFileThread( - FileSystemContext* file_system_context, - QuotaManagerProxy* proxy, - const GURL& origin_url, - fileapi::FileSystemType type) { - DCHECK(CanHandleType(type)); - DCHECK(sandbox_context_); - return sandbox_context_->DeleteOriginDataOnFileThread( - file_system_context, proxy, origin_url, type); -} - -void SandboxFileSystemBackend::GetOriginsForTypeOnFileThread( - fileapi::FileSystemType type, std::set<GURL>* origins) { - DCHECK(CanHandleType(type)); - DCHECK(sandbox_context_); - sandbox_context_->GetOriginsForTypeOnFileThread(type, origins); - switch (type) { - case kFileSystemTypeTemporary: - UMA_HISTOGRAM_COUNTS(kTemporaryOriginsCountLabel, origins->size()); - break; - case kFileSystemTypePersistent: - UMA_HISTOGRAM_COUNTS(kPersistentOriginsCountLabel, origins->size()); - break; - default: - break; - } -} - -void SandboxFileSystemBackend::GetOriginsForHostOnFileThread( - fileapi::FileSystemType type, const std::string& host, - std::set<GURL>* origins) { - DCHECK(CanHandleType(type)); - DCHECK(sandbox_context_); - sandbox_context_->GetOriginsForHostOnFileThread(type, host, origins); -} - -int64 SandboxFileSystemBackend::GetOriginUsageOnFileThread( - FileSystemContext* file_system_context, - const GURL& origin_url, - fileapi::FileSystemType type) { - DCHECK(CanHandleType(type)); - DCHECK(sandbox_context_); - return sandbox_context_->GetOriginUsageOnFileThread( - file_system_context, origin_url, type); -} - -void SandboxFileSystemBackend::InvalidateUsageCache( - const GURL& origin, - fileapi::FileSystemType type) { - DCHECK(CanHandleType(type)); - DCHECK(sandbox_context_); - sandbox_context_->InvalidateUsageCache(origin, type); -} - -void SandboxFileSystemBackend::StickyInvalidateUsageCache( - const GURL& origin, - fileapi::FileSystemType type) { - DCHECK(CanHandleType(type)); - DCHECK(sandbox_context_); - sandbox_context_->StickyInvalidateUsageCache(origin, type); -} - -void SandboxFileSystemBackend::AddFileUpdateObserver( - FileSystemType type, - FileUpdateObserver* observer, - base::SequencedTaskRunner* task_runner) { - DCHECK(CanHandleType(type)); - UpdateObserverList* list = &update_observers_; - *list = list->AddObserver(observer, task_runner); -} - -void SandboxFileSystemBackend::AddFileChangeObserver( - FileSystemType type, - FileChangeObserver* observer, - base::SequencedTaskRunner* task_runner) { - DCHECK(CanHandleType(type)); - ChangeObserverList* list = &change_observers_; - *list = list->AddObserver(observer, task_runner); -} - -void SandboxFileSystemBackend::AddFileAccessObserver( - FileSystemType type, - FileAccessObserver* observer, - base::SequencedTaskRunner* task_runner) { - DCHECK(CanHandleType(type)); - access_observers_ = access_observers_.AddObserver(observer, task_runner); -} - -const UpdateObserverList* SandboxFileSystemBackend::GetUpdateObservers( - FileSystemType type) const { - DCHECK(CanHandleType(type)); - return &update_observers_; -} - -const ChangeObserverList* SandboxFileSystemBackend::GetChangeObservers( - FileSystemType type) const { - DCHECK(CanHandleType(type)); - return &change_observers_; -} - -const AccessObserverList* SandboxFileSystemBackend::GetAccessObservers( - FileSystemType type) const { - DCHECK(CanHandleType(type)); - return &access_observers_; + DCHECK(delegate_); + return delegate_->CreateOriginEnumerator(); } } // namespace fileapi diff --git a/chromium/webkit/browser/fileapi/sandbox_file_system_backend.h b/chromium/webkit/browser/fileapi/sandbox_file_system_backend.h index 3e7ff60b529..8531cf862bf 100644 --- a/chromium/webkit/browser/fileapi/sandbox_file_system_backend.h +++ b/chromium/webkit/browser/fileapi/sandbox_file_system_backend.h @@ -14,7 +14,7 @@ #include "base/memory/scoped_ptr.h" #include "webkit/browser/fileapi/file_system_backend.h" #include "webkit/browser/fileapi/file_system_quota_util.h" -#include "webkit/browser/fileapi/sandbox_context.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend_delegate.h" #include "webkit/browser/fileapi/task_runner_bound_observer_list.h" #include "webkit/browser/quota/special_storage_policy.h" #include "webkit/browser/webkit_storage_browser_export.h" @@ -27,10 +27,9 @@ namespace fileapi { // This interface also lets one enumerate and remove storage for the origins // that use the filesystem. class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackend - : public FileSystemBackend, - public FileSystemQuotaUtil { + : public FileSystemBackend { public: - explicit SandboxFileSystemBackend(SandboxContext* sandbox_context); + explicit SandboxFileSystemBackend(SandboxFileSystemBackendDelegate* delegate); virtual ~SandboxFileSystemBackend(); // FileSystemBackend overrides. @@ -41,7 +40,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackend FileSystemType type, OpenFileSystemMode mode, const OpenFileSystemCallback& callback) OVERRIDE; - virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) OVERRIDE; virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) OVERRIDE; virtual CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory( FileSystemType type, @@ -63,64 +61,21 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackend // Returns an origin enumerator of this backend. // This method can only be called on the file thread. - SandboxContext::OriginEnumerator* CreateOriginEnumerator(); - - // FileSystemQuotaUtil overrides. - virtual base::PlatformFileError DeleteOriginDataOnFileThread( - FileSystemContext* context, - quota::QuotaManagerProxy* proxy, - const GURL& origin_url, - FileSystemType type) OVERRIDE; - virtual void GetOriginsForTypeOnFileThread( - FileSystemType type, - std::set<GURL>* origins) OVERRIDE; - virtual void GetOriginsForHostOnFileThread( - FileSystemType type, - const std::string& host, - std::set<GURL>* origins) OVERRIDE; - virtual int64 GetOriginUsageOnFileThread( - FileSystemContext* context, - const GURL& origin_url, - FileSystemType type) OVERRIDE; - virtual void InvalidateUsageCache( - const GURL& origin_url, - FileSystemType type) OVERRIDE; - virtual void StickyInvalidateUsageCache( - const GURL& origin_url, - FileSystemType type) OVERRIDE; - virtual void AddFileUpdateObserver( - FileSystemType type, - FileUpdateObserver* observer, - base::SequencedTaskRunner* task_runner) OVERRIDE; - virtual void AddFileChangeObserver( - FileSystemType type, - FileChangeObserver* observer, - base::SequencedTaskRunner* task_runner) OVERRIDE; - virtual void AddFileAccessObserver( - FileSystemType type, - FileAccessObserver* observer, - base::SequencedTaskRunner* task_runner) OVERRIDE; - virtual const UpdateObserverList* GetUpdateObservers( - FileSystemType type) const OVERRIDE; - virtual const ChangeObserverList* GetChangeObservers( - FileSystemType type) const OVERRIDE; - virtual const AccessObserverList* GetAccessObservers( - FileSystemType type) const OVERRIDE; + SandboxFileSystemBackendDelegate::OriginEnumerator* CreateOriginEnumerator(); void set_enable_temporary_file_system_in_incognito(bool enable) { enable_temporary_file_system_in_incognito_ = enable; } + bool enable_temporary_file_system_in_incognito() const { + return enable_temporary_file_system_in_incognito_; + } + private: - SandboxContext* sandbox_context_; // Not owned. + SandboxFileSystemBackendDelegate* delegate_; // Not owned. bool enable_temporary_file_system_in_incognito_; - // Observers. - UpdateObserverList update_observers_; - ChangeObserverList change_observers_; - AccessObserverList access_observers_; - DISALLOW_COPY_AND_ASSIGN(SandboxFileSystemBackend); }; diff --git a/chromium/webkit/browser/fileapi/sandbox_context.cc b/chromium/webkit/browser/fileapi/sandbox_file_system_backend_delegate.cc index d8b7293b6a4..1cb61bb3d60 100644 --- a/chromium/webkit/browser/fileapi/sandbox_context.cc +++ b/chromium/webkit/browser/fileapi/sandbox_file_system_backend_delegate.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/browser/fileapi/sandbox_context.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend_delegate.h" #include "base/command_line.h" #include "base/file_util.h" @@ -10,12 +10,14 @@ #include "base/stl_util.h" #include "base/task_runner_util.h" #include "net/base/net_util.h" +#include "webkit/browser/blob/file_stream_reader.h" #include "webkit/browser/fileapi/async_file_util_adapter.h" #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/file_system_usage_cache.h" #include "webkit/browser/fileapi/obfuscated_file_util.h" +#include "webkit/browser/fileapi/sandbox_file_stream_writer.h" #include "webkit/browser/fileapi/sandbox_file_system_backend.h" #include "webkit/browser/fileapi/sandbox_quota_observer.h" #include "webkit/browser/quota/quota_manager.h" @@ -25,6 +27,9 @@ namespace fileapi { namespace { +const char kTemporaryOriginsCountLabel[] = "FileSystem.TemporaryOriginsCount"; +const char kPersistentOriginsCountLabel[] = "FileSystem.PersistentOriginsCount"; + const char kOpenFileSystemLabel[] = "FileSystem.OpenFileSystem"; const char kOpenFileSystemDetailLabel[] = "FileSystem.OpenFileSystemDetail"; const char kOpenFileSystemDetailNonThrottledLabel[] = @@ -53,7 +58,7 @@ const base::FilePath::CharType kRestrictedChars[] = { }; class ObfuscatedOriginEnumerator - : public SandboxContext::OriginEnumerator { + : public SandboxFileSystemBackendDelegate::OriginEnumerator { public: explicit ObfuscatedOriginEnumerator(ObfuscatedFileUtil* file_util) { enum_.reset(file_util->CreateOriginEnumerator()); @@ -64,7 +69,7 @@ class ObfuscatedOriginEnumerator return enum_->Next(); } - virtual bool HasFileSystemType(fileapi::FileSystemType type) const OVERRIDE { + virtual bool HasFileSystemType(FileSystemType type) const OVERRIDE { return enum_->HasFileSystemType(type); } @@ -94,20 +99,21 @@ void OpenFileSystemOnFileThread( } void DidOpenFileSystem( - base::WeakPtr<SandboxContext> sandbox_context, + base::WeakPtr<SandboxFileSystemBackendDelegate> delegate, const base::Callback<void(base::PlatformFileError error)>& callback, base::PlatformFileError* error) { - if (sandbox_context.get()) - sandbox_context.get()->CollectOpenFileSystemMetrics(*error); + if (delegate.get()) + delegate.get()->CollectOpenFileSystemMetrics(*error); callback.Run(*error); } } // namespace const base::FilePath::CharType -SandboxContext::kFileSystemDirectory[] = FILE_PATH_LITERAL("File System"); +SandboxFileSystemBackendDelegate::kFileSystemDirectory[] = + FILE_PATH_LITERAL("File System"); -SandboxContext::SandboxContext( +SandboxFileSystemBackendDelegate::SandboxFileSystemBackendDelegate( quota::QuotaManagerProxy* quota_manager_proxy, base::SequencedTaskRunner* file_task_runner, const base::FilePath& profile_path, @@ -123,16 +129,18 @@ SandboxContext::SandboxContext( quota_observer_(new SandboxQuotaObserver( quota_manager_proxy, file_task_runner, - sync_file_util(), + obfuscated_file_util(), usage_cache())), special_storage_policy_(special_storage_policy), file_system_options_(file_system_options), + is_filesystem_opened_(false), weak_factory_(this) { } -SandboxContext::~SandboxContext() { +SandboxFileSystemBackendDelegate::~SandboxFileSystemBackendDelegate() { + io_thread_checker_.DetachFromThread(); if (!file_task_runner_->RunsTasksOnCurrentThread()) { - AsyncFileUtilAdapter* sandbox_file_util = sandbox_file_util_.release(); + AsyncFileUtil* sandbox_file_util = sandbox_file_util_.release(); SandboxQuotaObserver* quota_observer = quota_observer_.release(); FileSystemUsageCache* file_system_usage_cache = file_system_usage_cache_.release(); @@ -145,7 +153,8 @@ SandboxContext::~SandboxContext() { } } -bool SandboxContext::IsAccessValid(const FileSystemURL& url) const { +bool SandboxFileSystemBackendDelegate::IsAccessValid( + const FileSystemURL& url) const { if (!IsAllowedScheme(url.origin())) return false; @@ -176,10 +185,10 @@ bool SandboxContext::IsAccessValid(const FileSystemURL& url) const { return true; } -bool SandboxContext::IsAllowedScheme(const GURL& url) const { +bool SandboxFileSystemBackendDelegate::IsAllowedScheme(const GURL& url) const { // Basically we only accept http or https. We allow file:// URLs // only if --allow-file-access-from-files flag is given. - if (url.SchemeIs("http") || url.SchemeIs("https")) + if (url.SchemeIsHTTPOrHTTPS()) return true; if (url.SchemeIsFileSystem()) return url.inner_url() && IsAllowedScheme(*url.inner_url()); @@ -194,23 +203,27 @@ bool SandboxContext::IsAllowedScheme(const GURL& url) const { return false; } -SandboxContext::OriginEnumerator* SandboxContext::CreateOriginEnumerator() { - return new ObfuscatedOriginEnumerator(sync_file_util()); +SandboxFileSystemBackendDelegate::OriginEnumerator* +SandboxFileSystemBackendDelegate::CreateOriginEnumerator() { + return new ObfuscatedOriginEnumerator(obfuscated_file_util()); } -base::FilePath SandboxContext::GetBaseDirectoryForOriginAndType( - const GURL& origin_url, fileapi::FileSystemType type, bool create) { +base::FilePath +SandboxFileSystemBackendDelegate::GetBaseDirectoryForOriginAndType( + const GURL& origin_url, + FileSystemType type, + bool create) { base::PlatformFileError error = base::PLATFORM_FILE_OK; - base::FilePath path = sync_file_util()->GetDirectoryForOriginAndType( + base::FilePath path = obfuscated_file_util()->GetDirectoryForOriginAndType( origin_url, type, create, &error); if (error != base::PLATFORM_FILE_OK) return base::FilePath(); return path; } -void SandboxContext::OpenFileSystem( +void SandboxFileSystemBackendDelegate::OpenFileSystem( const GURL& origin_url, - fileapi::FileSystemType type, + FileSystemType type, OpenFileSystemMode mode, const OpenFileSystemCallback& callback, const GURL& root_url) { @@ -225,23 +238,77 @@ void SandboxContext::OpenFileSystem( file_task_runner_->PostTaskAndReply( FROM_HERE, base::Bind(&OpenFileSystemOnFileThread, - sync_file_util(), origin_url, type, mode, + obfuscated_file_util(), origin_url, type, mode, base::Unretained(error_ptr)), base::Bind(&DidOpenFileSystem, weak_factory_.GetWeakPtr(), base::Bind(callback, root_url, name), base::Owned(error_ptr))); + + io_thread_checker_.DetachFromThread(); + is_filesystem_opened_ = true; +} + +scoped_ptr<FileSystemOperationContext> +SandboxFileSystemBackendDelegate::CreateFileSystemOperationContext( + const FileSystemURL& url, + FileSystemContext* context, + base::PlatformFileError* error_code) const { + if (!IsAccessValid(url)) { + *error_code = base::PLATFORM_FILE_ERROR_SECURITY; + return scoped_ptr<FileSystemOperationContext>(); + } + + const UpdateObserverList* update_observers = GetUpdateObservers(url.type()); + const ChangeObserverList* change_observers = GetChangeObservers(url.type()); + DCHECK(update_observers); + + scoped_ptr<FileSystemOperationContext> operation_context( + new FileSystemOperationContext(context)); + operation_context->set_update_observers(*update_observers); + operation_context->set_change_observers( + change_observers ? *change_observers : ChangeObserverList()); + + return operation_context.Pass(); } -base::PlatformFileError SandboxContext::DeleteOriginDataOnFileThread( +scoped_ptr<webkit_blob::FileStreamReader> +SandboxFileSystemBackendDelegate::CreateFileStreamReader( + const FileSystemURL& url, + int64 offset, + const base::Time& expected_modification_time, + FileSystemContext* context) const { + if (!IsAccessValid(url)) + return scoped_ptr<webkit_blob::FileStreamReader>(); + return scoped_ptr<webkit_blob::FileStreamReader>( + webkit_blob::FileStreamReader::CreateForFileSystemFile( + context, url, offset, expected_modification_time)); +} + +scoped_ptr<FileStreamWriter> +SandboxFileSystemBackendDelegate::CreateFileStreamWriter( + const FileSystemURL& url, + int64 offset, + FileSystemContext* context, + FileSystemType type) const { + if (!IsAccessValid(url)) + return scoped_ptr<FileStreamWriter>(); + const UpdateObserverList* observers = GetUpdateObservers(type); + DCHECK(observers); + return scoped_ptr<FileStreamWriter>( + new SandboxFileStreamWriter(context, url, offset, *observers)); +} + +base::PlatformFileError +SandboxFileSystemBackendDelegate::DeleteOriginDataOnFileThread( FileSystemContext* file_system_context, quota::QuotaManagerProxy* proxy, const GURL& origin_url, - fileapi::FileSystemType type) { + FileSystemType type) { int64 usage = GetOriginUsageOnFileThread( file_system_context, origin_url, type); usage_cache()->CloseCacheFiles(); - bool result = sync_file_util()->DeleteDirectoryForOriginAndType( + bool result = obfuscated_file_util()->DeleteDirectoryForOriginAndType( origin_url, type); if (result && proxy) { proxy->NotifyStorageModified( @@ -256,8 +323,8 @@ base::PlatformFileError SandboxContext::DeleteOriginDataOnFileThread( return base::PLATFORM_FILE_ERROR_FAILED; } -void SandboxContext::GetOriginsForTypeOnFileThread( - fileapi::FileSystemType type, std::set<GURL>* origins) { +void SandboxFileSystemBackendDelegate::GetOriginsForTypeOnFileThread( + FileSystemType type, std::set<GURL>* origins) { DCHECK(origins); scoped_ptr<OriginEnumerator> enumerator(CreateOriginEnumerator()); GURL origin; @@ -265,10 +332,20 @@ void SandboxContext::GetOriginsForTypeOnFileThread( if (enumerator->HasFileSystemType(type)) origins->insert(origin); } + switch (type) { + case kFileSystemTypeTemporary: + UMA_HISTOGRAM_COUNTS(kTemporaryOriginsCountLabel, origins->size()); + break; + case kFileSystemTypePersistent: + UMA_HISTOGRAM_COUNTS(kPersistentOriginsCountLabel, origins->size()); + break; + default: + break; + } } -void SandboxContext::GetOriginsForHostOnFileThread( - fileapi::FileSystemType type, const std::string& host, +void SandboxFileSystemBackendDelegate::GetOriginsForHostOnFileThread( + FileSystemType type, const std::string& host, std::set<GURL>* origins) { DCHECK(origins); scoped_ptr<OriginEnumerator> enumerator(CreateOriginEnumerator()); @@ -280,10 +357,10 @@ void SandboxContext::GetOriginsForHostOnFileThread( } } -int64 SandboxContext::GetOriginUsageOnFileThread( +int64 SandboxFileSystemBackendDelegate::GetOriginUsageOnFileThread( FileSystemContext* file_system_context, const GURL& origin_url, - fileapi::FileSystemType type) { + FileSystemType type) { // Don't use usage cache and return recalculated usage for sticky invalidated // origins. if (ContainsKey(sticky_dirty_origins_, std::make_pair(origin_url, type))) @@ -318,41 +395,101 @@ int64 SandboxContext::GetOriginUsageOnFileThread( return usage; } -void SandboxContext::InvalidateUsageCache( +void SandboxFileSystemBackendDelegate::AddFileUpdateObserver( + FileSystemType type, + FileUpdateObserver* observer, + base::SequencedTaskRunner* task_runner) { + DCHECK(!is_filesystem_opened_ || io_thread_checker_.CalledOnValidThread()); + update_observers_[type] = + update_observers_[type].AddObserver(observer, task_runner); +} + +void SandboxFileSystemBackendDelegate::AddFileChangeObserver( + FileSystemType type, + FileChangeObserver* observer, + base::SequencedTaskRunner* task_runner) { + DCHECK(!is_filesystem_opened_ || io_thread_checker_.CalledOnValidThread()); + change_observers_[type] = + change_observers_[type].AddObserver(observer, task_runner); +} + +void SandboxFileSystemBackendDelegate::AddFileAccessObserver( + FileSystemType type, + FileAccessObserver* observer, + base::SequencedTaskRunner* task_runner) { + DCHECK(!is_filesystem_opened_ || io_thread_checker_.CalledOnValidThread()); + access_observers_[type] = + access_observers_[type].AddObserver(observer, task_runner); +} + +const UpdateObserverList* SandboxFileSystemBackendDelegate::GetUpdateObservers( + FileSystemType type) const { + std::map<FileSystemType, UpdateObserverList>::const_iterator iter = + update_observers_.find(type); + if (iter == update_observers_.end()) + return NULL; + return &iter->second; +} + +const ChangeObserverList* SandboxFileSystemBackendDelegate::GetChangeObservers( + FileSystemType type) const { + std::map<FileSystemType, ChangeObserverList>::const_iterator iter = + change_observers_.find(type); + if (iter == change_observers_.end()) + return NULL; + return &iter->second; +} + +const AccessObserverList* SandboxFileSystemBackendDelegate::GetAccessObservers( + FileSystemType type) const { + std::map<FileSystemType, AccessObserverList>::const_iterator iter = + access_observers_.find(type); + if (iter == access_observers_.end()) + return NULL; + return &iter->second; +} + +void SandboxFileSystemBackendDelegate::InvalidateUsageCache( const GURL& origin, - fileapi::FileSystemType type) { + FileSystemType type) { base::PlatformFileError error = base::PLATFORM_FILE_OK; base::FilePath usage_file_path = GetUsageCachePathForOriginAndType( - sync_file_util(), origin, type, &error); + obfuscated_file_util(), origin, type, &error); if (error != base::PLATFORM_FILE_OK) return; usage_cache()->IncrementDirty(usage_file_path); } -void SandboxContext::StickyInvalidateUsageCache( +void SandboxFileSystemBackendDelegate::StickyInvalidateUsageCache( const GURL& origin, - fileapi::FileSystemType type) { + FileSystemType type) { sticky_dirty_origins_.insert(std::make_pair(origin, type)); quota_observer()->SetUsageCacheEnabled(origin, type, false); InvalidateUsageCache(origin, type); } -base::FilePath SandboxContext::GetUsageCachePathForOriginAndType( +FileSystemFileUtil* SandboxFileSystemBackendDelegate::sync_file_util() { + return static_cast<AsyncFileUtilAdapter*>(file_util())->sync_file_util(); +} + +base::FilePath +SandboxFileSystemBackendDelegate::GetUsageCachePathForOriginAndType( const GURL& origin_url, FileSystemType type) { base::PlatformFileError error; base::FilePath path = GetUsageCachePathForOriginAndType( - sync_file_util(), origin_url, type, &error); + obfuscated_file_util(), origin_url, type, &error); if (error != base::PLATFORM_FILE_OK) return base::FilePath(); return path; } // static -base::FilePath SandboxContext::GetUsageCachePathForOriginAndType( +base::FilePath +SandboxFileSystemBackendDelegate::GetUsageCachePathForOriginAndType( ObfuscatedFileUtil* sandbox_file_util, const GURL& origin_url, - fileapi::FileSystemType type, + FileSystemType type, base::PlatformFileError* error_out) { DCHECK(error_out); *error_out = base::PLATFORM_FILE_OK; @@ -363,14 +500,16 @@ base::FilePath SandboxContext::GetUsageCachePathForOriginAndType( return base_path.Append(FileSystemUsageCache::kUsageFileName); } -int64 SandboxContext::RecalculateUsage(FileSystemContext* context, - const GURL& origin, - FileSystemType type) { +int64 SandboxFileSystemBackendDelegate::RecalculateUsage( + FileSystemContext* context, + const GURL& origin, + FileSystemType type) { FileSystemOperationContext operation_context(context); FileSystemURL url = context->CreateCrackedFileSystemURL( origin, type, base::FilePath()); scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> enumerator( - sync_file_util()->CreateFileEnumerator(&operation_context, url, true)); + obfuscated_file_util()->CreateFileEnumerator( + &operation_context, url, true)); base::FilePath file_path_each; int64 usage = 0; @@ -383,7 +522,7 @@ int64 SandboxContext::RecalculateUsage(FileSystemContext* context, return usage; } -void SandboxContext::CollectOpenFileSystemMetrics( +void SandboxFileSystemBackendDelegate::CollectOpenFileSystemMetrics( base::PlatformFileError error_code) { base::Time now = base::Time::Now(); bool throttled = now < next_release_time_for_open_filesystem_stat_; @@ -420,8 +559,8 @@ void SandboxContext::CollectOpenFileSystemMetrics( #undef REPORT } -ObfuscatedFileUtil* SandboxContext::sync_file_util() { - return static_cast<ObfuscatedFileUtil*>(file_util()->sync_file_util()); +ObfuscatedFileUtil* SandboxFileSystemBackendDelegate::obfuscated_file_util() { + return static_cast<ObfuscatedFileUtil*>(sync_file_util()); } } // namespace fileapi diff --git a/chromium/webkit/browser/fileapi/sandbox_context.h b/chromium/webkit/browser/fileapi/sandbox_file_system_backend_delegate.h index c765077b8d3..33d791e5920 100644 --- a/chromium/webkit/browser/fileapi/sandbox_context.h +++ b/chromium/webkit/browser/fileapi/sandbox_file_system_backend_delegate.h @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_FILEAPI_SANDBOX_CONTEXT_H_ -#define WEBKIT_BROWSER_FILEAPI_SANDBOX_CONTEXT_H_ +#ifndef WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ +#define WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ +#include <map> #include <set> #include <string> #include <utility> @@ -13,6 +14,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" +#include "base/threading/thread_checker.h" #include "base/time/time.h" #include "webkit/browser/fileapi/file_system_backend.h" #include "webkit/browser/fileapi/file_system_options.h" @@ -28,9 +30,16 @@ class QuotaManagerProxy; class SpecialStoragePolicy; } +namespace webkit_blob { +class FileStreamReader; +} + namespace fileapi { -class AsyncFileUtilAdapter; +class AsyncFileUtil; +class FileStreamWriter; +class FileSystemFileUtil; +class FileSystemOperationContext; class FileSystemURL; class FileSystemUsageCache; class ObfuscatedFileUtil; @@ -38,9 +47,10 @@ class SandboxFileSystemBackend; class SandboxFileSystemTestHelper; class SandboxQuotaObserver; -// This class keeps and provides a sandbox file system context. +// Delegate implementation of the some methods in Sandbox/SyncFileSystemBackend. // An instance of this class is created and owned by FileSystemContext. -class WEBKIT_STORAGE_BROWSER_EXPORT SandboxContext { +class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackendDelegate + : public FileSystemQuotaUtil { public: typedef FileSystemBackend::OpenFileSystemCallback OpenFileSystemCallback; @@ -60,14 +70,14 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxContext { virtual bool HasFileSystemType(FileSystemType type) const = 0; }; - SandboxContext( + SandboxFileSystemBackendDelegate( quota::QuotaManagerProxy* quota_manager_proxy, base::SequencedTaskRunner* file_task_runner, const base::FilePath& profile_path, quota::SpecialStoragePolicy* special_storage_policy, const FileSystemOptions& file_system_options); - ~SandboxContext(); + virtual ~SandboxFileSystemBackendDelegate(); // Performs API-specific validity checks on the given path |url|. // Returns true if access to |url| is valid in this filesystem. @@ -99,30 +109,61 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxContext { OpenFileSystemMode mode, const OpenFileSystemCallback& callback, const GURL& root_url); + scoped_ptr<FileSystemOperationContext> CreateFileSystemOperationContext( + const FileSystemURL& url, + FileSystemContext* context, + base::PlatformFileError* error_code) const; + scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( + const FileSystemURL& url, + int64 offset, + const base::Time& expected_modification_time, + FileSystemContext* context) const; + scoped_ptr<FileStreamWriter> CreateFileStreamWriter( + const FileSystemURL& url, + int64 offset, + FileSystemContext* context, + FileSystemType type) const; - // FileSystemQuotaUtil helpers. - base::PlatformFileError DeleteOriginDataOnFileThread( + // FileSystemQuotaUtil overrides. + virtual base::PlatformFileError DeleteOriginDataOnFileThread( FileSystemContext* context, quota::QuotaManagerProxy* proxy, const GURL& origin_url, - FileSystemType type); - void GetOriginsForTypeOnFileThread( + FileSystemType type) OVERRIDE; + virtual void GetOriginsForTypeOnFileThread( FileSystemType type, - std::set<GURL>* origins); - void GetOriginsForHostOnFileThread( + std::set<GURL>* origins) OVERRIDE; + virtual void GetOriginsForHostOnFileThread( FileSystemType type, const std::string& host, - std::set<GURL>* origins); - int64 GetOriginUsageOnFileThread( + std::set<GURL>* origins) OVERRIDE; + virtual int64 GetOriginUsageOnFileThread( FileSystemContext* context, const GURL& origin_url, - FileSystemType type); - void InvalidateUsageCache( - const GURL& origin_url, - FileSystemType type); - void StickyInvalidateUsageCache( - const GURL& origin_url, - FileSystemType type); + FileSystemType type) OVERRIDE; + virtual void AddFileUpdateObserver( + FileSystemType type, + FileUpdateObserver* observer, + base::SequencedTaskRunner* task_runner) OVERRIDE; + virtual void AddFileChangeObserver( + FileSystemType type, + FileChangeObserver* observer, + base::SequencedTaskRunner* task_runner) OVERRIDE; + virtual void AddFileAccessObserver( + FileSystemType type, + FileAccessObserver* observer, + base::SequencedTaskRunner* task_runner) OVERRIDE; + virtual const UpdateObserverList* GetUpdateObservers( + FileSystemType type) const OVERRIDE; + virtual const ChangeObserverList* GetChangeObservers( + FileSystemType type) const OVERRIDE; + virtual const AccessObserverList* GetAccessObservers( + FileSystemType type) const OVERRIDE; + + void InvalidateUsageCache(const GURL& origin_url, + FileSystemType type); + void StickyInvalidateUsageCache(const GURL& origin_url, + FileSystemType type); void CollectOpenFileSystemMetrics(base::PlatformFileError error_code); @@ -130,17 +171,19 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxContext { return file_task_runner_.get(); } - AsyncFileUtilAdapter* file_util() { return sandbox_file_util_.get(); } + AsyncFileUtil* file_util() { return sandbox_file_util_.get(); } FileSystemUsageCache* usage_cache() { return file_system_usage_cache_.get(); } - SandboxQuotaObserver* quota_observer() { return quota_observer_.get(); }; + SandboxQuotaObserver* quota_observer() { return quota_observer_.get(); } quota::SpecialStoragePolicy* special_storage_policy() { return special_storage_policy_.get(); } - FileSystemOptions file_system_options() { return file_system_options_; } + const FileSystemOptions& file_system_options() const { + return file_system_options_; + } - ObfuscatedFileUtil* sync_file_util(); + FileSystemFileUtil* sync_file_util(); private: friend class SandboxQuotaObserver; @@ -162,9 +205,11 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxContext { const GURL& origin, FileSystemType type); + ObfuscatedFileUtil* obfuscated_file_util(); + scoped_refptr<base::SequencedTaskRunner> file_task_runner_; - scoped_ptr<AsyncFileUtilAdapter> sandbox_file_util_; + scoped_ptr<AsyncFileUtil> sandbox_file_util_; scoped_ptr<FileSystemUsageCache> file_system_usage_cache_; scoped_ptr<SandboxQuotaObserver> quota_observer_; @@ -172,18 +217,25 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxContext { FileSystemOptions file_system_options_; - // Acccessed only on the file thread. + bool is_filesystem_opened_; + base::ThreadChecker io_thread_checker_; + + // Accessed only on the file thread. std::set<GURL> visited_origins_; std::set<std::pair<GURL, FileSystemType> > sticky_dirty_origins_; + std::map<FileSystemType, UpdateObserverList> update_observers_; + std::map<FileSystemType, ChangeObserverList> change_observers_; + std::map<FileSystemType, AccessObserverList> access_observers_; + base::Time next_release_time_for_open_filesystem_stat_; - base::WeakPtrFactory<SandboxContext> weak_factory_; + base::WeakPtrFactory<SandboxFileSystemBackendDelegate> weak_factory_; - DISALLOW_COPY_AND_ASSIGN(SandboxContext); + DISALLOW_COPY_AND_ASSIGN(SandboxFileSystemBackendDelegate); }; } // namespace fileapi -#endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_CONTEXT_H_ +#endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ diff --git a/chromium/webkit/browser/fileapi/sandbox_context_unittest.cc b/chromium/webkit/browser/fileapi/sandbox_file_system_backend_delegate_unittest.cc index 841e10b5b83..48c3b8c4e70 100644 --- a/chromium/webkit/browser/fileapi/sandbox_context_unittest.cc +++ b/chromium/webkit/browser/fileapi/sandbox_file_system_backend_delegate_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/browser/fileapi/sandbox_context.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend_delegate.h" #include "base/basictypes.h" #include "base/file_util.h" @@ -27,11 +27,11 @@ FileSystemURL CreateFileSystemURL(const char* path) { } // namespace -class SandboxContextTest : public testing::Test { +class SandboxFileSystemBackendDelegateTest : public testing::Test { protected: virtual void SetUp() { ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); - context_.reset(new SandboxContext( + delegate_.reset(new SandboxFileSystemBackendDelegate( NULL /* quota_manager_proxy */, base::MessageLoopProxy::current().get(), data_dir_.path(), @@ -41,42 +41,42 @@ class SandboxContextTest : public testing::Test { base::ScopedTempDir data_dir_; base::MessageLoop message_loop_; - scoped_ptr<SandboxContext> context_; + scoped_ptr<SandboxFileSystemBackendDelegate> delegate_; }; -TEST_F(SandboxContextTest, IsAccessValid) { +TEST_F(SandboxFileSystemBackendDelegateTest, IsAccessValid) { // Normal case. - EXPECT_TRUE(context_->IsAccessValid(CreateFileSystemURL("a"))); + EXPECT_TRUE(delegate_->IsAccessValid(CreateFileSystemURL("a"))); // Access to a path with parent references ('..') should be disallowed. - EXPECT_FALSE(context_->IsAccessValid(CreateFileSystemURL("a/../b"))); + EXPECT_FALSE(delegate_->IsAccessValid(CreateFileSystemURL("a/../b"))); // Access from non-allowed scheme should be disallowed. - EXPECT_FALSE(context_->IsAccessValid( + EXPECT_FALSE(delegate_->IsAccessValid( FileSystemURL::CreateForTest( GURL("unknown://bar"), kFileSystemTypeTemporary, base::FilePath::FromUTF8Unsafe("foo")))); // Access with restricted name should be disallowed. - EXPECT_FALSE(context_->IsAccessValid(CreateFileSystemURL("."))); - EXPECT_FALSE(context_->IsAccessValid(CreateFileSystemURL(".."))); + EXPECT_FALSE(delegate_->IsAccessValid(CreateFileSystemURL("."))); + EXPECT_FALSE(delegate_->IsAccessValid(CreateFileSystemURL(".."))); // This is also disallowed due to Windows XP parent path handling. - EXPECT_FALSE(context_->IsAccessValid(CreateFileSystemURL("..."))); + EXPECT_FALSE(delegate_->IsAccessValid(CreateFileSystemURL("..."))); // These are identified as unsafe cases due to weird path handling // on Windows. - EXPECT_FALSE(context_->IsAccessValid(CreateFileSystemURL(" .."))); - EXPECT_FALSE(context_->IsAccessValid(CreateFileSystemURL(".. "))); + EXPECT_FALSE(delegate_->IsAccessValid(CreateFileSystemURL(" .."))); + EXPECT_FALSE(delegate_->IsAccessValid(CreateFileSystemURL(".. "))); // Similar but safe cases. - EXPECT_TRUE(context_->IsAccessValid(CreateFileSystemURL(" ."))); - EXPECT_TRUE(context_->IsAccessValid(CreateFileSystemURL(". "))); - EXPECT_TRUE(context_->IsAccessValid(CreateFileSystemURL("b."))); - EXPECT_TRUE(context_->IsAccessValid(CreateFileSystemURL(".b"))); + EXPECT_TRUE(delegate_->IsAccessValid(CreateFileSystemURL(" ."))); + EXPECT_TRUE(delegate_->IsAccessValid(CreateFileSystemURL(". "))); + EXPECT_TRUE(delegate_->IsAccessValid(CreateFileSystemURL("b."))); + EXPECT_TRUE(delegate_->IsAccessValid(CreateFileSystemURL(".b"))); // A path that looks like a drive letter. - EXPECT_TRUE(context_->IsAccessValid(CreateFileSystemURL("c:"))); + EXPECT_TRUE(delegate_->IsAccessValid(CreateFileSystemURL("c:"))); } } // namespace fileapi diff --git a/chromium/webkit/browser/fileapi/sandbox_file_system_backend_unittest.cc b/chromium/webkit/browser/fileapi/sandbox_file_system_backend_unittest.cc index ec213a36386..ed06d17ad70 100644 --- a/chromium/webkit/browser/fileapi/sandbox_file_system_backend_unittest.cc +++ b/chromium/webkit/browser/fileapi/sandbox_file_system_backend_unittest.cc @@ -10,14 +10,14 @@ #include "base/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_proxy.h" +#include "base/run_loop.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" #include "webkit/browser/fileapi/file_system_backend.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/mock_file_system_options.h" -#include "webkit/browser/fileapi/sandbox_context.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend_delegate.h" #include "webkit/common/fileapi/file_system_util.h" // PS stands for path separator. @@ -85,11 +85,11 @@ class SandboxFileSystemBackendTest : public testing::Test { protected: virtual void SetUp() { ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); - SetUpNewSandboxContext(CreateAllowFileAccessOptions()); + SetUpNewDelegate(CreateAllowFileAccessOptions()); } - void SetUpNewSandboxContext(const FileSystemOptions& options) { - context_.reset(new SandboxContext( + void SetUpNewDelegate(const FileSystemOptions& options) { + delegate_.reset(new SandboxFileSystemBackendDelegate( NULL /* quota_manager_proxy */, base::MessageLoopProxy::current().get(), data_dir_.path(), @@ -98,17 +98,18 @@ class SandboxFileSystemBackendTest : public testing::Test { } void SetUpNewBackend(const FileSystemOptions& options) { - SetUpNewSandboxContext(options); - backend_.reset(new SandboxFileSystemBackend(context_.get())); + SetUpNewDelegate(options); + backend_.reset(new SandboxFileSystemBackend(delegate_.get())); } - SandboxContext::OriginEnumerator* CreateOriginEnumerator() const { + SandboxFileSystemBackendDelegate::OriginEnumerator* + CreateOriginEnumerator() const { return backend_->CreateOriginEnumerator(); } void CreateOriginTypeDirectory(const GURL& origin, fileapi::FileSystemType type) { - base::FilePath target = context_-> + base::FilePath target = delegate_-> GetBaseDirectoryForOriginAndType(origin, type, true); ASSERT_TRUE(!target.empty()); ASSERT_TRUE(base::DirectoryExists(target)); @@ -122,11 +123,11 @@ class SandboxFileSystemBackendTest : public testing::Test { backend_->OpenFileSystem( origin_url, type, mode, base::Bind(&DidOpenFileSystem, &error)); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); if (error != base::PLATFORM_FILE_OK) return false; base::FilePath returned_root_path = - context_->GetBaseDirectoryForOriginAndType( + delegate_->GetBaseDirectoryForOriginAndType( origin_url, type, false /* create */); if (root_path) *root_path = returned_root_path; @@ -134,18 +135,19 @@ class SandboxFileSystemBackendTest : public testing::Test { } base::FilePath file_system_path() const { - return data_dir_.path().Append(SandboxContext::kFileSystemDirectory); + return data_dir_.path().Append( + SandboxFileSystemBackendDelegate::kFileSystemDirectory); } base::ScopedTempDir data_dir_; base::MessageLoop message_loop_; - scoped_ptr<SandboxContext> context_; + scoped_ptr<SandboxFileSystemBackendDelegate> delegate_; scoped_ptr<SandboxFileSystemBackend> backend_; }; TEST_F(SandboxFileSystemBackendTest, Empty) { SetUpNewBackend(CreateAllowFileAccessOptions()); - scoped_ptr<SandboxContext::OriginEnumerator> enumerator( + scoped_ptr<SandboxFileSystemBackendDelegate::OriginEnumerator> enumerator( CreateOriginEnumerator()); ASSERT_TRUE(enumerator->Next().is_empty()); } @@ -178,7 +180,7 @@ TEST_F(SandboxFileSystemBackendTest, EnumerateOrigins) { persistent_set.insert(GURL(persistent_origins[i])); } - scoped_ptr<SandboxContext::OriginEnumerator> enumerator( + scoped_ptr<SandboxFileSystemBackendDelegate::OriginEnumerator> enumerator( CreateOriginEnumerator()); size_t temporary_actual_size = 0; size_t persistent_actual_size = 0; diff --git a/chromium/webkit/browser/fileapi/sandbox_file_system_test_helper.cc b/chromium/webkit/browser/fileapi/sandbox_file_system_test_helper.cc index 179bf9b2c1a..df579e488e4 100644 --- a/chromium/webkit/browser/fileapi/sandbox_file_system_test_helper.cc +++ b/chromium/webkit/browser/fileapi/sandbox_file_system_test_helper.cc @@ -5,8 +5,8 @@ #include "webkit/browser/fileapi/sandbox_file_system_test_helper.h" #include "base/file_util.h" -#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_proxy.h" +#include "base/run_loop.h" #include "url/gurl.h" #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_file_util.h" @@ -57,11 +57,11 @@ void SandboxFileSystemTestHelper::SetUp( void SandboxFileSystemTestHelper::TearDown() { file_system_context_ = NULL; - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } base::FilePath SandboxFileSystemTestHelper::GetOriginRootPath() { - return file_system_context_->sandbox_context()-> + return file_system_context_->sandbox_delegate()-> GetBaseDirectoryForOriginAndType(origin_, type_, false); } @@ -80,8 +80,8 @@ base::FilePath SandboxFileSystemTestHelper::GetLocalPathFromASCII( } base::FilePath SandboxFileSystemTestHelper::GetUsageCachePath() const { - return file_system_context_-> - sandbox_context()->GetUsageCachePathForOriginAndType(origin_, type_); + return file_system_context_->sandbox_delegate()-> + GetUsageCachePathForOriginAndType(origin_, type_); } FileSystemURL SandboxFileSystemTestHelper::CreateURL( @@ -124,23 +124,23 @@ SandboxFileSystemTestHelper::NewOperationContext() { void SandboxFileSystemTestHelper::AddFileChangeObserver( FileChangeObserver* observer) { - file_system_context_->sandbox_backend()-> + file_system_context_->sandbox_backend()->GetQuotaUtil()-> AddFileChangeObserver(type_, observer, NULL); } FileSystemUsageCache* SandboxFileSystemTestHelper::usage_cache() { - return file_system_context()->sandbox_context()->usage_cache(); + return file_system_context()->sandbox_delegate()->usage_cache(); } void SandboxFileSystemTestHelper::SetUpFileSystem() { DCHECK(file_system_context_.get()); DCHECK(file_system_context_->sandbox_backend()->CanHandleType(type_)); - file_util_ = file_system_context_->GetFileUtil(type_); + file_util_ = file_system_context_->sandbox_delegate()->sync_file_util(); DCHECK(file_util_); // Prepare the origin's root directory. - file_system_context_->sandbox_context()-> + file_system_context_->sandbox_delegate()-> GetBaseDirectoryForOriginAndType(origin_, type_, true /* create */); // Initialize the usage cache file. diff --git a/chromium/webkit/browser/fileapi/sandbox_isolated_origin_database_unittest.cc b/chromium/webkit/browser/fileapi/sandbox_isolated_origin_database_unittest.cc index 7eeab2185b6..aad2c7e6cc3 100644 --- a/chromium/webkit/browser/fileapi/sandbox_isolated_origin_database_unittest.cc +++ b/chromium/webkit/browser/fileapi/sandbox_isolated_origin_database_unittest.cc @@ -76,7 +76,7 @@ TEST(SandboxIsolatedOriginDatabaseTest, MigrationTest) { base::FilePath directory_db_path = dir.path().Append(path); EXPECT_TRUE(base::DirectoryExists(directory_db_path)); EXPECT_TRUE(base::PathExists(directory_db_path.AppendASCII("dummy"))); - EXPECT_TRUE(file_util::ReadFileToString( + EXPECT_TRUE(base::ReadFileToString( directory_db_path.AppendASCII("dummy"), &origin_db_data)); EXPECT_EQ(kFakeDirectoryData, origin_db_data); diff --git a/chromium/webkit/browser/fileapi/sandbox_origin_database.cc b/chromium/webkit/browser/fileapi/sandbox_origin_database.cc index 9ca399673fd..4ce83017cc0 100644 --- a/chromium/webkit/browser/fileapi/sandbox_origin_database.cc +++ b/chromium/webkit/browser/fileapi/sandbox_origin_database.cc @@ -76,7 +76,7 @@ bool SandboxOriginDatabase::Init(InitOption init_option, std::string path = FilePathToString(db_path); leveldb::Options options; - options.max_open_files = 64; // Use minimum. + options.max_open_files = 0; // Use minimum. options.create_if_missing = true; leveldb::DB* db; leveldb::Status status = leveldb::DB::Open(options, path, &db); @@ -122,7 +122,7 @@ bool SandboxOriginDatabase::Init(InitOption init_option, bool SandboxOriginDatabase::RepairDatabase(const std::string& db_path) { DCHECK(!db_.get()); leveldb::Options options; - options.max_open_files = 64; // Use minimum. + options.max_open_files = 0; // Use minimum. if (!leveldb::RepairDB(db_path, options).ok() || !Init(FAIL_IF_NONEXISTENT, FAIL_ON_CORRUPTION)) { LOG(WARNING) << "Failed to repair SandboxOriginDatabase."; diff --git a/chromium/webkit/browser/fileapi/sandbox_quota_observer.cc b/chromium/webkit/browser/fileapi/sandbox_quota_observer.cc index 02a47ee255c..fe5ee3796fb 100644 --- a/chromium/webkit/browser/fileapi/sandbox_quota_observer.cc +++ b/chromium/webkit/browser/fileapi/sandbox_quota_observer.cc @@ -7,7 +7,7 @@ #include "base/sequenced_task_runner.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/file_system_usage_cache.h" -#include "webkit/browser/fileapi/sandbox_context.h" +#include "webkit/browser/fileapi/sandbox_file_system_backend_delegate.h" #include "webkit/browser/fileapi/timed_task_helper.h" #include "webkit/browser/quota/quota_client.h" #include "webkit/browser/quota/quota_manager.h" @@ -107,7 +107,7 @@ base::FilePath SandboxQuotaObserver::GetUsageCachePath( DCHECK(sandbox_file_util_); base::PlatformFileError error = base::PLATFORM_FILE_OK; base::FilePath path = - SandboxContext::GetUsageCachePathForOriginAndType( + SandboxFileSystemBackendDelegate::GetUsageCachePathForOriginAndType( sandbox_file_util_, url.origin(), url.type(), &error); if (error != base::PLATFORM_FILE_OK) { LOG(WARNING) << "Could not get usage cache path for: " diff --git a/chromium/webkit/browser/fileapi/test_file_system_backend.cc b/chromium/webkit/browser/fileapi/test_file_system_backend.cc index 584e2e3a10d..44109cf6148 100644 --- a/chromium/webkit/browser/fileapi/test_file_system_backend.cc +++ b/chromium/webkit/browser/fileapi/test_file_system_backend.cc @@ -10,11 +10,11 @@ #include "base/file_util.h" #include "base/sequenced_task_runner.h" +#include "webkit/browser/blob/file_stream_reader.h" #include "webkit/browser/fileapi/copy_or_move_file_validator.h" #include "webkit/browser/fileapi/file_observers.h" -#include "webkit/browser/fileapi/file_system_file_stream_reader.h" +#include "webkit/browser/fileapi/file_system_operation.h" #include "webkit/browser/fileapi/file_system_operation_context.h" -#include "webkit/browser/fileapi/file_system_operation_impl.h" #include "webkit/browser/fileapi/file_system_quota_util.h" #include "webkit/browser/fileapi/local_file_util.h" #include "webkit/browser/fileapi/native_file_util.h" @@ -24,6 +24,29 @@ namespace fileapi { +namespace { + +class TestFileUtil : public LocalFileUtil { + public: + explicit TestFileUtil(const base::FilePath& base_path) + : base_path_(base_path) {} + virtual ~TestFileUtil() {} + + // LocalFileUtil overrides. + virtual base::PlatformFileError GetLocalFilePath( + FileSystemOperationContext* context, + const FileSystemURL& file_system_url, + base::FilePath* local_file_path) OVERRIDE { + *local_file_path = base_path_.Append(file_system_url.path()); + return base::PLATFORM_FILE_OK; + } + + private: + base::FilePath base_path_; +}; + +} // namespace + // This only supports single origin. class TestFileSystemBackend::QuotaUtil : public FileSystemQuotaUtil, @@ -66,17 +89,6 @@ class TestFileSystemBackend::QuotaUtil return usage_; } - virtual void InvalidateUsageCache(const GURL& origin_url, - FileSystemType type) OVERRIDE { - // Do nothing. - } - - virtual void StickyInvalidateUsageCache( - const GURL& origin, - FileSystemType type) OVERRIDE { - // Do nothing. - } - virtual void AddFileUpdateObserver( FileSystemType type, FileUpdateObserver* observer, @@ -136,7 +148,7 @@ TestFileSystemBackend::TestFileSystemBackend( base::SequencedTaskRunner* task_runner, const base::FilePath& base_path) : base_path_(base_path), - local_file_util_(new AsyncFileUtilAdapter(new LocalFileUtil())), + file_util_(new AsyncFileUtilAdapter(new TestFileUtil(base_path))), quota_util_(new QuotaUtil(task_runner)), require_copy_or_move_validator_(false) { } @@ -161,13 +173,8 @@ void TestFileSystemBackend::OpenFileSystem( base::PLATFORM_FILE_OK); } -FileSystemFileUtil* TestFileSystemBackend::GetFileUtil(FileSystemType type) { - DCHECK(local_file_util_.get()); - return local_file_util_->sync_file_util(); -} - AsyncFileUtil* TestFileSystemBackend::GetAsyncFileUtil(FileSystemType type) { - return local_file_util_.get(); + return file_util_.get(); } CopyOrMoveFileValidatorFactory* @@ -198,8 +205,7 @@ FileSystemOperation* TestFileSystemBackend::CreateFileSystemOperation( operation_context->set_update_observers(*GetUpdateObservers(url.type())); operation_context->set_change_observers( *quota_util_->GetChangeObservers(url.type())); - operation_context->set_root_path(base_path_); - return new FileSystemOperationImpl(url, context, operation_context.Pass()); + return FileSystemOperation::Create(url, context, operation_context.Pass()); } scoped_ptr<webkit_blob::FileStreamReader> @@ -209,7 +215,7 @@ TestFileSystemBackend::CreateFileStreamReader( const base::Time& expected_modification_time, FileSystemContext* context) const { return scoped_ptr<webkit_blob::FileStreamReader>( - new FileSystemFileStreamReader( + webkit_blob::FileStreamReader::CreateForFileSystemFile( context, url, offset, expected_modification_time)); } diff --git a/chromium/webkit/browser/fileapi/test_file_system_backend.h b/chromium/webkit/browser/fileapi/test_file_system_backend.h index ef252c13118..dc1cbce2298 100644 --- a/chromium/webkit/browser/fileapi/test_file_system_backend.h +++ b/chromium/webkit/browser/fileapi/test_file_system_backend.h @@ -41,7 +41,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE TestFileSystemBackend FileSystemType type, OpenFileSystemMode mode, const OpenFileSystemCallback& callback) OVERRIDE; - virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) OVERRIDE; virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) OVERRIDE; virtual CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory( FileSystemType type, @@ -81,7 +80,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE TestFileSystemBackend base::FilePath base_path_; scoped_refptr<base::SequencedTaskRunner> task_runner_; - scoped_ptr<AsyncFileUtilAdapter> local_file_util_; + scoped_ptr<AsyncFileUtilAdapter> file_util_; scoped_ptr<QuotaUtil> quota_util_; bool require_copy_or_move_validator_; diff --git a/chromium/webkit/browser/fileapi/timed_task_helper_unittest.cc b/chromium/webkit/browser/fileapi/timed_task_helper_unittest.cc index 6966c614c3d..fa3e84d523d 100644 --- a/chromium/webkit/browser/fileapi/timed_task_helper_unittest.cc +++ b/chromium/webkit/browser/fileapi/timed_task_helper_unittest.cc @@ -6,8 +6,8 @@ #include "base/bind.h" #include "base/location.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_proxy.h" +#include "base/run_loop.h" #include "base/time/time.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/fileapi/timed_task_helper.h" @@ -51,7 +51,7 @@ TEST(TimedTaskHelper, FireTimerWhenAlive) { embedder.timer()->Reset(); ASSERT_TRUE(embedder.timer()->IsRunning()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); ASSERT_TRUE(embedder.timer_fired()); } @@ -77,7 +77,7 @@ TEST(TimedTaskHelper, FireTimerWhenAlreadyDeleted) { // At this point the callback is still in the message queue but // embedder is gone. - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } } // namespace fileapi diff --git a/chromium/webkit/browser/fileapi/transient_file_util.h b/chromium/webkit/browser/fileapi/transient_file_util.h index d3d56c1c173..1e67c852027 100644 --- a/chromium/webkit/browser/fileapi/transient_file_util.h +++ b/chromium/webkit/browser/fileapi/transient_file_util.h @@ -6,7 +6,7 @@ #define WEBKIT_BROWSER_FILEAPI_TRANSIENT_FILE_UTIL_H_ #include "base/memory/scoped_ptr.h" -#include "webkit/browser/fileapi/isolated_file_util.h" +#include "webkit/browser/fileapi/local_file_util.h" #include "webkit/browser/webkit_storage_browser_export.h" namespace fileapi { @@ -14,12 +14,12 @@ namespace fileapi { class FileSystemOperationContext; class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE TransientFileUtil - : public IsolatedFileUtil { + : public LocalFileUtil { public: TransientFileUtil() {} virtual ~TransientFileUtil() {} - // IsolatedFileUtil overrides. + // LocalFileUtil overrides. virtual webkit_blob::ScopedFile CreateSnapshotFile( FileSystemOperationContext* context, const FileSystemURL& url, diff --git a/chromium/webkit/browser/fileapi/transient_file_util_unittest.cc b/chromium/webkit/browser/fileapi/transient_file_util_unittest.cc index 2a809a30779..3b6e284070d 100644 --- a/chromium/webkit/browser/fileapi/transient_file_util_unittest.cc +++ b/chromium/webkit/browser/fileapi/transient_file_util_unittest.cc @@ -7,8 +7,8 @@ #include "base/files/file_path.h" #include "base/files/scoped_temp_dir.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop.h" #include "base/platform_file.h" +#include "base/run_loop.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_operation_context.h" @@ -34,7 +34,7 @@ class TransientFileUtilTest : public testing::Test { virtual void TearDown() OVERRIDE { file_system_context_ = NULL; - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } void CreateAndRegisterTemporaryFile( @@ -110,7 +110,7 @@ TEST_F(TransientFileUtilTest, TransientFile) { } // The file's now scoped out. - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); // Now the temporary file and the transient filesystem must be gone too. ASSERT_FALSE(base::PathExists(temp_path)); diff --git a/chromium/webkit/browser/fileapi/upload_file_system_file_element_reader_unittest.cc b/chromium/webkit/browser/fileapi/upload_file_system_file_element_reader_unittest.cc index e6e0d4cd2b4..429edf2fe05 100644 --- a/chromium/webkit/browser/fileapi/upload_file_system_file_element_reader_unittest.cc +++ b/chromium/webkit/browser/fileapi/upload_file_system_file_element_reader_unittest.cc @@ -5,13 +5,13 @@ #include "webkit/browser/fileapi/upload_file_system_file_element_reader.h" #include "base/files/scoped_temp_dir.h" -#include "base/message_loop/message_loop.h" +#include "base/run_loop.h" #include "net/base/io_buffer.h" #include "net/base/test_completion_callback.h" #include "testing/gtest/include/gtest/gtest.h" +#include "webkit/browser/fileapi/async_file_test_helper.h" #include "webkit/browser/fileapi/file_system_backend.h" #include "webkit/browser/fileapi/file_system_context.h" -#include "webkit/browser/fileapi/file_system_file_util.h" #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/mock_file_system_context.h" @@ -43,7 +43,7 @@ class UploadFileSystemFileElementReaderTest : public testing::Test { OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, base::Bind(&UploadFileSystemFileElementReaderTest::OnOpenFileSystem, base::Unretained(this))); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); ASSERT_TRUE(file_system_root_url_.is_valid()); // Prepare a file on file system. @@ -71,7 +71,7 @@ class UploadFileSystemFileElementReaderTest : public testing::Test { virtual void TearDown() OVERRIDE { reader_.reset(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } protected: @@ -89,31 +89,14 @@ class UploadFileSystemFileElementReaderTest : public testing::Test { kFileSystemType, base::FilePath().AppendASCII(filename)); - fileapi::FileSystemFileUtil* file_util = - file_system_context_->GetFileUtil(kFileSystemType); - - fileapi::FileSystemOperationContext context(file_system_context_.get()); - context.set_allowed_bytes_growth(1024); - - base::PlatformFile handle = base::kInvalidPlatformFileValue; - bool created = false; - ASSERT_EQ(base::PLATFORM_FILE_OK, file_util->CreateOrOpen( - &context, - url, - base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_WRITE, - &handle, - &created)); - EXPECT_TRUE(created); - ASSERT_NE(base::kInvalidPlatformFileValue, handle); - ASSERT_EQ(buf_size, - base::WritePlatformFile(handle, 0 /* offset */, buf, buf_size)); - base::ClosePlatformFile(handle); + ASSERT_EQ(base::PLATFORM_FILE_OK, + AsyncFileTestHelper::CreateFileWithData( + file_system_context_, url, buf, buf_size)); base::PlatformFileInfo file_info; - base::FilePath platform_path; ASSERT_EQ(base::PLATFORM_FILE_OK, - file_util->GetFileInfo(&context, url, &file_info, - &platform_path)); + AsyncFileTestHelper::GetMetadata( + file_system_context_, url, &file_info)); *modification_time = file_info.last_modified; } diff --git a/chromium/webkit/browser/quota/mock_quota_manager_unittest.cc b/chromium/webkit/browser/quota/mock_quota_manager_unittest.cc index d05addc9dba..fb3047d6e47 100644 --- a/chromium/webkit/browser/quota/mock_quota_manager_unittest.cc +++ b/chromium/webkit/browser/quota/mock_quota_manager_unittest.cc @@ -2,15 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - #include <set> #include "base/bind.h" #include "base/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_proxy.h" +#include "base/run_loop.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/quota/mock_quota_manager.h" #include "webkit/browser/quota/mock_special_storage_policy.h" @@ -52,7 +51,7 @@ class MockQuotaManagerTest : public testing::Test { virtual void TearDown() { // Make sure the quota manager cleans up correctly. manager_ = NULL; - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } void GetModifiedOrigins(StorageType type, base::Time since) { @@ -161,7 +160,7 @@ TEST_F(MockQuotaManagerTest, OriginDeletion) { base::Time::Now()); DeleteOriginData(kOrigin2, kTemporary, kClientFile); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(1, deletion_callback_count()); EXPECT_TRUE(manager()->OriginHasData(kOrigin1, kTemporary, kClientFile)); @@ -171,7 +170,7 @@ TEST_F(MockQuotaManagerTest, OriginDeletion) { EXPECT_TRUE(manager()->OriginHasData(kOrigin3, kTemporary, kClientDB)); DeleteOriginData(kOrigin3, kTemporary, kClientFile | kClientDB); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(2, deletion_callback_count()); EXPECT_TRUE(manager()->OriginHasData(kOrigin1, kTemporary, kClientFile)); @@ -188,13 +187,13 @@ TEST_F(MockQuotaManagerTest, ModifiedOrigins) { base::TimeDelta a_minute = base::TimeDelta::FromMilliseconds(60000); GetModifiedOrigins(kTemporary, then); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(origins().empty()); manager()->AddOrigin(kOrigin1, kTemporary, kClientFile, now - an_hour); GetModifiedOrigins(kTemporary, then); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kTemporary, type()); EXPECT_EQ(1UL, origins().size()); @@ -204,7 +203,7 @@ TEST_F(MockQuotaManagerTest, ModifiedOrigins) { manager()->AddOrigin(kOrigin2, kTemporary, kClientFile, now); GetModifiedOrigins(kTemporary, then); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kTemporary, type()); EXPECT_EQ(2UL, origins().size()); @@ -212,7 +211,7 @@ TEST_F(MockQuotaManagerTest, ModifiedOrigins) { EXPECT_EQ(1UL, origins().count(kOrigin2)); GetModifiedOrigins(kTemporary, now - a_minute); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kTemporary, type()); EXPECT_EQ(1UL, origins().size()); diff --git a/chromium/webkit/browser/quota/mock_storage_client.cc b/chromium/webkit/browser/quota/mock_storage_client.cc index 7e25654bd2b..61fd667a85a 100644 --- a/chromium/webkit/browser/quota/mock_storage_client.cc +++ b/chromium/webkit/browser/quota/mock_storage_client.cc @@ -121,6 +121,10 @@ void MockStorageClient::DeleteOriginData( weak_factory_.GetWeakPtr(), origin, type, callback)); } +bool MockStorageClient::DoesSupport(quota::StorageType type) const { + return true; +} + void MockStorageClient::RunGetOriginUsage( const GURL& origin_url, StorageType type, const GetUsageCallback& callback) { diff --git a/chromium/webkit/browser/quota/mock_storage_client.h b/chromium/webkit/browser/quota/mock_storage_client.h index 4b3d03fcc85..42c6162de49 100644 --- a/chromium/webkit/browser/quota/mock_storage_client.h +++ b/chromium/webkit/browser/quota/mock_storage_client.h @@ -59,6 +59,7 @@ class MockStorageClient : public QuotaClient { virtual void DeleteOriginData(const GURL& origin, StorageType type, const DeletionCallback& callback) OVERRIDE; + virtual bool DoesSupport(quota::StorageType type) const OVERRIDE; private: void RunGetOriginUsage(const GURL& origin_url, diff --git a/chromium/webkit/browser/quota/quota_client.h b/chromium/webkit/browser/quota/quota_client.h index eff1f1e8a87..5c0da46d87e 100644 --- a/chromium/webkit/browser/quota/quota_client.h +++ b/chromium/webkit/browser/quota/quota_client.h @@ -69,6 +69,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaClient { virtual void DeleteOriginData(const GURL& origin, StorageType type, const DeletionCallback& callback) = 0; + + virtual bool DoesSupport(StorageType type) const = 0; }; // TODO(dmikurube): Replace it to std::vector for efficiency. diff --git a/chromium/webkit/browser/quota/quota_manager_unittest.cc b/chromium/webkit/browser/quota/quota_manager_unittest.cc index 3b1d0680aa6..cb9ffea28e9 100644 --- a/chromium/webkit/browser/quota/quota_manager_unittest.cc +++ b/chromium/webkit/browser/quota/quota_manager_unittest.cc @@ -11,8 +11,8 @@ #include "base/files/scoped_temp_dir.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" -#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_proxy.h" +#include "base/run_loop.h" #include "base/stl_util.h" #include "base/sys_info.h" #include "base/time/time.h" @@ -69,7 +69,7 @@ class QuotaManagerTest : public testing::Test { virtual void TearDown() { // Make sure the quota manager cleans up correctly. quota_manager_ = NULL; - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } protected: @@ -456,7 +456,7 @@ TEST_F(QuotaManagerTest, GetUsageInfo) { QuotaClient::kDatabase)); GetUsageInfo(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(4U, usage_info().size()); for (size_t i = 0; i < usage_info().size(); ++i) { @@ -485,20 +485,20 @@ TEST_F(QuotaManagerTest, GetUsageAndQuota_Simple) { QuotaClient::kFileSystem)); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(80, usage()); EXPECT_EQ(0, quota()); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10, usage()); EXPECT_LE(0, quota()); int64 quota_returned_for_foo = quota(); GetUsageAndQuotaForWebApps(GURL("http://bar.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); EXPECT_EQ(quota_returned_for_foo, quota()); @@ -506,30 +506,30 @@ TEST_F(QuotaManagerTest, GetUsageAndQuota_Simple) { TEST_F(QuotaManagerTest, GetUsage_NoClient) { GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); EXPECT_EQ(0, unlimited_usage()); GetGlobalUsage(kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); EXPECT_EQ(0, unlimited_usage()); } @@ -537,30 +537,30 @@ TEST_F(QuotaManagerTest, GetUsage_NoClient) { TEST_F(QuotaManagerTest, GetUsage_EmptyClient) { RegisterClient(CreateClient(NULL, 0, QuotaClient::kFileSystem)); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); EXPECT_EQ(0, unlimited_usage()); GetGlobalUsage(kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); EXPECT_EQ(0, unlimited_usage()); } @@ -579,12 +579,12 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_MultiOrigins) { // This time explicitly sets a temporary global quota. SetTemporaryGlobalQuota(100); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(100, quota()); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10 + 20, usage()); @@ -595,7 +595,7 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_MultiOrigins) { EXPECT_EQ(kPerHostQuota, quota()); GetUsageAndQuotaForWebApps(GURL("http://bar.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(5 + 7, usage()); EXPECT_EQ(kPerHostQuota, quota()); @@ -626,52 +626,52 @@ TEST_F(QuotaManagerTest, GetUsage_MultipleClients) { GetAvailableDiskSpaceForTest(base::FilePath()) / kPerHostTemporaryPortion; GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(1 + 128, usage()); GetUsageAndQuotaForWebApps(GURL("http://bar.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(4, usage()); GetUsageAndQuotaForWebApps(GURL("http://unlimited/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(512, usage()); EXPECT_EQ(std::min(kAvailableSpaceForApp, kTempQuotaBase) + usage(), quota()); GetUsageAndQuotaForWebApps(GURL("http://unlimited/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(8, usage()); EXPECT_EQ(kAvailableSpaceForApp + usage(), quota()); GetAvailableSpace(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_LE(0, available_space()); GetUsageAndQuotaForWebApps(GURL("http://installed/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(1024, usage()); EXPECT_EQ(std::min(kAvailableSpaceForApp, kTempQuotaBase) + usage(), quota()); GetUsageAndQuotaForWebApps(GURL("http://installed/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(16, usage()); EXPECT_EQ(usage(), quota()); // Over-budget case. GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(1 + 2 + 128 + 512 + 1024, usage()); EXPECT_EQ(512, unlimited_usage()); GetGlobalUsage(kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(4 + 8 + 16 + 256, usage()); EXPECT_EQ(8, unlimited_usage()); @@ -687,7 +687,7 @@ void QuotaManagerTest::GetUsage_WithModifyTestBody(const StorageType type) { RegisterClient(client); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), type); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10 + 20, usage()); @@ -696,19 +696,19 @@ void QuotaManagerTest::GetUsage_WithModifyTestBody(const StorageType type) { client->AddOriginAndNotify(GURL("https://foo.com/"), type, 1); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), type); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10 + 20 + 30 - 5 + 1, usage()); int foo_usage = usage(); client->AddOriginAndNotify(GURL("http://bar.com/"), type, 40); GetUsageAndQuotaForWebApps(GURL("http://bar.com/"), type); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(40, usage()); GetGlobalUsage(type); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(foo_usage + 40, usage()); EXPECT_EQ(0, unlimited_usage()); } @@ -727,14 +727,14 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_WithAdditionalTasks) { RegisterClient(CreateClient(kData, ARRAYSIZE_UNSAFE(kData), QuotaClient::kFileSystem)); SetTemporaryGlobalQuota(100); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int kPerHostQuota = 100 / QuotaManager::kPerHostTemporaryPortion; GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10 + 20, usage()); EXPECT_EQ(kPerHostQuota, quota()); @@ -744,7 +744,7 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_WithAdditionalTasks) { kTemp); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); RunAdditionalUsageAndQuotaTask(GURL("http://bar.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10 + 20, usage()); EXPECT_EQ(kPerHostQuota, quota()); @@ -761,7 +761,7 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_NukeManager) { RegisterClient(CreateClient(kData, ARRAYSIZE_UNSAFE(kData), QuotaClient::kFileSystem)); SetTemporaryGlobalQuota(100); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); set_additional_callback_count(0); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); @@ -775,7 +775,7 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_NukeManager) { // Nuke before waiting for callbacks. set_quota_manager(NULL); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaErrorAbort, status()); } @@ -788,24 +788,24 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_Overbudget) { RegisterClient(CreateClient(kData, ARRAYSIZE_UNSAFE(kData), QuotaClient::kFileSystem)); SetTemporaryGlobalQuota(100); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int kPerHostQuota = 100 / QuotaManager::kPerHostTemporaryPortion; GetUsageAndQuotaForWebApps(GURL("http://usage1/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(1, usage()); EXPECT_EQ(1, quota()); // should be clamped to our current usage GetUsageAndQuotaForWebApps(GURL("http://usage10/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10, usage()); EXPECT_EQ(10, quota()); GetUsageAndQuotaForWebApps(GURL("http://usage200/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(200, usage()); EXPECT_EQ(kPerHostQuota, quota()); // should be clamped to the nominal quota @@ -824,10 +824,10 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_Unlimited) { // Test when not overbugdet. SetTemporaryGlobalQuota(1000); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(10 + 50 + 4000, usage()); EXPECT_EQ(4000, unlimited_usage()); @@ -835,56 +835,56 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_Unlimited) { 1000 / QuotaManager::kPerHostTemporaryPortion; GetUsageAndQuotaForWebApps(GURL("http://usage10/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10, usage()); EXPECT_EQ(kPerHostQuotaFor1000, quota()); GetUsageAndQuotaForWebApps(GURL("http://usage50/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(50, usage()); EXPECT_EQ(kPerHostQuotaFor1000, quota()); GetUsageAndQuotaForWebApps(GURL("http://unlimited/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(4000, usage()); EXPECT_EQ(kAvailableSpaceForApp + usage(), quota()); GetUsageAndQuotaForStorageClient(GURL("http://unlimited/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); EXPECT_EQ(QuotaManager::kNoLimit, quota()); // Test when overbugdet. SetTemporaryGlobalQuota(100); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int kPerHostQuotaFor100 = 100 / QuotaManager::kPerHostTemporaryPortion; GetUsageAndQuotaForWebApps(GURL("http://usage10/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10, usage()); EXPECT_EQ(kPerHostQuotaFor100, quota()); GetUsageAndQuotaForWebApps(GURL("http://usage50/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(50, usage()); EXPECT_EQ(kPerHostQuotaFor100, quota()); GetUsageAndQuotaForWebApps(GURL("http://unlimited/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(4000, usage()); EXPECT_EQ(kAvailableSpaceForApp + usage(), quota()); GetUsageAndQuotaForStorageClient(GURL("http://unlimited/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); EXPECT_EQ(QuotaManager::kNoLimit, quota()); @@ -894,30 +894,30 @@ TEST_F(QuotaManagerTest, GetTemporaryUsageAndQuota_Unlimited) { mock_special_storage_policy()->NotifyCleared(); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(10 + 50 + 4000, usage()); EXPECT_EQ(0, unlimited_usage()); GetUsageAndQuotaForWebApps(GURL("http://usage10/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10, usage()); EXPECT_EQ(10, quota()); // should be clamped to our current usage GetUsageAndQuotaForWebApps(GURL("http://usage50/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(50, usage()); EXPECT_EQ(kPerHostQuotaFor100, quota()); GetUsageAndQuotaForWebApps(GURL("http://unlimited/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(4000, usage()); EXPECT_EQ(kPerHostQuotaFor100, quota()); GetUsageAndQuotaForStorageClient(GURL("http://unlimited/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(4000, usage()); EXPECT_EQ(kPerHostQuotaFor100, quota()); @@ -949,11 +949,11 @@ TEST_F(QuotaManagerTest, GetAndSetPerststentHostQuota) { RegisterClient(CreateClient(NULL, 0, QuotaClient::kFileSystem)); GetPersistentHostQuota("foo.com"); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, quota()); SetPersistentHostQuota("foo.com", 100); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(100, quota()); GetPersistentHostQuota("foo.com"); @@ -961,7 +961,7 @@ TEST_F(QuotaManagerTest, GetAndSetPerststentHostQuota) { GetPersistentHostQuota("foo.com"); SetPersistentHostQuota("foo.com", 300000000000ll); GetPersistentHostQuota("foo.com"); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(300000000000ll, quota()); } @@ -969,14 +969,14 @@ TEST_F(QuotaManagerTest, GetAndSetPersistentUsageAndQuota) { RegisterClient(CreateClient(NULL, 0, QuotaClient::kFileSystem)); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); EXPECT_EQ(0, quota()); SetPersistentHostQuota("foo.com", 100); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); EXPECT_EQ(100, quota()); @@ -985,19 +985,19 @@ TEST_F(QuotaManagerTest, GetAndSetPersistentUsageAndQuota) { mock_special_storage_policy()->GrantQueryDiskSize(GURL("http://installed/")); SetPersistentHostQuota("installed", kAvailableSpaceForApp + 100); GetUsageAndQuotaForWebApps(GURL("http://installed/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kAvailableSpaceForApp, quota()); // Ditto for unlimited apps. mock_special_storage_policy()->AddUnlimited(GURL("http://unlimited/")); GetUsageAndQuotaForWebApps(GURL("http://unlimited/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kAvailableSpaceForApp, quota()); // GetUsageAndQuotaForStorageClient should just return 0 usage and // kNoLimit quota. GetUsageAndQuotaForStorageClient(GURL("http://unlimited/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(0, usage()); EXPECT_EQ(QuotaManager::kNoLimit, quota()); } @@ -1014,7 +1014,7 @@ TEST_F(QuotaManagerTest, GetSyncableQuota) { // kAvailableSpaceForApp as syncable quota (because of the pre-condition). mock_special_storage_policy()->GrantQueryDiskSize(GURL("http://installed/")); GetUsageAndQuotaForWebApps(GURL("http://installed/"), kSync); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); EXPECT_EQ(kAvailableSpaceForApp, quota()); @@ -1022,7 +1022,7 @@ TEST_F(QuotaManagerTest, GetSyncableQuota) { // If it's not installed (which shouldn't happen in real case) it // should just return the default host quota for syncable. GetUsageAndQuotaForWebApps(GURL("http://foo/"), kSync); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, usage()); EXPECT_EQ(QuotaManager::kSyncableStorageDefaultHostQuota, quota()); @@ -1044,7 +1044,7 @@ TEST_F(QuotaManagerTest, GetPersistentUsageAndQuota_MultiOrigins) { SetPersistentHostQuota("foo.com", 100); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10 + 20 + 13 + 19, usage()); EXPECT_EQ(100, quota()); @@ -1068,7 +1068,7 @@ TEST_F(QuotaManagerTest, GetPersistentUsageAndQuota_WithAdditionalTasks) { GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10 + 20, usage()); EXPECT_EQ(100, quota()); @@ -1078,7 +1078,7 @@ TEST_F(QuotaManagerTest, GetPersistentUsageAndQuota_WithAdditionalTasks) { kPerm); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); RunAdditionalUsageAndQuotaTask(GURL("http://bar.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10 + 20, usage()); EXPECT_EQ(2, additional_callback_count()); @@ -1102,7 +1102,7 @@ TEST_F(QuotaManagerTest, GetPersistentUsageAndQuota_NukeManager) { // Nuke before waiting for callbacks. set_quota_manager(NULL); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaErrorAbort, status()); } @@ -1120,21 +1120,21 @@ TEST_F(QuotaManagerTest, GetUsage_Simple) { QuotaClient::kFileSystem)); GetGlobalUsage(kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 1 + 20 + 600000); EXPECT_EQ(0, unlimited_usage()); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 300 + 4000 + 50000 + 7000000); EXPECT_EQ(0, unlimited_usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 1 + 20); GetHostUsage("buz.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 4000 + 50000); } @@ -1154,7 +1154,7 @@ TEST_F(QuotaManagerTest, GetUsage_WithModification) { RegisterClient(client); GetGlobalUsage(kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 1 + 20 + 600000); EXPECT_EQ(0, unlimited_usage()); @@ -1162,12 +1162,12 @@ TEST_F(QuotaManagerTest, GetUsage_WithModification) { GURL("http://foo.com/"), kPerm, 80000000); GetGlobalUsage(kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 1 + 20 + 600000 + 80000000); EXPECT_EQ(0, unlimited_usage()); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 300 + 4000 + 50000 + 7000000); EXPECT_EQ(0, unlimited_usage()); @@ -1175,19 +1175,19 @@ TEST_F(QuotaManagerTest, GetUsage_WithModification) { GURL("http://foo.com/"), kTemp, 1); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 300 + 4000 + 50000 + 7000000 + 1); EXPECT_EQ(0, unlimited_usage()); GetHostUsage("buz.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 4000 + 50000); client->ModifyOriginAndNotify( GURL("http://buz.com/"), kTemp, 900000000); GetHostUsage("buz.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(usage(), 4000 + 50000 + 900000000); } @@ -1203,38 +1203,38 @@ TEST_F(QuotaManagerTest, GetUsage_WithDeleteOrigin) { RegisterClient(client); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_global_tmp = usage(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_host_tmp = usage(); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_host_pers = usage(); DeleteClientOriginData(client, GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_global_tmp - 1, usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_tmp - 1, usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_pers, usage()); } TEST_F(QuotaManagerTest, GetAvailableSpaceTest) { GetAvailableSpace(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_LE(0, available_space()); } @@ -1261,15 +1261,15 @@ TEST_F(QuotaManagerTest, EvictOriginData) { RegisterClient(client2); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_global_tmp = usage(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_host_tmp = usage(); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_host_pers = usage(); for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kData1); ++i) @@ -1278,13 +1278,13 @@ TEST_F(QuotaManagerTest, EvictOriginData) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kData2); ++i) quota_manager()->NotifyStorageAccessed(QuotaClient::kUnknown, GURL(kData2[i].origin), kData2[i].type); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EvictOriginData(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); DumpOriginInfoTable(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); typedef OriginInfoTableEntries::const_iterator iterator; for (iterator itr(origin_info_entries().begin()), @@ -1295,15 +1295,15 @@ TEST_F(QuotaManagerTest, EvictOriginData) { } GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_global_tmp - (1 + 50000), usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_tmp - (1 + 50000), usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_pers, usage()); } @@ -1320,20 +1320,20 @@ TEST_F(QuotaManagerTest, EvictOriginDataWithDeletionError) { RegisterClient(client); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_global_tmp = usage(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_host_tmp = usage(); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_host_pers = usage(); for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kData); ++i) NotifyStorageAccessed(client, GURL(kData[i].origin), kData[i].type); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); client->AddOriginToErrorSet(GURL("http://foo.com/"), kTemp); @@ -1341,12 +1341,12 @@ TEST_F(QuotaManagerTest, EvictOriginDataWithDeletionError) { i < QuotaManager::kThresholdOfErrorsToBeBlacklisted + 1; ++i) { EvictOriginData(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaErrorInvalidModification, status()); } DumpOriginInfoTable(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); bool found_origin_in_database = false; typedef OriginInfoTableEntries::const_iterator iterator; @@ -1364,31 +1364,31 @@ TEST_F(QuotaManagerTest, EvictOriginDataWithDeletionError) { for (size_t i = 0; i < kNumberOfTemporaryOrigins - 1; ++i) { GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_FALSE(lru_origin().is_empty()); // The origin "http://foo.com/" should not be in the LRU list. EXPECT_NE(std::string("http://foo.com/"), lru_origin().spec()); DeleteOriginFromDatabase(lru_origin(), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } // Now the LRU list must be empty. GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(lru_origin().is_empty()); // Deleting origins from the database should not affect the results of the // following checks. GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_global_tmp, usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_tmp, usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_pers, usage()); } @@ -1406,10 +1406,10 @@ TEST_F(QuotaManagerTest, GetUsageAndQuotaForEviction) { RegisterClient(client); SetTemporaryGlobalQuota(10000000); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetUsageAndQuotaForEviction(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(21, limited_usage()); EXPECT_EQ(10000000, quota()); @@ -1425,47 +1425,47 @@ TEST_F(QuotaManagerTest, DeleteHostDataSimple) { RegisterClient(client); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_global_tmp = usage(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_host_tmp = usage(); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); int64 predelete_host_pers = usage(); DeleteHostData(std::string(), kTemp, kAllClients); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_global_tmp, usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_tmp, usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_pers, usage()); DeleteHostData("foo.com", kTemp, kAllClients); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_global_tmp - 1, usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_tmp - 1, usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_host_pers, usage()); } @@ -1491,35 +1491,35 @@ TEST_F(QuotaManagerTest, DeleteHostDataMultiple) { RegisterClient(client2); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_global_tmp = usage(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_foo_tmp = usage(); GetHostUsage("bar.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_bar_tmp = usage(); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_foo_pers = usage(); GetHostUsage("bar.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_bar_pers = usage(); reset_status_callback_count(); DeleteHostData("foo.com", kTemp, kAllClients); DeleteHostData("bar.com", kTemp, kAllClients); DeleteHostData("foo.com", kTemp, kAllClients); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(3, status_callback_count()); DumpOriginInfoTable(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); typedef OriginInfoTableEntries::const_iterator iterator; for (iterator itr(origin_info_entries().begin()), @@ -1534,24 +1534,24 @@ TEST_F(QuotaManagerTest, DeleteHostDataMultiple) { } GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_global_tmp - (1 + 20 + 4000 + 50000 + 6000 + 80 + 9), usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - (1 + 20 + 50000 + 6000 + 80), usage()); GetHostUsage("bar.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_bar_tmp - (4000 + 9), usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_pers, usage()); GetHostUsage("bar.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_bar_pers, usage()); } @@ -1579,23 +1579,23 @@ TEST_F(QuotaManagerTest, DeleteOriginDataMultiple) { RegisterClient(client2); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_global_tmp = usage(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_foo_tmp = usage(); GetHostUsage("bar.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_bar_tmp = usage(); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_foo_pers = usage(); GetHostUsage("bar.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_bar_pers = usage(); for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kData1); ++i) @@ -1604,18 +1604,18 @@ TEST_F(QuotaManagerTest, DeleteOriginDataMultiple) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kData2); ++i) quota_manager()->NotifyStorageAccessed(QuotaClient::kUnknown, GURL(kData2[i].origin), kData2[i].type); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); reset_status_callback_count(); DeleteOriginData(GURL("http://foo.com/"), kTemp, kAllClients); DeleteOriginData(GURL("http://bar.com/"), kTemp, kAllClients); DeleteOriginData(GURL("http://foo.com/"), kTemp, kAllClients); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(3, status_callback_count()); DumpOriginInfoTable(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); typedef OriginInfoTableEntries::const_iterator iterator; for (iterator itr(origin_info_entries().begin()), @@ -1628,23 +1628,23 @@ TEST_F(QuotaManagerTest, DeleteOriginDataMultiple) { } GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_global_tmp - (1 + 4000 + 50000 + 9), usage()); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - (1 + 50000), usage()); GetHostUsage("bar.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_bar_tmp - (4000 + 9), usage()); GetHostUsage("foo.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_pers, usage()); GetHostUsage("bar.com", kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_bar_pers, usage()); } @@ -1668,12 +1668,12 @@ TEST_F(QuotaManagerTest, GetCachedOrigins) { // No matter how we make queries the quota manager tries to cache all // the origins at startup. GetHostUsage("a.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetCachedOrigins(kTemp, &origins); EXPECT_EQ(3U, origins.size()); GetHostUsage("b.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetCachedOrigins(kTemp, &origins); EXPECT_EQ(3U, origins.size()); @@ -1681,7 +1681,7 @@ TEST_F(QuotaManagerTest, GetCachedOrigins) { EXPECT_TRUE(origins.empty()); GetGlobalUsage(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetCachedOrigins(kTemp, &origins); EXPECT_EQ(3U, origins.size()); @@ -1705,29 +1705,29 @@ TEST_F(QuotaManagerTest, NotifyAndLRUOrigin) { GURL origin; GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(lru_origin().is_empty()); NotifyStorageAccessed(client, GURL("http://a.com/"), kTemp); GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ("http://a.com/", lru_origin().spec()); NotifyStorageAccessed(client, GURL("http://b.com/"), kPerm); NotifyStorageAccessed(client, GURL("https://a.com/"), kTemp); NotifyStorageAccessed(client, GURL("http://c.com/"), kTemp); GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ("http://a.com/", lru_origin().spec()); DeleteOriginFromDatabase(lru_origin(), kTemp); GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ("https://a.com/", lru_origin().spec()); DeleteOriginFromDatabase(lru_origin(), kTemp); GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ("http://c.com/", lru_origin().spec()); } @@ -1745,7 +1745,7 @@ TEST_F(QuotaManagerTest, GetLRUOriginWithOriginInUse) { GURL origin; GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(lru_origin().is_empty()); NotifyStorageAccessed(client, GURL("http://a.com/"), kTemp); @@ -1754,19 +1754,19 @@ TEST_F(QuotaManagerTest, GetLRUOriginWithOriginInUse) { NotifyStorageAccessed(client, GURL("http://c.com/"), kTemp); GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ("http://a.com/", lru_origin().spec()); // Notify origin http://a.com is in use. NotifyOriginInUse(GURL("http://a.com/")); GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ("https://a.com/", lru_origin().spec()); // Notify origin https://a.com is in use while GetLRUOrigin is running. GetLRUOrigin(kTemp); NotifyOriginInUse(GURL("https://a.com/")); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); // Post-filtering must have excluded the returned origin, so we will // see empty result here. EXPECT_TRUE(lru_origin().is_empty()); @@ -1774,7 +1774,7 @@ TEST_F(QuotaManagerTest, GetLRUOriginWithOriginInUse) { // Notify access for http://c.com while GetLRUOrigin is running. GetLRUOrigin(kTemp); NotifyStorageAccessed(client, GURL("http://c.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); // Post-filtering must have excluded the returned origin, so we will // see empty result here. EXPECT_TRUE(lru_origin().is_empty()); @@ -1782,7 +1782,7 @@ TEST_F(QuotaManagerTest, GetLRUOriginWithOriginInUse) { NotifyOriginNoLongerInUse(GURL("http://a.com/")); NotifyOriginNoLongerInUse(GURL("https://a.com/")); GetLRUOrigin(kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ("http://a.com/", lru_origin().spec()); } @@ -1799,7 +1799,7 @@ TEST_F(QuotaManagerTest, GetOriginsModifiedSince) { RegisterClient(client); GetOriginsModifiedSince(kTemp, base::Time()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(modified_origins().empty()); EXPECT_EQ(modified_origins_type(), kTemp); @@ -1813,7 +1813,7 @@ TEST_F(QuotaManagerTest, GetOriginsModifiedSince) { base::Time time3 = client->IncrementMockTime(); GetOriginsModifiedSince(kTemp, time1); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(4U, modified_origins().size()); EXPECT_EQ(modified_origins_type(), kTemp); for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kData); ++i) { @@ -1822,18 +1822,18 @@ TEST_F(QuotaManagerTest, GetOriginsModifiedSince) { } GetOriginsModifiedSince(kTemp, time2); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(2U, modified_origins().size()); GetOriginsModifiedSince(kTemp, time3); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(modified_origins().empty()); EXPECT_EQ(modified_origins_type(), kTemp); client->ModifyOriginAndNotify(GURL("http://a.com/"), kTemp, 10); GetOriginsModifiedSince(kTemp, time3); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(1U, modified_origins().size()); EXPECT_EQ(1U, modified_origins().count(GURL("http://a.com/"))); EXPECT_EQ(modified_origins_type(), kTemp); @@ -1843,10 +1843,10 @@ TEST_F(QuotaManagerTest, DumpQuotaTable) { SetPersistentHostQuota("example1.com", 1); SetPersistentHostQuota("example2.com", 20); SetPersistentHostQuota("example3.com", 300); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); DumpQuotaTable(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const QuotaTableEntry kEntries[] = { QuotaTableEntry("example1.com", kPerm, 1), @@ -1882,10 +1882,10 @@ TEST_F(QuotaManagerTest, DumpOriginInfoTable) { QuotaClient::kUnknown, GURL("http://example.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); DumpOriginInfoTable(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); typedef std::pair<GURL, StorageType> TypedOrigin; typedef std::pair<TypedOrigin, int> Entry; @@ -1913,12 +1913,12 @@ TEST_F(QuotaManagerTest, DumpOriginInfoTable) { TEST_F(QuotaManagerTest, QuotaForEmptyHost) { GetPersistentHostQuota(std::string()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(0, quota()); SetPersistentHostQuota(std::string(), 10); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaErrorNotSupported, status()); } @@ -1949,32 +1949,32 @@ TEST_F(QuotaManagerTest, DeleteSpecificClientTypeSingleOrigin) { RegisterClient(client4); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_foo_tmp = usage(); DeleteOriginData(GURL("http://foo.com/"), kTemp, QuotaClient::kFileSystem); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 1, usage()); DeleteOriginData(GURL("http://foo.com/"), kTemp, QuotaClient::kAppcache); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 2 - 1, usage()); DeleteOriginData(GURL("http://foo.com/"), kTemp, QuotaClient::kDatabase); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 4 - 2 - 1, usage()); DeleteOriginData(GURL("http://foo.com/"), kTemp, QuotaClient::kIndexedDatabase); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 8 - 4 - 2 - 1, usage()); } @@ -2005,31 +2005,31 @@ TEST_F(QuotaManagerTest, DeleteSpecificClientTypeSingleHost) { RegisterClient(client4); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_foo_tmp = usage(); DeleteHostData("foo.com", kTemp, QuotaClient::kFileSystem); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 1, usage()); DeleteHostData("foo.com", kTemp, QuotaClient::kAppcache); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 2 - 1, usage()); DeleteHostData("foo.com", kTemp, QuotaClient::kDatabase); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 4 - 2 - 1, usage()); DeleteHostData("foo.com", kTemp, QuotaClient::kIndexedDatabase); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 8 - 4 - 2 - 1, usage()); } @@ -2060,21 +2060,21 @@ TEST_F(QuotaManagerTest, DeleteMultipleClientTypesSingleOrigin) { RegisterClient(client4); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_foo_tmp = usage(); DeleteOriginData(GURL("http://foo.com/"), kTemp, QuotaClient::kFileSystem | QuotaClient::kDatabase); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 4 - 1, usage()); DeleteOriginData(GURL("http://foo.com/"), kTemp, QuotaClient::kAppcache | QuotaClient::kIndexedDatabase); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 8 - 4 - 2 - 1, usage()); } @@ -2105,21 +2105,21 @@ TEST_F(QuotaManagerTest, DeleteMultipleClientTypesSingleHost) { RegisterClient(client4); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); const int64 predelete_foo_tmp = usage(); DeleteHostData("foo.com", kTemp, QuotaClient::kFileSystem | QuotaClient::kAppcache); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 2 - 1, usage()); DeleteHostData("foo.com", kTemp, QuotaClient::kDatabase | QuotaClient::kIndexedDatabase); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); GetHostUsage("foo.com", kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(predelete_foo_tmp - 8 - 4 - 2 - 1, usage()); } @@ -2134,14 +2134,14 @@ TEST_F(QuotaManagerTest, GetUsageAndQuota_Incognito) { QuotaClient::kFileSystem)); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(80, usage()); EXPECT_EQ(0, quota()); SetTemporaryGlobalQuota(100); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10, usage()); EXPECT_LE(std::min(static_cast<int64>(100 / kPerHostTemporaryPortion), @@ -2149,13 +2149,13 @@ TEST_F(QuotaManagerTest, GetUsageAndQuota_Incognito) { mock_special_storage_policy()->AddUnlimited(GURL("http://foo.com/")); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kPerm); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(80, usage()); EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); GetUsageAndQuotaForWebApps(GURL("http://foo.com/"), kTemp); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(kQuotaStatusOk, status()); EXPECT_EQ(10, usage()); EXPECT_EQ(QuotaManager::kIncognitoDefaultQuotaLimit, quota()); diff --git a/chromium/webkit/browser/quota/quota_temporary_storage_evictor_unittest.cc b/chromium/webkit/browser/quota/quota_temporary_storage_evictor_unittest.cc index e540a98df04..941facf5267 100644 --- a/chromium/webkit/browser/quota/quota_temporary_storage_evictor_unittest.cc +++ b/chromium/webkit/browser/quota/quota_temporary_storage_evictor_unittest.cc @@ -10,8 +10,8 @@ #include "base/callback.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" -#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_proxy.h" +#include "base/run_loop.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/quota/mock_storage_client.h" #include "webkit/browser/quota/quota_manager.h" @@ -131,7 +131,7 @@ class MockQuotaEvictionHandler : public quota::QuotaEvictionHandler { base::Closure task_for_get_usage_and_quota_; }; -} // anonymous namespace +} // namespace class QuotaTemporaryStorageEvictorTest : public testing::Test { public: @@ -150,7 +150,7 @@ class QuotaTemporaryStorageEvictorTest : public testing::Test { virtual void TearDown() { temporary_storage_evictor_.reset(); quota_eviction_handler_.reset(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } void TaskForRepeatedEvictionTest( @@ -234,7 +234,7 @@ TEST_F(QuotaTemporaryStorageEvictorTest, SimpleEvictionTest) { EXPECT_EQ(3000 + 200 + 500, quota_eviction_handler()->GetUsage()); set_repeated_eviction(false); temporary_storage_evictor()->Start(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(200 + 500, quota_eviction_handler()->GetUsage()); EXPECT_EQ(0, statistics().num_errors_on_evicting_origin); @@ -254,7 +254,7 @@ TEST_F(QuotaTemporaryStorageEvictorTest, MultipleEvictionTest) { EXPECT_EQ(20 + 2900 + 450 + 400, quota_eviction_handler()->GetUsage()); set_repeated_eviction(false); temporary_storage_evictor()->Start(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(450 + 400, quota_eviction_handler()->GetUsage()); EXPECT_EQ(0, statistics().num_errors_on_evicting_origin); @@ -286,7 +286,7 @@ TEST_F(QuotaTemporaryStorageEvictorTest, RepeatedEvictionTest) { initial_total_size - d_size + e_size - c_size)); EXPECT_EQ(initial_total_size, quota_eviction_handler()->GetUsage()); temporary_storage_evictor()->Start(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(initial_total_size - d_size + e_size - c_size - b_size, quota_eviction_handler()->GetUsage()); EXPECT_EQ(5, num_get_usage_and_quota_for_eviction()); @@ -318,7 +318,7 @@ TEST_F(QuotaTemporaryStorageEvictorTest, RepeatedEvictionSkippedTest) { EXPECT_EQ(initial_total_size, quota_eviction_handler()->GetUsage()); set_repeated_eviction(true); temporary_storage_evictor()->Start(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(initial_total_size - d_size, quota_eviction_handler()->GetUsage()); EXPECT_EQ(4, num_get_usage_and_quota_for_eviction()); @@ -352,7 +352,7 @@ TEST_F(QuotaTemporaryStorageEvictorTest, RepeatedEvictionWithAccessOriginTest) { initial_total_size - d_size + e_size - b_size)); EXPECT_EQ(initial_total_size, quota_eviction_handler()->GetUsage()); temporary_storage_evictor()->Start(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(initial_total_size - d_size + e_size - b_size - a_size, quota_eviction_handler()->GetUsage()); EXPECT_EQ(5, num_get_usage_and_quota_for_eviction()); @@ -374,7 +374,7 @@ TEST_F(QuotaTemporaryStorageEvictorTest, DiskSpaceNonEvictionTest) { reset_min_available_disk_space_to_start_eviction(); set_repeated_eviction(false); temporary_storage_evictor()->Start(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(414 + 450, quota_eviction_handler()->GetUsage()); EXPECT_EQ(0, statistics().num_errors_on_evicting_origin); @@ -397,7 +397,7 @@ TEST_F(QuotaTemporaryStorageEvictorTest, DiskSpaceEvictionTest) { default_min_available_disk_space_to_start_eviction()); set_repeated_eviction(false); temporary_storage_evictor()->Start(); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_EQ(150 + 300, quota_eviction_handler()->GetUsage()); EXPECT_EQ(0, statistics().num_errors_on_evicting_origin); diff --git a/chromium/webkit/browser/quota/usage_tracker.cc b/chromium/webkit/browser/quota/usage_tracker.cc index 4bf64880c3c..57b5e0d24ea 100644 --- a/chromium/webkit/browser/quota/usage_tracker.cc +++ b/chromium/webkit/browser/quota/usage_tracker.cc @@ -78,8 +78,10 @@ UsageTracker::UsageTracker(const QuotaClientList& clients, for (QuotaClientList::const_iterator iter = clients.begin(); iter != clients.end(); ++iter) { - client_tracker_map_[(*iter)->id()] = - new ClientUsageTracker(this, *iter, type, special_storage_policy); + if ((*iter)->DoesSupport(type)) { + client_tracker_map_[(*iter)->id()] = + new ClientUsageTracker(this, *iter, type, special_storage_policy); + } } } diff --git a/chromium/webkit/browser/quota/usage_tracker_unittest.cc b/chromium/webkit/browser/quota/usage_tracker_unittest.cc index 985db2d8258..4eaf68b1b2f 100644 --- a/chromium/webkit/browser/quota/usage_tracker_unittest.cc +++ b/chromium/webkit/browser/quota/usage_tracker_unittest.cc @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "base/bind.h" -#include "base/message_loop/message_loop.h" +#include "base/run_loop.h" #include "net/base/net_util.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/browser/quota/mock_special_storage_policy.h" @@ -89,6 +89,10 @@ class MockQuotaClient : public QuotaClient { FROM_HERE, base::Bind(callback, kQuotaStatusOk)); } + virtual bool DoesSupport(quota::StorageType type) const OVERRIDE { + return type == quota::kStorageTypeTemporary; + } + int64 GetUsage(const GURL& origin) { UsageMap::const_iterator found = usage_map_.find(origin); if (found == usage_map_.end()) @@ -129,7 +133,7 @@ class UsageTrackerTest : public testing::Test { void UpdateUsage(const GURL& origin, int64 delta) { quota_client_.UpdateUsage(origin, delta); usage_tracker_.UpdateUsageCache(quota_client_.id(), origin, delta); - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); } void UpdateUsageWithoutNotification(const GURL& origin, int64 delta) { @@ -140,7 +144,7 @@ class UsageTrackerTest : public testing::Test { bool done = false; usage_tracker_.GetGlobalLimitedUsage(base::Bind( &DidGetUsage, &done, limited_usage)); - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(done); } @@ -150,7 +154,7 @@ class UsageTrackerTest : public testing::Test { usage_tracker_.GetGlobalUsage(base::Bind( &DidGetGlobalUsage, &done, usage, unlimited_usage)); - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(done); } @@ -158,7 +162,7 @@ class UsageTrackerTest : public testing::Test { void GetHostUsage(const std::string& host, int64* usage) { bool done = false; usage_tracker_.GetHostUsage(host, base::Bind(&DidGetUsage, &done, usage)); - message_loop_.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(done); } diff --git a/chromium/webkit/child/resource_loader_bridge.h b/chromium/webkit/child/resource_loader_bridge.h index 9d51b62f460..f1bedecb94d 100644 --- a/chromium/webkit/child/resource_loader_bridge.h +++ b/chromium/webkit/child/resource_loader_bridge.h @@ -127,7 +127,7 @@ class ResourceLoaderBridge { // These callbacks mirror net::URLRequest::Delegate and the order and // conditions in which they will be called are identical. See url_request.h // for more information. - class Peer { + class WEBKIT_CHILD_EXPORT Peer { public: // Called as upload progress is made. // note: only for requests with LOAD_ENABLE_UPLOAD_PROGRESS set @@ -153,13 +153,18 @@ class ResourceLoaderBridge { // called multiple times or not at all if an error occurs. This method is // only called if RequestInfo::download_to_file was set to true, and in // that case, OnReceivedData will not be called. - virtual void OnDownloadedData(int len) = 0; + // The encoded_data_length is the length of the encoded data transferred + // over the network, which could be different from data length (e.g. for + // gzipped content), or -1 if unknown. It is only valid while devtools are + // attached. Otherwise it becomes -1. + virtual void OnDownloadedData(int len, int encoded_data_length) = 0; // Called when a chunk of response data is available. This method may // be called multiple times or not at all if an error occurs. // The encoded_data_length is the length of the encoded data transferred // over the network, which could be different from data length (e.g. for - // gzipped content), or -1 if if unknown. + // gzipped content), or -1 if unknown. It is only valid while devtools are + // attached. Otherwise it becomes -1. virtual void OnReceivedData(const char* data, int data_length, int encoded_data_length) = 0; diff --git a/chromium/webkit/child/webkitplatformsupport_impl.cc b/chromium/webkit/child/webkitplatformsupport_impl.cc index ccd988a1ebb..82b8dd3539c 100644 --- a/chromium/webkit/child/webkitplatformsupport_impl.cc +++ b/chromium/webkit/child/webkitplatformsupport_impl.cc @@ -24,6 +24,7 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/synchronization/lock.h" +#include "base/sys_info.h" #include "base/time/time.h" #include "content/public/common/webplugininfo.h" #include "grit/blink_resources.h" @@ -51,6 +52,10 @@ #include "webkit/common/user_agent/user_agent.h" #include "webkit/glue/webkit_glue.h" +#if defined(OS_ANDROID) +#include "base/android/sys_utils.h" +#endif + using WebKit::WebAudioBus; using WebKit::WebCookie; using WebKit::WebData; @@ -307,16 +312,36 @@ static int ToMessageID(WebLocalizedString::Name name) { return IDS_FORM_VALIDATION_PATTERN_MISMATCH; case WebLocalizedString::ValidationRangeOverflow: return IDS_FORM_VALIDATION_RANGE_OVERFLOW; + case WebLocalizedString::ValidationRangeOverflowDateTime: + return IDS_FORM_VALIDATION_RANGE_OVERFLOW_DATETIME; case WebLocalizedString::ValidationRangeUnderflow: return IDS_FORM_VALIDATION_RANGE_UNDERFLOW; + case WebLocalizedString::ValidationRangeUnderflowDateTime: + return IDS_FORM_VALIDATION_RANGE_UNDERFLOW_DATETIME; case WebLocalizedString::ValidationStepMismatch: return IDS_FORM_VALIDATION_STEP_MISMATCH; + case WebLocalizedString::ValidationStepMismatchCloseToLimit: + return IDS_FORM_VALIDATION_STEP_MISMATCH_CLOSE_TO_LIMIT; case WebLocalizedString::ValidationTooLong: return IDS_FORM_VALIDATION_TOO_LONG; case WebLocalizedString::ValidationTypeMismatch: return IDS_FORM_VALIDATION_TYPE_MISMATCH; case WebLocalizedString::ValidationTypeMismatchForEmail: return IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL; + case WebLocalizedString::ValidationTypeMismatchForEmailEmpty: + return IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_EMPTY; + case WebLocalizedString::ValidationTypeMismatchForEmailEmptyDomain: + return IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_EMPTY_DOMAIN; + case WebLocalizedString::ValidationTypeMismatchForEmailEmptyLocal: + return IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_EMPTY_LOCAL; + case WebLocalizedString::ValidationTypeMismatchForEmailInvalidDomain: + return IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_INVALID_DOMAIN; + case WebLocalizedString::ValidationTypeMismatchForEmailInvalidDots: + return IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_INVALID_DOTS; + case WebLocalizedString::ValidationTypeMismatchForEmailInvalidLocal: + return IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_INVALID_LOCAL; + case WebLocalizedString::ValidationTypeMismatchForEmailNoAtSign: + return IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_NO_AT_SIGN; case WebLocalizedString::ValidationTypeMismatchForMultipleEmail: return IDS_FORM_VALIDATION_TYPE_MISMATCH_MULTIPLE_EMAIL; case WebLocalizedString::ValidationTypeMismatchForURL: @@ -605,6 +630,7 @@ const DataResource kDataResources[] = { #endif #if defined(OS_MACOSX) { "overhangPattern", IDR_OVERHANG_PATTERN, ui::SCALE_FACTOR_100P }, + { "overhangShadow", IDR_OVERHANG_SHADOW, ui::SCALE_FACTOR_100P }, #endif { "panIcon", IDR_PAN_SCROLL_ICON, ui::SCALE_FACTOR_100P }, { "searchCancel", IDR_SEARCH_CANCEL, ui::SCALE_FACTOR_100P }, @@ -862,6 +888,21 @@ bool WebKitPlatformSupportImpl::memoryAllocatorWasteInBytes(size_t* size) { return base::allocator::GetAllocatorWasteSize(size); } +size_t WebKitPlatformSupportImpl::maxDecodedImageBytes() { +#if defined(OS_ANDROID) + if (base::android::SysUtils::IsLowEndDevice()) { + // Limit image decoded size to 3M pixels on low end devices. + // 4 is maximum number of bytes per pixel. + return 3 * 1024 * 1024 * 4; + } + // For other devices, limit decoded image size based on the amount of physical + // memory. For a device with 2GB physical memory the limit is 16M pixels. + return base::SysInfo::AmountOfPhysicalMemory() / 32; +#else + return noDecodedImageByteLimit; +#endif +} + void WebKitPlatformSupportImpl::SuspendSharedTimer() { ++shared_timer_suspended_; } diff --git a/chromium/webkit/child/webkitplatformsupport_impl.h b/chromium/webkit/child/webkitplatformsupport_impl.h index b9ed7e85f13..8f2a6e14722 100644 --- a/chromium/webkit/child/webkitplatformsupport_impl.h +++ b/chromium/webkit/child/webkitplatformsupport_impl.h @@ -58,6 +58,7 @@ class WEBKIT_CHILD_EXPORT WebKitPlatformSupportImpl : virtual bool processMemorySizesInBytes(size_t* private_bytes, size_t* shared_bytes); virtual bool memoryAllocatorWasteInBytes(size_t* size); + virtual size_t maxDecodedImageBytes() OVERRIDE; virtual WebKit::WebURLLoader* createURLLoader(); virtual WebKit::WebSocketStreamHandle* createSocketStreamHandle(); virtual WebKit::WebString userAgent(const WebKit::WebURL& url); diff --git a/chromium/webkit/child/websocketstreamhandle_bridge.h b/chromium/webkit/child/websocketstreamhandle_bridge.h index 0de4265a338..23f5c6a1cbd 100644 --- a/chromium/webkit/child/websocketstreamhandle_bridge.h +++ b/chromium/webkit/child/websocketstreamhandle_bridge.h @@ -12,14 +12,8 @@ class GURL; -namespace WebKit { -class WebSocketStreamHandle; -} - namespace webkit_glue { -class WebSocketStreamHandleDelegate; - class WebSocketStreamHandleBridge : public base::RefCountedThreadSafe<WebSocketStreamHandleBridge> { public: diff --git a/chromium/webkit/child/webthemeengine_impl_win.cc b/chromium/webkit/child/webthemeengine_impl_win.cc index e4d05b3a41a..32b071e26b7 100644 --- a/chromium/webkit/child/webthemeengine_impl_win.cc +++ b/chromium/webkit/child/webthemeengine_impl_win.cc @@ -10,7 +10,7 @@ #include "skia/ext/platform_canvas.h" #include "skia/ext/skia_utils_win.h" #include "third_party/WebKit/public/platform/WebRect.h" -#include "ui/base/win/dpi.h" +#include "ui/gfx/win/dpi.h" #include "ui/native_theme/native_theme.h" using WebKit::WebCanvas; @@ -1000,7 +1000,7 @@ WebSize WebThemeEngineImpl::getSize(int part) { // metric if required. if (size.width() == 0) { int width = static_cast<int>(GetSystemMetrics(SM_CXVSCROLL) / - ui::win::GetDeviceScaleFactor()); + gfx::win::GetDeviceScaleFactor()); size = gfx::Size(width, width); } return WebSize(size.width(), size.height()); diff --git a/chromium/webkit/child/weburlloader_impl.cc b/chromium/webkit/child/weburlloader_impl.cc index 63ce778da19..8de875279af 100644 --- a/chromium/webkit/child/weburlloader_impl.cc +++ b/chromium/webkit/child/weburlloader_impl.cc @@ -71,14 +71,13 @@ class HeaderFlattener : public WebHTTPHeaderVisitor { } virtual void visitHeader(const WebString& name, const WebString& value) { - // TODO(darin): is UTF-8 really correct here? It is if the strings are - // already ASCII (i.e., if they are already escaped properly). - const std::string& name_utf8 = name.utf8(); - const std::string& value_utf8 = value.utf8(); + // Headers are latin1. + const std::string& name_latin1 = name.latin1(); + const std::string& value_latin1 = value.latin1(); // Skip over referrer headers found in the header map because we already // pulled it out as a separate parameter. - if (LowerCaseEqualsASCII(name_utf8, "referer")) + if (LowerCaseEqualsASCII(name_latin1, "referer")) return; // Skip over "Cache-Control: max-age=0" header if the corresponding @@ -87,16 +86,16 @@ class HeaderFlattener : public WebHTTPHeaderVisitor { // implementation will add the necessary headers based on load flags. // See http://code.google.com/p/chromium/issues/detail?id=3434. if ((load_flags_ & net::LOAD_VALIDATE_CACHE) && - LowerCaseEqualsASCII(name_utf8, "cache-control") && - LowerCaseEqualsASCII(value_utf8, "max-age=0")) + LowerCaseEqualsASCII(name_latin1, "cache-control") && + LowerCaseEqualsASCII(value_latin1, "max-age=0")) return; - if (LowerCaseEqualsASCII(name_utf8, "accept")) + if (LowerCaseEqualsASCII(name_latin1, "accept")) has_accept_header_ = true; if (!buffer_.empty()) buffer_.append("\r\n"); - buffer_.append(name_utf8 + ": " + value_utf8); + buffer_.append(name_latin1 + ": " + value_latin1); } const std::string& GetBuffer() { @@ -181,115 +180,6 @@ void PopulateURLLoadTiming(const net::LoadTimingInfo& load_timing, (load_timing.receive_headers_end - kNullTicks).InSecondsF()); } -void PopulateURLResponse( - const GURL& url, - const ResourceResponseInfo& info, - WebURLResponse* response) { - response->setURL(url); - response->setResponseTime(info.response_time.ToDoubleT()); - response->setMIMEType(WebString::fromUTF8(info.mime_type)); - response->setTextEncodingName(WebString::fromUTF8(info.charset)); - response->setExpectedContentLength(info.content_length); - response->setSecurityInfo(info.security_info); - response->setAppCacheID(info.appcache_id); - response->setAppCacheManifestURL(info.appcache_manifest_url); - response->setWasCached(!info.load_timing.request_start_time.is_null() && - info.response_time < info.load_timing.request_start_time); - response->setRemoteIPAddress( - WebString::fromUTF8(info.socket_address.host())); - response->setRemotePort(info.socket_address.port()); - response->setConnectionID(info.load_timing.socket_log_id); - response->setConnectionReused(info.load_timing.socket_reused); - response->setDownloadFilePath(info.download_file_path.AsUTF16Unsafe()); - WebURLResponseExtraDataImpl* extra_data = - new WebURLResponseExtraDataImpl(info.npn_negotiated_protocol); - response->setExtraData(extra_data); - extra_data->set_was_fetched_via_spdy(info.was_fetched_via_spdy); - extra_data->set_was_npn_negotiated(info.was_npn_negotiated); - extra_data->set_was_alternate_protocol_available( - info.was_alternate_protocol_available); - extra_data->set_connection_info(info.connection_info); - extra_data->set_was_fetched_via_proxy(info.was_fetched_via_proxy); - - // If there's no received headers end time, don't set load timing. This is - // the case for non-HTTP requests, requests that don't go over the wire, and - // certain error cases. - if (!info.load_timing.receive_headers_end.is_null()) { - WebURLLoadTiming timing; - PopulateURLLoadTiming(info.load_timing, &timing); - response->setLoadTiming(timing); - } - - if (info.devtools_info.get()) { - WebHTTPLoadInfo load_info; - - load_info.setHTTPStatusCode(info.devtools_info->http_status_code); - load_info.setHTTPStatusText(WebString::fromUTF8( - info.devtools_info->http_status_text)); - load_info.setEncodedDataLength(info.encoded_data_length); - - load_info.setRequestHeadersText(WebString::fromUTF8( - info.devtools_info->request_headers_text)); - load_info.setResponseHeadersText(WebString::fromUTF8( - info.devtools_info->response_headers_text)); - const HeadersVector& request_headers = info.devtools_info->request_headers; - for (HeadersVector::const_iterator it = request_headers.begin(); - it != request_headers.end(); ++it) { - load_info.addRequestHeader(WebString::fromUTF8(it->first), - WebString::fromUTF8(it->second)); - } - const HeadersVector& response_headers = - info.devtools_info->response_headers; - for (HeadersVector::const_iterator it = response_headers.begin(); - it != response_headers.end(); ++it) { - load_info.addResponseHeader(WebString::fromUTF8(it->first), - WebString::fromUTF8(it->second)); - } - response->setHTTPLoadInfo(load_info); - } - - const net::HttpResponseHeaders* headers = info.headers.get(); - if (!headers) - return; - - WebURLResponse::HTTPVersion version = WebURLResponse::Unknown; - if (headers->GetHttpVersion() == net::HttpVersion(0, 9)) - version = WebURLResponse::HTTP_0_9; - else if (headers->GetHttpVersion() == net::HttpVersion(1, 0)) - version = WebURLResponse::HTTP_1_0; - else if (headers->GetHttpVersion() == net::HttpVersion(1, 1)) - version = WebURLResponse::HTTP_1_1; - response->setHTTPVersion(version); - response->setHTTPStatusCode(headers->response_code()); - response->setHTTPStatusText(WebString::fromUTF8(headers->GetStatusText())); - - // TODO(darin): We should leverage HttpResponseHeaders for this, and this - // should be using the same code as ResourceDispatcherHost. - // TODO(jungshik): Figure out the actual value of the referrer charset and - // pass it to GetSuggestedFilename. - std::string value; - headers->EnumerateHeader(NULL, "content-disposition", &value); - response->setSuggestedFileName( - net::GetSuggestedFilename(url, - value, - std::string(), // referrer_charset - std::string(), // suggested_name - std::string(), // mime_type - std::string())); // default_name - - Time time_val; - if (headers->GetLastModifiedValue(&time_val)) - response->setLastModifiedDate(time_val.ToDoubleT()); - - // Build up the header map. - void* iter = NULL; - std::string name; - while (headers->EnumerateHeaderLines(&iter, &name, &value)) { - response->addHTTPHeaderField(WebString::fromUTF8(name), - WebString::fromUTF8(value)); - } -} - net::RequestPriority ConvertWebKitPriorityToNetPriority( const WebURLRequest::Priority& priority) { switch (priority) { @@ -346,7 +236,7 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>, bool* has_new_first_party_for_cookies, GURL* new_first_party_for_cookies) OVERRIDE; virtual void OnReceivedResponse(const ResourceResponseInfo& info) OVERRIDE; - virtual void OnDownloadedData(int len) OVERRIDE; + virtual void OnDownloadedData(int len, int encoded_data_length) OVERRIDE; virtual void OnReceivedData(const char* data, int data_length, int encoded_data_length) OVERRIDE; @@ -435,8 +325,8 @@ void WebURLLoaderImpl::Context::Start( } GURL referrer_url( - request.httpHeaderField(WebString::fromUTF8("Referer")).utf8()); - const std::string& method = request.httpMethod().utf8(); + request.httpHeaderField(WebString::fromUTF8("Referer")).latin1()); + const std::string& method = request.httpMethod().latin1(); int load_flags = net::LOAD_NORMAL; switch (request.cachePolicy()) { @@ -532,7 +422,7 @@ void WebURLLoaderImpl::Context::Start( base::Time::FromDoubleT(element.modificationTime)); } break; - case WebHTTPBody::Element::TypeURL: { + case WebHTTPBody::Element::TypeFileSystemURL: { GURL url = GURL(element.url); DCHECK(url.SchemeIsFileSystem()); request_body->AppendFileSystemFileRange( @@ -543,7 +433,7 @@ void WebURLLoaderImpl::Context::Start( break; } case WebHTTPBody::Element::TypeBlob: - request_body->AppendBlob(GURL(element.blobURL)); + request_body->AppendBlobDeprecated(GURL(element.blobURL)); break; default: NOTREACHED(); @@ -670,9 +560,10 @@ void WebURLLoaderImpl::Context::OnReceivedResponse( } } -void WebURLLoaderImpl::Context::OnDownloadedData(int len) { +void WebURLLoaderImpl::Context::OnDownloadedData(int len, + int encoded_data_length) { if (client_) - client_->didDownloadData(loader_, len); + client_->didDownloadData(loader_, len, encoded_data_length); } void WebURLLoaderImpl::Context::OnReceivedData(const char* data, @@ -804,6 +695,114 @@ WebURLError WebURLLoaderImpl::CreateError(const WebURL& unreachable_url, return error; } +void WebURLLoaderImpl::PopulateURLResponse(const GURL& url, + const ResourceResponseInfo& info, + WebURLResponse* response) { + response->setURL(url); + response->setResponseTime(info.response_time.ToDoubleT()); + response->setMIMEType(WebString::fromUTF8(info.mime_type)); + response->setTextEncodingName(WebString::fromUTF8(info.charset)); + response->setExpectedContentLength(info.content_length); + response->setSecurityInfo(info.security_info); + response->setAppCacheID(info.appcache_id); + response->setAppCacheManifestURL(info.appcache_manifest_url); + response->setWasCached(!info.load_timing.request_start_time.is_null() && + info.response_time < info.load_timing.request_start_time); + response->setRemoteIPAddress( + WebString::fromUTF8(info.socket_address.host())); + response->setRemotePort(info.socket_address.port()); + response->setConnectionID(info.load_timing.socket_log_id); + response->setConnectionReused(info.load_timing.socket_reused); + response->setDownloadFilePath(info.download_file_path.AsUTF16Unsafe()); + WebURLResponseExtraDataImpl* extra_data = + new WebURLResponseExtraDataImpl(info.npn_negotiated_protocol); + response->setExtraData(extra_data); + extra_data->set_was_fetched_via_spdy(info.was_fetched_via_spdy); + extra_data->set_was_npn_negotiated(info.was_npn_negotiated); + extra_data->set_was_alternate_protocol_available( + info.was_alternate_protocol_available); + extra_data->set_connection_info(info.connection_info); + extra_data->set_was_fetched_via_proxy(info.was_fetched_via_proxy); + + // If there's no received headers end time, don't set load timing. This is + // the case for non-HTTP requests, requests that don't go over the wire, and + // certain error cases. + if (!info.load_timing.receive_headers_end.is_null()) { + WebURLLoadTiming timing; + PopulateURLLoadTiming(info.load_timing, &timing); + response->setLoadTiming(timing); + } + + if (info.devtools_info.get()) { + WebHTTPLoadInfo load_info; + + load_info.setHTTPStatusCode(info.devtools_info->http_status_code); + load_info.setHTTPStatusText(WebString::fromLatin1( + info.devtools_info->http_status_text)); + load_info.setEncodedDataLength(info.encoded_data_length); + + load_info.setRequestHeadersText(WebString::fromLatin1( + info.devtools_info->request_headers_text)); + load_info.setResponseHeadersText(WebString::fromLatin1( + info.devtools_info->response_headers_text)); + const HeadersVector& request_headers = info.devtools_info->request_headers; + for (HeadersVector::const_iterator it = request_headers.begin(); + it != request_headers.end(); ++it) { + load_info.addRequestHeader(WebString::fromLatin1(it->first), + WebString::fromLatin1(it->second)); + } + const HeadersVector& response_headers = + info.devtools_info->response_headers; + for (HeadersVector::const_iterator it = response_headers.begin(); + it != response_headers.end(); ++it) { + load_info.addResponseHeader(WebString::fromLatin1(it->first), + WebString::fromLatin1(it->second)); + } + response->setHTTPLoadInfo(load_info); + } + + const net::HttpResponseHeaders* headers = info.headers.get(); + if (!headers) + return; + + WebURLResponse::HTTPVersion version = WebURLResponse::Unknown; + if (headers->GetHttpVersion() == net::HttpVersion(0, 9)) + version = WebURLResponse::HTTP_0_9; + else if (headers->GetHttpVersion() == net::HttpVersion(1, 0)) + version = WebURLResponse::HTTP_1_0; + else if (headers->GetHttpVersion() == net::HttpVersion(1, 1)) + version = WebURLResponse::HTTP_1_1; + response->setHTTPVersion(version); + response->setHTTPStatusCode(headers->response_code()); + response->setHTTPStatusText(WebString::fromLatin1(headers->GetStatusText())); + + // TODO(darin): We should leverage HttpResponseHeaders for this, and this + // should be using the same code as ResourceDispatcherHost. + // TODO(jungshik): Figure out the actual value of the referrer charset and + // pass it to GetSuggestedFilename. + std::string value; + headers->EnumerateHeader(NULL, "content-disposition", &value); + response->setSuggestedFileName( + net::GetSuggestedFilename(url, + value, + std::string(), // referrer_charset + std::string(), // suggested_name + std::string(), // mime_type + std::string())); // default_name + + Time time_val; + if (headers->GetLastModifiedValue(&time_val)) + response->setLastModifiedDate(time_val.ToDoubleT()); + + // Build up the header map. + void* iter = NULL; + std::string name; + while (headers->EnumerateHeaderLines(&iter, &name, &value)) { + response->addHTTPHeaderField(WebString::fromLatin1(name), + WebString::fromLatin1(value)); + } +} + void WebURLLoaderImpl::loadSynchronously(const WebURLRequest& request, WebURLResponse& response, WebURLError& error, diff --git a/chromium/webkit/child/weburlloader_impl.h b/chromium/webkit/child/weburlloader_impl.h index 1412b32a967..833d83a4640 100644 --- a/chromium/webkit/child/weburlloader_impl.h +++ b/chromium/webkit/child/weburlloader_impl.h @@ -7,10 +7,12 @@ #include "base/memory/ref_counted.h" #include "third_party/WebKit/public/platform/WebURLLoader.h" +#include "webkit/child/webkit_child_export.h" namespace webkit_glue { class WebKitPlatformSupportImpl; +struct ResourceResponseInfo; class WebURLLoaderImpl : public WebKit::WebURLLoader { public: @@ -19,6 +21,10 @@ class WebURLLoaderImpl : public WebKit::WebURLLoader { static WebKit::WebURLError CreateError(const WebKit::WebURL& unreachable_url, int reason); + WEBKIT_CHILD_EXPORT static void PopulateURLResponse( + const GURL& url, + const ResourceResponseInfo& info, + WebKit::WebURLResponse* response); // WebURLLoader methods: virtual void loadSynchronously( diff --git a/chromium/webkit/common/DEPS b/chromium/webkit/common/DEPS index e517c62ec8e..9dbc494545f 100644 --- a/chromium/webkit/common/DEPS +++ b/chromium/webkit/common/DEPS @@ -1,7 +1,4 @@ include_rules = [ - "+ppapi/c", - "+ppapi/shared_impl", - "+ppapi/thunk", # TODO(scottmg): http://crbug.com/239107 "+ui/base/clipboard", "-webkit/browser", diff --git a/chromium/webkit/common/blob/shareable_file_reference_unittest.cc b/chromium/webkit/common/blob/shareable_file_reference_unittest.cc index d378b7666dd..bbbe7740cd0 100644 --- a/chromium/webkit/common/blob/shareable_file_reference_unittest.cc +++ b/chromium/webkit/common/blob/shareable_file_reference_unittest.cc @@ -6,8 +6,8 @@ #include "base/file_util.h" #include "base/files/scoped_temp_dir.h" -#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_proxy.h" +#include "base/run_loop.h" #include "testing/gtest/include/gtest/gtest.h" namespace webkit_blob { @@ -44,13 +44,13 @@ TEST(ShareableFileReferenceTest, TestReferences) { // Drop the first reference, the file and reference should still be there. reference1 = NULL; EXPECT_TRUE(ShareableFileReference::Get(file).get()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_TRUE(base::PathExists(file)); // Drop the second reference, the file and reference should get deleted. reference2 = NULL; EXPECT_FALSE(ShareableFileReference::Get(file).get()); - base::MessageLoop::current()->RunUntilIdle(); + base::RunLoop().RunUntilIdle(); EXPECT_FALSE(base::PathExists(file)); // TODO(michaeln): add a test for files that aren't deletable behavior. diff --git a/chromium/webkit/common/cursors/webcursor.h b/chromium/webkit/common/cursors/webcursor.h index 24e806845ab..c64689e6307 100644 --- a/chromium/webkit/common/cursors/webcursor.h +++ b/chromium/webkit/common/cursors/webcursor.h @@ -15,6 +15,10 @@ #include <vector> +#if defined(USE_AURA) +#include "ui/base/cursor/cursor.h" +#endif + #if defined(OS_WIN) typedef struct HINSTANCE__* HINSTANCE; typedef struct HICON__* HICON; diff --git a/chromium/webkit/common/cursors/webcursor_mac.mm b/chromium/webkit/common/cursors/webcursor_mac.mm index 1a1dc443601..58cff81d974 100644 --- a/chromium/webkit/common/cursors/webcursor_mac.mm +++ b/chromium/webkit/common/cursors/webcursor_mac.mm @@ -208,8 +208,12 @@ NSCursor* CreateCustomCursor(const std::vector<char>& custom_data, NSPoint dip_hotspot = NSPointFromCGPoint(gfx::ToFlooredPoint( gfx::ScalePoint(hotspot, 1 / custom_scale)).ToCGPoint()); + // Both the image and its representation need to have the same size for + // cursors to appear in high resolution on retina displays. Note that the + // size of a representation is not the same as pixelsWide or pixelsHigh. NSImage* cursor_image = gfx::SkBitmapToNSImage(bitmap); [cursor_image setSize:dip_size]; + [[[cursor_image representations] objectAtIndex:0] setSize:dip_size]; NSCursor* cursor = [[NSCursor alloc] initWithImage:cursor_image hotSpot:dip_hotspot]; diff --git a/chromium/webkit/common/data_element.h b/chromium/webkit/common/data_element.h index 173d13816cf..f93960ba1bd 100644 --- a/chromium/webkit/common/data_element.h +++ b/chromium/webkit/common/data_element.h @@ -48,13 +48,6 @@ class WEBKIT_COMMON_EXPORT DataElement { return expected_modification_time_; } - // TODO(michaeln): fixup callers to use filesytem_url() and blob_uuid(). - const GURL& url() const { - if (type_ == TYPE_FILE_FILESYSTEM) - return filesystem_url_; - return blob_url_; - } - // Sets TYPE_BYTES data. This copies the given data into the element. void SetToBytes(const char* bytes, int bytes_len) { type_ = TYPE_BYTES; diff --git a/chromium/webkit/common/fileapi/file_system_info.cc b/chromium/webkit/common/fileapi/file_system_info.cc new file mode 100644 index 00000000000..269c021dc46 --- /dev/null +++ b/chromium/webkit/common/fileapi/file_system_info.cc @@ -0,0 +1,24 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "webkit/common/fileapi/file_system_info.h" + +namespace fileapi { + +FileSystemInfo::FileSystemInfo() + : mount_type(fileapi::kFileSystemTypeTemporary) { +} + +FileSystemInfo::FileSystemInfo(const std::string& name, + const GURL& root_url, + fileapi::FileSystemType mount_type) + : name(name), + root_url(root_url), + mount_type(mount_type) { +} + +FileSystemInfo::~FileSystemInfo() { +} + +} // namespace fileapi diff --git a/chromium/webkit/common/fileapi/file_system_info.h b/chromium/webkit/common/fileapi/file_system_info.h new file mode 100644 index 00000000000..b71739ad41f --- /dev/null +++ b/chromium/webkit/common/fileapi/file_system_info.h @@ -0,0 +1,31 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WEBKIT_COMMON_FILEAPI_FILE_SYSTEM_INFO_H_ +#define WEBKIT_COMMON_FILEAPI_FILE_SYSTEM_INFO_H_ + +#include "url/gurl.h" +#include "webkit/common/fileapi/file_system_types.h" +#include "webkit/common/webkit_storage_common_export.h" + +namespace fileapi { + +// This struct is used to send the necessary information for Blink to create a +// DOMFileSystem. Since Blink side only uses mount_type (rather than +// detailed/cracked filesystem type) this only contains mount_type but not type. +struct WEBKIT_STORAGE_COMMON_EXPORT FileSystemInfo { + FileSystemInfo(); + FileSystemInfo(const std::string& filesystem_name, + const GURL& root_url, + fileapi::FileSystemType mount_type); + ~FileSystemInfo(); + + std::string name; + GURL root_url; + fileapi::FileSystemType mount_type; +}; + +} // namespace fileapi + +#endif // WEBKIT_COMMON_FILEAPI_FILE_SYSTEM_INFO_H_ diff --git a/chromium/webkit/common/fileapi/file_system_util.cc b/chromium/webkit/common/fileapi/file_system_util.cc index bc9aba7e1c4..6229bc22c79 100644 --- a/chromium/webkit/common/fileapi/file_system_util.cc +++ b/chromium/webkit/common/fileapi/file_system_util.cc @@ -296,6 +296,8 @@ WebKit::WebFileError PlatformFileErrorToWebFileError( return WebKit::WebFileErrorSecurity; case base::PLATFORM_FILE_ERROR_NO_SPACE: return WebKit::WebFileErrorQuotaExceeded; + case base::PLATFORM_FILE_ERROR_INVALID_URL: + return WebKit::WebFileErrorEncoding; default: return WebKit::WebFileErrorInvalidModification; } diff --git a/chromium/webkit/common/fileapi/file_system_util.h b/chromium/webkit/common/fileapi/file_system_util.h index bf0cc852507..ffb29faed76 100644 --- a/chromium/webkit/common/fileapi/file_system_util.h +++ b/chromium/webkit/common/fileapi/file_system_util.h @@ -10,7 +10,7 @@ #include "base/files/file_path.h" #include "base/platform_file.h" -#include "third_party/WebKit/public/web/WebFileError.h" +#include "third_party/WebKit/public/platform/WebFileError.h" #include "third_party/WebKit/public/platform/WebFileSystemType.h" #include "webkit/common/fileapi/file_system_types.h" #include "webkit/common/quota/quota_types.h" diff --git a/chromium/webkit/common/gpu/context_provider_in_process.cc b/chromium/webkit/common/gpu/context_provider_in_process.cc index e56da80fd0a..4d1f3d42893 100644 --- a/chromium/webkit/common/gpu/context_provider_in_process.cc +++ b/chromium/webkit/common/gpu/context_provider_in_process.cc @@ -4,9 +4,15 @@ #include "webkit/common/gpu/context_provider_in_process.h" +#include <set> + +#include "base/bind.h" #include "base/callback_helpers.h" +#include "base/strings/string_split.h" +#include "base/strings/stringprintf.h" +#include "cc/output/managed_memory_policy.h" #include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h" -#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" +#include "webkit/common/gpu/managed_memory_policy_convert.h" namespace webkit { namespace gpu { @@ -31,6 +37,27 @@ class ContextProviderInProcess::LostContextCallbackProxy ContextProviderInProcess* provider_; }; +class ContextProviderInProcess::SwapBuffersCompleteCallbackProxy + : public WebKit::WebGraphicsContext3D:: + WebGraphicsSwapBuffersCompleteCallbackCHROMIUM { + public: + explicit SwapBuffersCompleteCallbackProxy(ContextProviderInProcess* provider) + : provider_(provider) { + provider_->context3d_->setSwapBuffersCompleteCallbackCHROMIUM(this); + } + + virtual ~SwapBuffersCompleteCallbackProxy() { + provider_->context3d_->setSwapBuffersCompleteCallbackCHROMIUM(NULL); + } + + virtual void onSwapBuffersComplete() { + provider_->OnSwapBuffersComplete(); + } + + private: + ContextProviderInProcess* provider_; +}; + class ContextProviderInProcess::MemoryAllocationCallbackProxy : public WebKit::WebGraphicsContext3D:: WebGraphicsMemoryAllocationChangedCallbackCHROMIUM { @@ -45,29 +72,26 @@ class ContextProviderInProcess::MemoryAllocationCallbackProxy } virtual void onMemoryAllocationChanged( - WebKit::WebGraphicsMemoryAllocation alloc) { - provider_->OnMemoryAllocationChanged(!!alloc.gpuResourceSizeInBytes); + WebKit::WebGraphicsMemoryAllocation allocation) { + provider_->OnMemoryAllocationChanged(allocation); } private: ContextProviderInProcess* provider_; }; -ContextProviderInProcess::ContextProviderInProcess() - : destroyed_(false) { - DCHECK(main_thread_checker_.CalledOnValidThread()); - context_thread_checker_.DetachFromThread(); +// static +scoped_refptr<ContextProviderInProcess> ContextProviderInProcess::Create( + scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d, + const std::string& debug_name) { + if (!context3d) + return NULL; + return new ContextProviderInProcess(context3d.Pass(), debug_name); } -ContextProviderInProcess::~ContextProviderInProcess() { - DCHECK(main_thread_checker_.CalledOnValidThread() || - context_thread_checker_.CalledOnValidThread()); -} - -bool ContextProviderInProcess::InitializeOnMainThread() { - DCHECK(!context3d_); - DCHECK(main_thread_checker_.CalledOnValidThread()); - +// static +scoped_refptr<ContextProviderInProcess> +ContextProviderInProcess::CreateOffscreen() { WebKit::WebGraphicsContext3D::Attributes attributes; attributes.depth = false; attributes.stencil = true; @@ -75,12 +99,25 @@ bool ContextProviderInProcess::InitializeOnMainThread() { attributes.shareResources = true; attributes.noAutomaticFlushes = true; - using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; - context3d_ = + return Create( WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( - attributes); + attributes), "Offscreen"); +} + +ContextProviderInProcess::ContextProviderInProcess( + scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d, + const std::string& debug_name) + : context3d_(context3d.Pass()), + destroyed_(false), + debug_name_(debug_name) { + DCHECK(main_thread_checker_.CalledOnValidThread()); + DCHECK(context3d_); + context_thread_checker_.DetachFromThread(); +} - return context3d_; +ContextProviderInProcess::~ContextProviderInProcess() { + DCHECK(main_thread_checker_.CalledOnValidThread() || + context_thread_checker_.CalledOnValidThread()); } bool ContextProviderInProcess::BindToCurrentThread() { @@ -95,10 +132,43 @@ bool ContextProviderInProcess::BindToCurrentThread() { if (!context3d_->makeContextCurrent()) return false; + std::string unique_context_name = + base::StringPrintf("%s-%p", debug_name_.c_str(), context3d_.get()); + context3d_->pushGroupMarkerEXT(unique_context_name.c_str()); + lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this)); + swap_buffers_complete_callback_proxy_.reset( + new SwapBuffersCompleteCallbackProxy(this)); + memory_allocation_callback_proxy_.reset( + new MemoryAllocationCallbackProxy(this)); return true; } +cc::ContextProvider::Capabilities +ContextProviderInProcess::ContextCapabilities() { + // We always use a WebGraphicsContext3DInProcessCommandBufferImpl which + // provides the following capabilities: + Capabilities caps; + caps.bind_uniform_location = true; + caps.discard_backbuffer = true; + caps.map_image = true; + caps.map_sub = true; + caps.set_visibility = true; + caps.shallow_flush = true; + caps.texture_format_bgra8888 = true; + caps.texture_rectangle = true; + + WebKit::WebString extensions = + context3d_->getString(0x1F03 /* GL_EXTENSIONS */); + std::vector<std::string> extension_list; + base::SplitString(extensions.utf8(), ' ', &extension_list); + std::set<std::string> extension_set(extension_list.begin(), + extension_list.end()); + + caps.post_sub_buffer = extension_set.count("GL_CHROMIUM_post_sub_buffer") > 0; + return caps; +} + WebKit::WebGraphicsContext3D* ContextProviderInProcess::Context3d() { DCHECK(context3d_); DCHECK(lost_context_callback_proxy_); // Is bound to thread. @@ -117,8 +187,6 @@ class GrContext* ContextProviderInProcess::GrContext() { gr_context_.reset( new webkit::gpu::GrContextForWebGraphicsContext3D(context3d_.get())); - memory_allocation_callback_proxy_.reset( - new MemoryAllocationCallbackProxy(this)); return gr_context_->get(); } @@ -143,6 +211,33 @@ void ContextProviderInProcess::OnLostContext() { base::ResetAndReturn(&lost_context_callback_).Run(); } +void ContextProviderInProcess::OnSwapBuffersComplete() { + DCHECK(context_thread_checker_.CalledOnValidThread()); + if (!swap_buffers_complete_callback_.is_null()) + swap_buffers_complete_callback_.Run(); +} + +void ContextProviderInProcess::OnMemoryAllocationChanged( + const WebKit::WebGraphicsMemoryAllocation& allocation) { + DCHECK(context_thread_checker_.CalledOnValidThread()); + + if (gr_context_) { + bool nonzero_allocation = !!allocation.gpuResourceSizeInBytes; + gr_context_->SetMemoryLimit(nonzero_allocation); + } + + if (memory_policy_changed_callback_.is_null()) + return; + + bool discard_backbuffer_when_not_visible; + cc::ManagedMemoryPolicy policy = + ManagedMemoryPolicyConvert::Convert(allocation, + &discard_backbuffer_when_not_visible); + + memory_policy_changed_callback_.Run( + policy, discard_backbuffer_when_not_visible); +} + bool ContextProviderInProcess::DestroyedOnMainThread() { DCHECK(main_thread_checker_.CalledOnValidThread()); @@ -153,15 +248,25 @@ bool ContextProviderInProcess::DestroyedOnMainThread() { void ContextProviderInProcess::SetLostContextCallback( const LostContextCallback& lost_context_callback) { DCHECK(context_thread_checker_.CalledOnValidThread()); - DCHECK(lost_context_callback_.is_null()); + DCHECK(lost_context_callback_.is_null() || + lost_context_callback.is_null()); lost_context_callback_ = lost_context_callback; } -void ContextProviderInProcess::OnMemoryAllocationChanged( - bool nonzero_allocation) { +void ContextProviderInProcess::SetSwapBuffersCompleteCallback( + const SwapBuffersCompleteCallback& swap_buffers_complete_callback) { DCHECK(context_thread_checker_.CalledOnValidThread()); - if (gr_context_) - gr_context_->SetMemoryLimit(nonzero_allocation); + DCHECK(swap_buffers_complete_callback_.is_null() || + swap_buffers_complete_callback.is_null()); + swap_buffers_complete_callback_ = swap_buffers_complete_callback; +} + +void ContextProviderInProcess::SetMemoryPolicyChangedCallback( + const MemoryPolicyChangedCallback& memory_policy_changed_callback) { + DCHECK(context_thread_checker_.CalledOnValidThread()); + DCHECK(memory_policy_changed_callback_.is_null() || + memory_policy_changed_callback.is_null()); + memory_policy_changed_callback_ = memory_policy_changed_callback; } } // namespace gpu diff --git a/chromium/webkit/common/gpu/context_provider_in_process.h b/chromium/webkit/common/gpu/context_provider_in_process.h index b427abeb043..90c5e69a2d5 100644 --- a/chromium/webkit/common/gpu/context_provider_in_process.h +++ b/chromium/webkit/common/gpu/context_provider_in_process.h @@ -10,10 +10,12 @@ #include "base/synchronization/lock.h" #include "base/threading/thread_checker.h" #include "cc/output/context_provider.h" +#include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" #include "webkit/common/gpu/webkit_gpu_export.h" namespace WebKit { class WebGraphicsContext3D; +struct WebGraphicsMemoryAllocation; } namespace webkit { @@ -23,46 +25,63 @@ class GrContextForWebGraphicsContext3D; class WEBKIT_GPU_EXPORT ContextProviderInProcess : NON_EXPORTED_BASE(public cc::ContextProvider) { public: - static scoped_refptr<ContextProviderInProcess> Create() { - scoped_refptr<ContextProviderInProcess> provider = - new ContextProviderInProcess; - if (!provider->InitializeOnMainThread()) - return NULL; - return provider; - } + static scoped_refptr<ContextProviderInProcess> Create( + scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d, + const std::string& debug_name); + + // Calls Create() with a default factory method for creating an offscreen + // context. + static scoped_refptr<ContextProviderInProcess> CreateOffscreen(); virtual bool BindToCurrentThread() OVERRIDE; + virtual Capabilities ContextCapabilities() OVERRIDE; virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; virtual class GrContext* GrContext() OVERRIDE; virtual void VerifyContexts() OVERRIDE; virtual bool DestroyedOnMainThread() OVERRIDE; virtual void SetLostContextCallback( const LostContextCallback& lost_context_callback) OVERRIDE; + virtual void SetSwapBuffersCompleteCallback( + const SwapBuffersCompleteCallback& swap_buffers_complete_callback) + OVERRIDE; + virtual void SetMemoryPolicyChangedCallback( + const MemoryPolicyChangedCallback& memory_policy_changed_callback) + OVERRIDE; protected: - ContextProviderInProcess(); + ContextProviderInProcess( + scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d, + const std::string& debug_name); virtual ~ContextProviderInProcess(); - bool InitializeOnMainThread(); - void OnLostContext(); - void OnMemoryAllocationChanged(bool nonzero_allocation); + void OnSwapBuffersComplete(); + void OnMemoryAllocationChanged( + const WebKit::WebGraphicsMemoryAllocation& allocation); private: base::ThreadChecker main_thread_checker_; base::ThreadChecker context_thread_checker_; - scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; + scoped_ptr<webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl> + context3d_; scoped_ptr<webkit::gpu::GrContextForWebGraphicsContext3D> gr_context_; LostContextCallback lost_context_callback_; + SwapBuffersCompleteCallback swap_buffers_complete_callback_; + MemoryPolicyChangedCallback memory_policy_changed_callback_; base::Lock destroyed_lock_; bool destroyed_; + std::string debug_name_; class LostContextCallbackProxy; scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; + class SwapBuffersCompleteCallbackProxy; + scoped_ptr<SwapBuffersCompleteCallbackProxy> + swap_buffers_complete_callback_proxy_; + class MemoryAllocationCallbackProxy; scoped_ptr<MemoryAllocationCallbackProxy> memory_allocation_callback_proxy_; }; diff --git a/chromium/webkit/common/gpu/managed_memory_policy_convert.cc b/chromium/webkit/common/gpu/managed_memory_policy_convert.cc new file mode 100644 index 00000000000..548e2aea653 --- /dev/null +++ b/chromium/webkit/common/gpu/managed_memory_policy_convert.cc @@ -0,0 +1,43 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "webkit/common/gpu/managed_memory_policy_convert.h" + +namespace webkit { +namespace gpu { + +static cc::ManagedMemoryPolicy::PriorityCutoff ConvertPriorityCutoff( + WebKit::WebGraphicsMemoryAllocation::PriorityCutoff priority_cutoff) { + // This is simple a 1:1 map, the names differ only because the WebKit names + // should be to match the cc names. + switch (priority_cutoff) { + case WebKit::WebGraphicsMemoryAllocation::PriorityCutoffAllowNothing: + return cc::ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING; + case WebKit::WebGraphicsMemoryAllocation::PriorityCutoffAllowVisibleOnly: + return cc::ManagedMemoryPolicy::CUTOFF_ALLOW_REQUIRED_ONLY; + case WebKit::WebGraphicsMemoryAllocation:: + PriorityCutoffAllowVisibleAndNearby: + return cc::ManagedMemoryPolicy::CUTOFF_ALLOW_NICE_TO_HAVE; + case WebKit::WebGraphicsMemoryAllocation::PriorityCutoffAllowEverything: + return cc::ManagedMemoryPolicy::CUTOFF_ALLOW_EVERYTHING; + } + NOTREACHED(); + return cc::ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING; +} + +// static +cc::ManagedMemoryPolicy ManagedMemoryPolicyConvert::Convert( + const WebKit::WebGraphicsMemoryAllocation& allocation, + bool* discard_backbuffer_when_not_visible) { + *discard_backbuffer_when_not_visible = !allocation.suggestHaveBackbuffer; + return cc::ManagedMemoryPolicy( + allocation.bytesLimitWhenVisible, + ConvertPriorityCutoff(allocation.priorityCutoffWhenVisible), + allocation.bytesLimitWhenNotVisible, + ConvertPriorityCutoff(allocation.priorityCutoffWhenNotVisible), + cc::ManagedMemoryPolicy::kDefaultNumResourcesLimit); +} + +} // namespace gpu +} // namespace webkit diff --git a/chromium/webkit/common/gpu/managed_memory_policy_convert.h b/chromium/webkit/common/gpu/managed_memory_policy_convert.h new file mode 100644 index 00000000000..0309683a8ce --- /dev/null +++ b/chromium/webkit/common/gpu/managed_memory_policy_convert.h @@ -0,0 +1,25 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WEBKIT_COMMON_GPU_MANAGED_MEMORY_POLICY_CONVERT_H_ +#define WEBKIT_COMMON_GPU_MANAGED_MEMORY_POLICY_CONVERT_H_ + +#include "cc/output/managed_memory_policy.h" +#include "third_party/WebKit/public/platform/WebGraphicsMemoryAllocation.h" +#include "webkit/common/gpu/webkit_gpu_export.h" + +namespace webkit { +namespace gpu { + +class WEBKIT_GPU_EXPORT ManagedMemoryPolicyConvert { + public: + static cc::ManagedMemoryPolicy Convert( + const WebKit::WebGraphicsMemoryAllocation& allocation, + bool* discard_backbuffer_when_not_visible); +}; + +} // namespace gpu +} // namespace webkit + +#endif // WEBKIT_COMMON_GPU_MANAGED_MEMORY_POLICY_CONVERT_H_ diff --git a/chromium/webkit/common/gpu/test_context_provider_factory.cc b/chromium/webkit/common/gpu/test_context_provider_factory.cc index 88464c00074..7e4f04f949e 100644 --- a/chromium/webkit/common/gpu/test_context_provider_factory.cc +++ b/chromium/webkit/common/gpu/test_context_provider_factory.cc @@ -27,7 +27,7 @@ TestContextProviderFactory::~TestContextProviderFactory() {} scoped_refptr<cc::ContextProvider> TestContextProviderFactory:: OffscreenContextProviderForMainThread() { if (!main_thread_.get() || main_thread_->DestroyedOnMainThread()) { - main_thread_ = ContextProviderInProcess::Create(); + main_thread_ = ContextProviderInProcess::CreateOffscreen(); if (main_thread_.get() && !main_thread_->BindToCurrentThread()) main_thread_ = NULL; } diff --git a/chromium/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/chromium/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc index 886e40f5f46..f5e6d38c23e 100644 --- a/chromium/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc +++ b/chromium/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc @@ -13,6 +13,7 @@ #include <string> +#include "base/atomicops.h" #include "base/bind.h" #include "base/bind_helpers.h" #include "base/callback.h" @@ -45,6 +46,14 @@ void OnSignalSyncPoint( callback->onSyncPointReached(); } +uint32_t GenFlushID() { + static base::subtle::Atomic32 flush_id = 0; + + base::subtle::Atomic32 my_id = base::subtle::Barrier_AtomicIncrement( + &flush_id, 1); + return static_cast<uint32_t>(my_id); +} + // Singleton used to initialize and terminate the gles2 library. class GLES2Initializer { public: @@ -66,11 +75,11 @@ static base::LazyInstance<GLES2Initializer> g_gles2_initializer = } // namespace anonymous // static -scoped_ptr<WebKit::WebGraphicsContext3D> +scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( const WebKit::WebGraphicsContext3D::Attributes& attributes, gfx::AcceleratedWidget window) { - scoped_ptr<WebKit::WebGraphicsContext3D> context; + scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context; if (gfx::GLSurface::InitializeOneOff()) { context.reset(new WebGraphicsContext3DInProcessCommandBufferImpl( scoped_ptr< ::gpu::GLInProcessContext>(), attributes, false, window)); @@ -79,7 +88,7 @@ WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( } // static -scoped_ptr<WebKit::WebGraphicsContext3D> +scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( const WebKit::WebGraphicsContext3D::Attributes& attributes) { return make_scoped_ptr(new WebGraphicsContext3DInProcessCommandBufferImpl( @@ -87,10 +96,10 @@ WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( attributes, true, gfx::kNullAcceleratedWidget)) - .PassAs<WebKit::WebGraphicsContext3D>(); + .Pass(); } -scoped_ptr<WebKit::WebGraphicsContext3D> +scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext( scoped_ptr< ::gpu::GLInProcessContext> context, const WebKit::WebGraphicsContext3D::Attributes& attributes) { @@ -100,7 +109,7 @@ WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext( attributes, true /* is_offscreen. Not used. */, gfx::kNullAcceleratedWidget /* window. Not used. */)) - .PassAs<WebKit::WebGraphicsContext3D>(); + .Pass(); } WebGraphicsContext3DInProcessCommandBufferImpl:: @@ -119,7 +128,8 @@ WebGraphicsContext3DInProcessCommandBufferImpl:: context_lost_reason_(GL_NO_ERROR), attributes_(attributes), cached_width_(0), - cached_height_(0) { + cached_height_(0), + flush_id_(0) { } WebGraphicsContext3DInProcessCommandBufferImpl:: @@ -148,8 +158,6 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() { g_gles2_initializer.Get(); if (!context_) { - const char* preferred_extensions = "*"; - // TODO(kbr): More work will be needed in this implementation to // properly support GPU switching. Like in the out-of-process // command buffer implementation, all previously created contexts @@ -165,7 +173,6 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() { window_, gfx::Size(1, 1), attributes_.shareResources, - preferred_extensions, attrib_struct, gpu_preference)); } @@ -212,6 +219,10 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::makeContextCurrent() { return context_ && !isContextLost(); } +uint32_t WebGraphicsContext3DInProcessCommandBufferImpl::lastFlushID() { + return flush_id_; +} + void WebGraphicsContext3DInProcessCommandBufferImpl::ClearContext() { // NOTE: Comment in the line below to check for code that is not calling // eglMakeCurrent where appropriate. The issue is code using @@ -575,9 +586,15 @@ DELEGATE_TO_GL_1(enable, Enable, WGC3Denum) DELEGATE_TO_GL_1(enableVertexAttribArray, EnableVertexAttribArray, WGC3Duint) -DELEGATE_TO_GL(finish, Finish) +void WebGraphicsContext3DInProcessCommandBufferImpl::finish() { + flush_id_ = GenFlushID(); + gl_->Finish(); +} -DELEGATE_TO_GL(flush, Flush) +void WebGraphicsContext3DInProcessCommandBufferImpl::flush() { + flush_id_ = GenFlushID(); + gl_->Flush(); +} DELEGATE_TO_GL_4(framebufferRenderbuffer, FramebufferRenderbuffer, WGC3Denum, WGC3Denum, WGC3Denum, WebGLId) @@ -1117,6 +1134,11 @@ DELEGATE_TO_GL_2(bindTexImage2DCHROMIUM, BindTexImage2DCHROMIUM, DELEGATE_TO_GL_2(releaseTexImage2DCHROMIUM, ReleaseTexImage2DCHROMIUM, WGC3Denum, WGC3Dint) +DELEGATE_TO_GL_1R(createStreamTextureCHROMIUM, CreateStreamTextureCHROMIUM, + WebGLId, WebGLId) +DELEGATE_TO_GL_1(destroyStreamTextureCHROMIUM, DestroyStreamTextureCHROMIUM, + WebGLId) + void* WebGraphicsContext3DInProcessCommandBufferImpl::mapBufferCHROMIUM( WGC3Denum target, WGC3Denum access) { ClearContext(); @@ -1158,8 +1180,15 @@ DELEGATE_TO_GL_1(unmapImageCHROMIUM, UnmapImageCHROMIUM, WGC3Duint); DELEGATE_TO_GL_3(bindUniformLocationCHROMIUM, BindUniformLocationCHROMIUM, WebGLId, WGC3Dint, const WGC3Dchar*) -DELEGATE_TO_GL(shallowFlushCHROMIUM, ShallowFlushCHROMIUM) -DELEGATE_TO_GL(shallowFinishCHROMIUM, ShallowFinishCHROMIUM) +void WebGraphicsContext3DInProcessCommandBufferImpl::shallowFlushCHROMIUM() { + flush_id_ = GenFlushID(); + gl_->ShallowFlushCHROMIUM(); +} + +void WebGraphicsContext3DInProcessCommandBufferImpl::shallowFinishCHROMIUM() { + flush_id_ = GenFlushID(); + gl_->ShallowFinishCHROMIUM(); +} DELEGATE_TO_GL_1(genMailboxCHROMIUM, GenMailboxCHROMIUM, WGC3Dbyte*) DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM, diff --git a/chromium/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h b/chromium/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h index d3620b411b2..5b4cb6455b9 100644 --- a/chromium/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h +++ b/chromium/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h @@ -48,16 +48,19 @@ namespace gpu { class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl : public NON_EXPORTED_BASE(WebKit::WebGraphicsContext3D) { public: - static scoped_ptr<WebKit::WebGraphicsContext3D> CreateViewContext( - const WebKit::WebGraphicsContext3D::Attributes& attributes, - gfx::AcceleratedWidget window); + static scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> + CreateViewContext( + const WebKit::WebGraphicsContext3D::Attributes& attributes, + gfx::AcceleratedWidget window); - static scoped_ptr<WebKit::WebGraphicsContext3D> CreateOffscreenContext( - const WebKit::WebGraphicsContext3D::Attributes& attributes); + static scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> + CreateOffscreenContext( + const WebKit::WebGraphicsContext3D::Attributes& attributes); - static scoped_ptr<WebKit::WebGraphicsContext3D> WrapContext( - scoped_ptr< ::gpu::GLInProcessContext> context, - const WebKit::WebGraphicsContext3D::Attributes& attributes); + static scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> + WrapContext( + scoped_ptr< ::gpu::GLInProcessContext> context, + const WebKit::WebGraphicsContext3D::Attributes& attributes); virtual ~WebGraphicsContext3DInProcessCommandBufferImpl(); @@ -71,6 +74,8 @@ class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl // WebGraphicsContext3D methods virtual bool makeContextCurrent(); + virtual uint32_t lastFlushID(); + virtual int width(); virtual int height(); @@ -465,6 +470,9 @@ class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl virtual void bindTexImage2DCHROMIUM(WGC3Denum target, WGC3Dint imageId); virtual void releaseTexImage2DCHROMIUM(WGC3Denum target, WGC3Dint imageId); + virtual WebGLId createStreamTextureCHROMIUM(WebGLId texture); + virtual void destroyStreamTextureCHROMIUM(WebGLId texture); + virtual void texStorage2DEXT( WGC3Denum target, WGC3Dint levels, WGC3Duint internalformat, WGC3Dint width, WGC3Dint height); @@ -562,7 +570,6 @@ class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl // instead of going through WebGraphicsContext3D. void ClearContext(); - bool is_offscreen_; // Only used when not offscreen. gfx::AcceleratedWidget window_; @@ -583,6 +590,8 @@ class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl // Errors raised by synthesizeGLError(). std::vector<WGC3Denum> synthetic_errors_; + + uint32_t flush_id_; }; } // namespace gpu diff --git a/chromium/webkit/common/gpu/webkit_gpu.gyp b/chromium/webkit/common/gpu/webkit_gpu.gyp index effc5b7135b..be79c221cbc 100644 --- a/chromium/webkit/common/gpu/webkit_gpu.gyp +++ b/chromium/webkit/common/gpu/webkit_gpu.gyp @@ -15,6 +15,7 @@ 'variables': { 'enable_wexit_time_destructors': 1, }, 'dependencies': [ '<(DEPTH)/base/base.gyp:base', + '<(DEPTH)/cc/cc.gyp:cc', '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', '<(DEPTH)/gpu/command_buffer/command_buffer.gyp:gles2_utils', '<(DEPTH)/gpu/gpu.gyp:command_buffer_service', @@ -37,6 +38,8 @@ 'gl_bindings_skia_cmd_buffer.h', 'grcontext_for_webgraphicscontext3d.cc', 'grcontext_for_webgraphicscontext3d.h', + 'managed_memory_policy_convert.cc', + 'managed_memory_policy_convert.h', 'test_context_provider_factory.cc', 'test_context_provider_factory.h', 'webgraphicscontext3d_in_process_command_buffer_impl.cc', diff --git a/chromium/webkit/common/resource_request_body.cc b/chromium/webkit/common/resource_request_body.cc index 6263529e8bc..097751b5cc3 100644 --- a/chromium/webkit/common/resource_request_body.cc +++ b/chromium/webkit/common/resource_request_body.cc @@ -26,11 +26,16 @@ void ResourceRequestBody::AppendFileRange( expected_modification_time); } -void ResourceRequestBody::AppendBlob(const GURL& blob_url) { +void ResourceRequestBody::AppendBlobDeprecated(const GURL& blob_url) { elements_.push_back(Element()); elements_.back().SetToBlobUrl(blob_url); } +void ResourceRequestBody::AppendBlob(const std::string& uuid) { + elements_.push_back(Element()); + elements_.back().SetToBlob(uuid); +} + void ResourceRequestBody::AppendFileSystemFileRange( const GURL& url, uint64 offset, uint64 length, const base::Time& expected_modification_time) { diff --git a/chromium/webkit/common/resource_request_body.h b/chromium/webkit/common/resource_request_body.h index c0bdc08b906..6f74e67dc26 100644 --- a/chromium/webkit/common/resource_request_body.h +++ b/chromium/webkit/common/resource_request_body.h @@ -34,7 +34,8 @@ class WEBKIT_COMMON_EXPORT ResourceRequestBody void AppendFileRange(const base::FilePath& file_path, uint64 offset, uint64 length, const base::Time& expected_modification_time); - void AppendBlob(const GURL& blob_url); + void AppendBlobDeprecated(const GURL& blob_url); + void AppendBlob(const std::string& uuid); void AppendFileSystemFileRange(const GURL& url, uint64 offset, uint64 length, const base::Time& expected_modification_time); diff --git a/chromium/webkit/common/webpreferences.cc b/chromium/webkit/common/webpreferences.cc index 865b7199fed..f37facce72d 100644 --- a/chromium/webkit/common/webpreferences.cc +++ b/chromium/webkit/common/webpreferences.cc @@ -117,6 +117,7 @@ WebPreferences::WebPreferences() experimental_websocket_enabled(false), pinch_virtual_viewport_enabled(false), pinch_overlay_scrollbar_thickness(0), + use_solid_color_scrollbars(false), cookie_enabled(true) #if defined(OS_ANDROID) , @@ -125,6 +126,7 @@ WebPreferences::WebPreferences() force_enable_zoom(false), double_tap_to_zoom_enabled(true), user_gesture_required_for_media_playback(true), + user_gesture_required_for_media_fullscreen(true), support_deprecated_target_density_dpi(false), use_legacy_background_size_shorthand_behavior(false), wide_viewport_quirk(false), diff --git a/chromium/webkit/common/webpreferences.h b/chromium/webkit/common/webpreferences.h index 45f7eb03643..8dcce939d53 100644 --- a/chromium/webkit/common/webpreferences.h +++ b/chromium/webkit/common/webpreferences.h @@ -153,6 +153,7 @@ struct WEBKIT_COMMON_EXPORT WebPreferences { bool experimental_websocket_enabled; bool pinch_virtual_viewport_enabled; int pinch_overlay_scrollbar_thickness; + bool use_solid_color_scrollbars; // This flags corresponds to a Page's Settings' setCookieEnabled state. It // only controls whether or not the "document.cookie" field is properly @@ -167,6 +168,7 @@ struct WEBKIT_COMMON_EXPORT WebPreferences { bool force_enable_zoom; bool double_tap_to_zoom_enabled; bool user_gesture_required_for_media_playback; + bool user_gesture_required_for_media_fullscreen; GURL default_video_poster_url; bool support_deprecated_target_density_dpi; bool use_legacy_background_size_shorthand_behavior; diff --git a/chromium/webkit/glue/resources/default_100_percent/amex.png b/chromium/webkit/glue/resources/default_100_percent/amex.png Binary files differindex badcdb78d74..cb20e05817c 100644 --- a/chromium/webkit/glue/resources/default_100_percent/amex.png +++ b/chromium/webkit/glue/resources/default_100_percent/amex.png diff --git a/chromium/webkit/glue/resources/default_100_percent/discover.png b/chromium/webkit/glue/resources/default_100_percent/discover.png Binary files differindex 9b44f29c051..d6a27178b7f 100644 --- a/chromium/webkit/glue/resources/default_100_percent/discover.png +++ b/chromium/webkit/glue/resources/default_100_percent/discover.png diff --git a/chromium/webkit/glue/resources/default_100_percent/mastercard.png b/chromium/webkit/glue/resources/default_100_percent/mastercard.png Binary files differindex 5429ebf2852..85fc46bfd6e 100644 --- a/chromium/webkit/glue/resources/default_100_percent/mastercard.png +++ b/chromium/webkit/glue/resources/default_100_percent/mastercard.png diff --git a/chromium/webkit/glue/resources/default_100_percent/overhang_shadow.png b/chromium/webkit/glue/resources/default_100_percent/overhang_shadow.png Binary files differnew file mode 100644 index 00000000000..4e0fc4b720c --- /dev/null +++ b/chromium/webkit/glue/resources/default_100_percent/overhang_shadow.png diff --git a/chromium/webkit/glue/resources/default_100_percent/visa.png b/chromium/webkit/glue/resources/default_100_percent/visa.png Binary files differindex 390b1d9b586..5f223226bec 100644 --- a/chromium/webkit/glue/resources/default_100_percent/visa.png +++ b/chromium/webkit/glue/resources/default_100_percent/visa.png diff --git a/chromium/webkit/glue/resources/default_200_percent/amex.png b/chromium/webkit/glue/resources/default_200_percent/amex.png Binary files differnew file mode 100644 index 00000000000..dc25fda58df --- /dev/null +++ b/chromium/webkit/glue/resources/default_200_percent/amex.png diff --git a/chromium/webkit/glue/resources/default_200_percent/discover.png b/chromium/webkit/glue/resources/default_200_percent/discover.png Binary files differnew file mode 100644 index 00000000000..e8935be955b --- /dev/null +++ b/chromium/webkit/glue/resources/default_200_percent/discover.png diff --git a/chromium/webkit/glue/resources/default_200_percent/mastercard.png b/chromium/webkit/glue/resources/default_200_percent/mastercard.png Binary files differnew file mode 100644 index 00000000000..bd570e3e640 --- /dev/null +++ b/chromium/webkit/glue/resources/default_200_percent/mastercard.png diff --git a/chromium/webkit/glue/resources/default_200_percent/visa.png b/chromium/webkit/glue/resources/default_200_percent/visa.png Binary files differnew file mode 100644 index 00000000000..e92cd71bf52 --- /dev/null +++ b/chromium/webkit/glue/resources/default_200_percent/visa.png diff --git a/chromium/webkit/glue/resources/webkit_resources.grd b/chromium/webkit/glue/resources/webkit_resources.grd index aaf330da04e..9e5cb257c58 100644 --- a/chromium/webkit/glue/resources/webkit_resources.grd +++ b/chromium/webkit/glue/resources/webkit_resources.grd @@ -57,6 +57,7 @@ </if> <if expr="is_macosx"> <structure type="chrome_scaled_image" name="IDR_OVERHANG_PATTERN" file="overhang_pattern.png" /> + <structure type="chrome_scaled_image" name="IDR_OVERHANG_SHADOW" file="overhang_shadow.png" /> </if> <structure type="chrome_scaled_image" name="IDR_PAN_SCROLL_ICON" file="pan_icon.png" /> <structure type="chrome_scaled_image" name="IDR_SEARCH_CANCEL" file="search_cancel.png" /> diff --git a/chromium/webkit/glue/resources/webkit_strings_am.xtb b/chromium/webkit/glue/resources/webkit_strings_am.xtb index 2e133f9e6d2..94150f03e0b 100644 --- a/chromium/webkit/glue/resources/webkit_strings_am.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_am.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">ሌላ...</translation> <translation id="2426432199384958866">በዥረት የሚለቀቀውን ፊልም ወደ ትክክለኛው ጊዜ መልስ</translation> <translation id="248395913932153421">ቀን</translation> +<translation id="1729654308190250600">እባክዎ ባዶ ያልሆነ የኢሜይል አድራሻ ያስገቡ።</translation> <translation id="6015796118275082299">ዓመት</translation> <translation id="9186171386827445984">ሰነዱን በመጫን ላይ፦ <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> ገጾች...</translation> <translation id="1235745349614807883">የቅርብ ጊዜ ፍለጋዎችን አስወግድ</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">ዝርዝር አመልካች</translation> <translation id="4202807286478387388">ዝለል</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">እባክዎ አንድ ክፍል ያስገቡና «<ph name="ATSIGN"/>»ን ያስከትሉ። «<ph name="INVALIDADDRESS"/>» ያልተሟላ ነው።</translation> +<translation id="2746543609216772311">ዋጋ <ph name="MINIMUM_DATE_OR_TIME"/> ወይም ከዚያ በኋላ መሆን አለበት።</translation> <translation id="2572483411312390101">አጫውት</translation> <translation id="8785498733064193001">መልሶ ማጫወት ይጀምሩ</translation> <translation id="7057186640035488495">የፊልም ሰዓት</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">በፍጥነት ወደ ኋላ ተመልሰው ይፈልጉ</translation> <translation id="7789962463072032349">ላፍታ አቁም</translation> <translation id="6853785296079745596">የተዘጉ የስዕል መግለጫዎችን ይደብቁ</translation> +<translation id="4360991593054037559">እባክዎ የሚሰራ ዋጋ ያስገቡ። ሁለቱ የሚቀርቡ ዋጋዎች <ph name="VALID_VALUE_LOW"/> እና <ph name="VALID_VALUE_HIGHER"/> ናቸው።</translation> <translation id="1758486001363313524">ሌላ...</translation> <translation id="8141602879876242471">ይህ ሊፈለግ የሚችል መረጃ ጠቋሚ ነው። የፍለጋ ቁልፍ ቃላት አስገባ፦</translation> <translation id="1930711995431081526">ሁኔታ</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">በፍጥነት ወደፊት ሄደህ ፈልግ</translation> <translation id="4812940957355064477">እባክዎ ቁጥር ያስገቡ።</translation> <translation id="2548326553472216322">የቅርብ ጊዜ ፍለጋዎች የሉም</translation> +<translation id="1938124657309484470">ዋጋ <ph name="MAXIMUM_DATE_OR_TIME"/> ወይም ከዚያ በፊት መሆን አለበት።</translation> <translation id="7263440858009898357">እባክዎ በዝርዝሩ ውስጥ አንድ ንጥል ይምረጡ።</translation> <translation id="901493112792887934">የአሁኑ ጊዜ በሰከንዶች</translation> <translation id="5164977714490026579">ዋጋ ከ<ph name="MINIMUM"/> የሚበልጥ ወይም ከእሱ እኩል መሆን አለበት።</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">በዚህ ሣምንት</translation> <translation id="5966707198760109579">ሳምንት</translation> <translation id="2901282870647571346">የአሁኑ የፊልም ሁኔታ</translation> +<translation id="2060505056492490888">«<ph name="DOT"/>» በ«<ph name="INVALIDDOMAIN"/>» ውስጥ በተሳሳተ ቦታ ላይ ነው የገባው።</translation> <translation id="2674318244760992338">ግርጌ</translation> <translation id="8987927404178983737">ወር</translation> <translation id="8115662671911883373">የተዘጉ የስዕል መግለጫዎችን ማሳየት ጀምር</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">አመልክት</translation> <translation id="2846343701378493991">1024(መካከለኛ ደረጃ)</translation> <translation id="1637811476055996098">ፋይሎችን ይምረጡ</translation> +<translation id="49969490063480558">እባክዎ ከ«<ph name="ATSIGN"/>» በኋላ አንድ ክፍል ያስገቡ። «<ph name="INVALIDADDRESS"/>» ያልተሟላ ነው።</translation> <translation id="5476505524087279545">አታመልክት</translation> <translation id="2148716181193084225">ዛሬ</translation> <translation id="2507943997699731163">እባክዎ ይህን መስክ ይሙሉት።</translation> <translation id="3785482301506746191">የፊልም ሰዓት አንፏቃቂ</translation> <translation id="739024184232394898">ሌላ...</translation> +<translation id="383465348367842624">ከ«<ph name="ATSIGN"/>» በፊት የሚመጣ ክፍል የ«<ph name="INVALIDCHARACTER"/>» ምልክት መያዝ የለበትም።</translation> <translation id="5468998798572797635">ከሙሉ ማያ ገጽ ውጣ</translation> <translation id="5919473608089529604">ተሰኪ መጫን አልተቻለም።</translation> <translation id="5546461542133609677">ድምፅ-ከልን አንሳ</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">እባክዎ በኮማ የተለዩ የኢሜይል አድራሻዎች ዝርዝር ያስገቡ።</translation> <translation id="5939518447894949180">ዳግም አስጀምር</translation> <translation id="1921819250265091946">ቀቀ</translation> +<translation id="2613802280814924224">እባክዎ የሚሰራ ዋጋ ያስገቡ። የሚቀርበው ዋጋ <ph name="VALID_VALUE"/> ነው።</translation> <translation id="835897206747267392">ልክ ያልሆነ እሴት።</translation> <translation id="1842960171412779397">ምረጥ</translation> <translation id="7673697353781729403">ሰዓቶች</translation> +<translation id="4664250907885839816">ከ«<ph name="ATSIGN"/>» በኋላ የሚመጣ ክፍል የ«<ph name="INVALIDCHARACTER"/>» ምልክት መያዝ የለበትም።</translation> <translation id="3450233048674729344">ዋጋ ከ<ph name="MAXIMUM"/> የሚያንስ ወይም ከእሱ እኩል መሆን አለበት።</translation> <translation id="3471999216963526757">30 ሰከንዶች ወደ ኋላ </translation> <translation id="668171684555832681">ሌላ…</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">አንቃ</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> ፋይሎች</translation> <translation id="6643016212128521049">አጽዳ</translation> +<translation id="7888071071722539607">እባክዎ በኢሜይል አድራሻው ውስጥ «<ph name="ATSIGN"/>» ያካትቱ። «<ph name="INVALIDADDRESS"/>» ውስጥ «<ph name="ATSIGN"/>» ይጎድላል።</translation> <translation id="4851297395436456855">በፍጥነት ወደፊት</translation> <translation id="1088086359088493902">ሰኮንዶች</translation> <translation id="3934680773876859118">የፒ ዲ ኤፍ ሰነድ መጫን አልተሳካም</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_ar.xtb b/chromium/webkit/glue/resources/webkit_strings_ar.xtb index 4dbc3a06f7c..3d5c9549b2b 100644 --- a/chromium/webkit/glue/resources/webkit_strings_ar.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_ar.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">آخر...</translation> <translation id="2426432199384958866">إرجاع الفيلم الذي يتم بثه إلى الوقت الفعلي</translation> <translation id="248395913932153421">يوم</translation> +<translation id="1729654308190250600">يُرجى إدخال عنوان البريد الإلكتروني وعدم ترك الحق فارغًا.</translation> <translation id="6015796118275082299">عام</translation> <translation id="9186171386827445984">جارٍ تحميل المستند: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> من الصفحات...</translation> <translation id="1235745349614807883">محو آخر عمليات البحث</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">محدّد القائمة</translation> <translation id="4202807286478387388">الدخول</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">يُرجى إدخال جزء متبوع بعلامة "<ph name="ATSIGN"/>"، حيث إن "<ph name="INVALIDADDRESS"/>" غير مكتمل.</translation> +<translation id="2746543609216772311">يجب أن تكون القيمة <ph name="MINIMUM_DATE_OR_TIME"/> أو بعد ذلك.</translation> <translation id="2572483411312390101">تشغيل</translation> <translation id="8785498733064193001">بدء التشغيل</translation> <translation id="7057186640035488495">وقت الفيلم</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">محاولة الرجوع للوراء بسرعة</translation> <translation id="7789962463072032349">إيقاف مؤقت</translation> <translation id="6853785296079745596">إخفاء التسميات التوضيحية المغلقة</translation> +<translation id="4360991593054037559">يُرجى إدخال قيمة صالحة. علمًا بأن القيم الصالحة تتراوح بين <ph name="VALID_VALUE_LOW"/> و<ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">آخر...</translation> <translation id="8141602879876242471">يمكن البحث في هذا الفهرس بإدخال كلمات مفتاحية:</translation> <translation id="1930711995431081526">الحالة</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">محاولة الانتقال للأمام بسرعة</translation> <translation id="4812940957355064477">الرجاء إدخال عدد.</translation> <translation id="2548326553472216322">لا عمليات بحث حديثة</translation> +<translation id="1938124657309484470">يجب أن تكون القيمة <ph name="MAXIMUM_DATE_OR_TIME"/> أو قبل ذلك.</translation> <translation id="7263440858009898357">الرجاء تحديد عنصر من القائمة.</translation> <translation id="901493112792887934">المدة الحالية بالثواني</translation> <translation id="5164977714490026579">يجب أن تكون القيمة أكبر من أو تساوي <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">هذا الأسبوع</translation> <translation id="5966707198760109579">الأسبوع</translation> <translation id="2901282870647571346">حالة الفيلم الحالية</translation> +<translation id="2060505056492490888">تم استخدام "<ph name="DOT"/>" في موضع خاطئ في "<ph name="INVALIDDOMAIN"/>".</translation> <translation id="2674318244760992338">تذييل</translation> <translation id="8987927404178983737">شهر</translation> <translation id="8115662671911883373">بدء عرض التسميات التوضيحية المغلقة</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">الاختيار</translation> <translation id="2846343701378493991">1024 (درجة متوسطة)</translation> <translation id="1637811476055996098">اختيار الملفات</translation> +<translation id="49969490063480558">يُرجى إدخال الجزء الذي يلي العلامة "<ph name="ATSIGN"/>"، حيث إن "<ph name="INVALIDADDRESS"/>" غير مكتمل.</translation> <translation id="5476505524087279545">إزالة علامة الاختيار</translation> <translation id="2148716181193084225">اليوم</translation> <translation id="2507943997699731163">الرجاء ملء هذا الحقل.</translation> <translation id="3785482301506746191">شريط تمرير وقت الفيلم</translation> <translation id="739024184232394898">آخر...</translation> +<translation id="383465348367842624">الجزء المتبوع بالعلامة "<ph name="ATSIGN"/>" يجب ألا يشتمل على الرمز "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="5468998798572797635">إنهاء وضع ملء الشاشة</translation> <translation id="5919473608089529604">تعذر تحميل المكوّن الإضافي.</translation> <translation id="5546461542133609677">إعادة الصوت</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">الرجاء إدخال قائمة مفصولة بفواصل لعناوين البريد الإلكتروني.</translation> <translation id="5939518447894949180">إعادة</translation> <translation id="1921819250265091946">يوم</translation> +<translation id="2613802280814924224">يُرجى إدخال قيمة صالحة. علمًا بأن أقرب قيمة صالحة هي <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">قيمة غير صحيحة</translation> <translation id="1842960171412779397">الاختيار</translation> <translation id="7673697353781729403">ساعات</translation> +<translation id="4664250907885839816">يجب ألا يشتمل الجزء الذي يلي العلامة "<ph name="ATSIGN"/>" على الرمز "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="3450233048674729344">يجب أن تكون القيمة أقل من أو تساوي <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">الرجوع للوراء بمقدار 30 ثانية</translation> <translation id="668171684555832681">ملف تعريف آخر...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">تنشيط</translation> <translation id="8444882422881193423">عدد الملفات: <ph name="NUMBER_OF_FILES"/></translation> <translation id="6643016212128521049">محو</translation> +<translation id="7888071071722539607">يُرجى تضمين العلامة "<ph name="ATSIGN"/>" في عنوان البريد الإلكتروني، حيث يفتقر "<ph name="INVALIDADDRESS"/>" إلى العلامة "<ph name="ATSIGN"/>".</translation> <translation id="4851297395436456855">تقديم سريع</translation> <translation id="1088086359088493902">ثوانٍ</translation> <translation id="3934680773876859118">إخفاق تحميل مستند PDF</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_bg.xtb b/chromium/webkit/glue/resources/webkit_strings_bg.xtb index eec0f57b386..c8e734cfb07 100644 --- a/chromium/webkit/glue/resources/webkit_strings_bg.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_bg.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Други...</translation> <translation id="2426432199384958866">връщане на поточно предавания филм към реално време</translation> <translation id="248395913932153421">Ден</translation> +<translation id="1729654308190250600">Моля, въведете имейл адрес.</translation> <translation id="6015796118275082299">Година</translation> <translation id="9186171386827445984">Документът се зарежда: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> страници...</translation> <translation id="1235745349614807883">Изчистване на скорошните търсения</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">списъчен показалец</translation> <translation id="4202807286478387388">преминаване</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Моля, въведете текст преди „<ph name="ATSIGN"/>“. „<ph name="INVALIDADDRESS"/>“ е непълно.</translation> +<translation id="2746543609216772311">Стойността трябва да е <ph name="MINIMUM_DATE_OR_TIME"/> или по-късно.</translation> <translation id="2572483411312390101">пускане</translation> <translation id="8785498733064193001">начало на възпроизвеждането</translation> <translation id="7057186640035488495">време от филма</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">бързо придвижване назад</translation> <translation id="7789962463072032349">поставяне на пауза</translation> <translation id="6853785296079745596">скриване на надписите</translation> +<translation id="4360991593054037559">Моля, въведете валидна стойност. Двете най-близки такива са <ph name="VALID_VALUE_LOW"/> и <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Други...</translation> <translation id="8141602879876242471">В този индекс може да се търси. Въведете ключови думи за търсене:</translation> <translation id="1930711995431081526">състояние</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">бързо придвижване напред</translation> <translation id="4812940957355064477">Моля, въведете номер.</translation> <translation id="2548326553472216322">Няма скорошни търсения</translation> +<translation id="1938124657309484470">Стойността трябва да е <ph name="MAXIMUM_DATE_OR_TIME"/> или по-рано.</translation> <translation id="7263440858009898357">Моля, изберете елемент в списъка.</translation> <translation id="901493112792887934">текущо време в секунди</translation> <translation id="5164977714490026579">Стойността трябва да е по-голяма или равна на <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Тази седмица</translation> <translation id="5966707198760109579">Седмица</translation> <translation id="2901282870647571346">текущо състояние на филма</translation> +<translation id="2060505056492490888">„<ph name="DOT"/>“ се използва на неправилна позиция в/ъв „<ph name="INVALIDDOMAIN"/>“.</translation> <translation id="2674318244760992338">долен колонтитул</translation> <translation id="8987927404178983737">Месец</translation> <translation id="8115662671911883373">започване на показването на надписите</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">отмятане</translation> <translation id="2846343701378493991">1024 (средна степен на сложност)</translation> <translation id="1637811476055996098">Избор на файлове</translation> +<translation id="49969490063480558">Моля, въведете текст след „<ph name="ATSIGN"/>“. „<ph name="INVALIDADDRESS"/>“ е непълно.</translation> <translation id="5476505524087279545">премахване на отметката</translation> <translation id="2148716181193084225">Днес</translation> <translation id="2507943997699731163">Моля, попълнете това поле.</translation> <translation id="3785482301506746191">времеви плъзгач за филма</translation> <translation id="739024184232394898">Други...</translation> +<translation id="383465348367842624">Текстът преди „<ph name="ATSIGN"/>“ не бива да съдържа символа „<ph name="INVALIDCHARACTER"/>“.</translation> <translation id="5468998798572797635">изход от цял екран</translation> <translation id="5919473608089529604">Приставката не можа да се зареди.</translation> <translation id="5546461542133609677">пускане на звука</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Моля, въведете списък с имейл адреси, разделени със запетаи.</translation> <translation id="5939518447894949180">Повторно задаване</translation> <translation id="1921819250265091946">дд</translation> +<translation id="2613802280814924224">Моля, въведете валидна стойност. Най-близката такава е <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Невалидна стойност.</translation> <translation id="1842960171412779397">Избиране</translation> <translation id="7673697353781729403">Часове</translation> +<translation id="4664250907885839816">Текстът след „<ph name="ATSIGN"/>“ не бива да съдържа символа „<ph name="INVALIDCHARACTER"/>“.</translation> <translation id="3450233048674729344">Стойността трябва да е по-малка или равна на <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">назад с 30 секунди</translation> <translation id="668171684555832681">Друг...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">активиране</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> файла</translation> <translation id="6643016212128521049">Изчистване</translation> +<translation id="7888071071722539607">Моля, включете „<ph name="ATSIGN"/>“ в имейл адреса. В/ъв „<ph name="INVALIDADDRESS"/>“ липсва „<ph name="ATSIGN"/>“.</translation> <translation id="4851297395436456855">превъртане напред</translation> <translation id="1088086359088493902">Секунди</translation> <translation id="3934680773876859118">PDF документът не успя да се зареди</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_bn.xtb b/chromium/webkit/glue/resources/webkit_strings_bn.xtb index f6cbeec8746..0cb46b8663f 100644 --- a/chromium/webkit/glue/resources/webkit_strings_bn.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_bn.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">অন্যান্য...</translation> <translation id="2426432199384958866">স্ট্রীমিং চলচ্চিত্রটিকে রিয়েল টাইমে ফেরান</translation> <translation id="248395913932153421">দিন</translation> +<translation id="1729654308190250600">দয়া করে একটি খালি না থাকা ইমেল ঠিকানা লিখুন৷</translation> <translation id="6015796118275082299">বছর</translation> <translation id="9186171386827445984">নথি লোড হচ্ছে: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> পৃষ্ঠা...</translation> <translation id="1235745349614807883">সাম্প্রতিক অনুসন্ধানগুলি সাফ করুন</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">তালিকা নির্দেশক</translation> <translation id="4202807286478387388">লাফ দিন</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">'<ph name="ATSIGN"/>' অনুসরণ করে একটি অংশ লিখুন৷ '<ph name="INVALIDADDRESS"/>' অসম্পূর্ণ৷</translation> +<translation id="2746543609216772311">মানকে অবশ্যই <ph name="MINIMUM_DATE_OR_TIME"/> বা পরবর্তী হতে হবে৷</translation> <translation id="2572483411312390101">চালনা করুন</translation> <translation id="8785498733064193001">প্লেব্যাক শুরু করুন</translation> <translation id="7057186640035488495">চলচ্চিত্রের সময়</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">দ্রুত পেছনে যাওয়া পছন্দ করুন</translation> <translation id="7789962463072032349">বিরাম</translation> <translation id="6853785296079745596">বন্ধ করা পরিচয়লিপিগুলি লুকান</translation> +<translation id="4360991593054037559">দয়া করে একটি বৈধ মান লিখুন৷ দুটি কাছাকাছির বৈধ মান হল <ph name="VALID_VALUE_LOW"/> এবং <ph name="VALID_VALUE_HIGHER"/>৷</translation> <translation id="1758486001363313524">অন্যান্য...</translation> <translation id="8141602879876242471">এটি অনুসন্ধানযোগ্য সূচি৷ অনুসন্ধানের মূলশব্দ প্রবেশ করান:</translation> <translation id="1930711995431081526">স্থিতি</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">দ্রুত এগিয়ে যাওয়া পচ্ছন্দ করুন</translation> <translation id="4812940957355064477">দয়া করে একটি সংখ্যা লিখুন৷</translation> <translation id="2548326553472216322">কোন সাম্প্রতিক অনুসন্ধান নেই</translation> +<translation id="1938124657309484470">মানকে অবশ্যই <ph name="MAXIMUM_DATE_OR_TIME"/> বা আগের হতে হবে৷</translation> <translation id="7263440858009898357">তালিকা থেকে একটি আইটেম নির্বাচন করুন৷ </translation> <translation id="901493112792887934">সেকেন্ডে বর্তমান সময়</translation> <translation id="5164977714490026579">মানটি অবশ্যই <ph name="MINIMUM"/>এর চেয়ে বেশি বা সমান হবে৷</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">এই সপ্তাহ</translation> <translation id="5966707198760109579">সপ্তাহ</translation> <translation id="2901282870647571346">চলচ্চিত্রের বর্তমান অবস্থা</translation> +<translation id="2060505056492490888">'<ph name="INVALIDDOMAIN"/>' এ একটি ভুল অবস্থানে '<ph name="DOT"/>' ব্যবহৃত হয়েছে৷</translation> <translation id="2674318244760992338">পাদলেখ</translation> <translation id="8987927404178983737">মাস</translation> <translation id="8115662671911883373">বন্ধ পরিচয়লিপিগুলির প্রদর্শন শুরু করুন</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">চেক করুন</translation> <translation id="2846343701378493991">1024 (মধ্যম গ্রেড)</translation> <translation id="1637811476055996098">ফাইল চয়ন করুন</translation> +<translation id="49969490063480558">দয়া করে '<ph name="ATSIGN"/>' অনুসরণ করে একটি অংশ লিখুন৷ '<ph name="INVALIDADDRESS"/>' অসম্পূর্ণ৷</translation> <translation id="5476505524087279545">আনচেক</translation> <translation id="2148716181193084225">আজ</translation> <translation id="2507943997699731163">দয়া করে এই ক্ষেত্রটি পূরণ করুন৷</translation> <translation id="3785482301506746191">চলচ্চিত্র সময় স্ক্রাবার</translation> <translation id="739024184232394898">অন্যান্য...</translation> +<translation id="383465348367842624">'<ph name="ATSIGN"/>' অনুসরণ করে এমন একটি অংশে '<ph name="INVALIDCHARACTER"/>' চিহ্ন থাকা উচিত নয়৷</translation> <translation id="5468998798572797635">পূর্ণ স্ক্রীন বন্ধ করুন</translation> <translation id="5919473608089529604">প্লাগ-ইন লোড করা যায়নি৷</translation> <translation id="5546461542133609677">সশব্দ</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">দয়া করে ইমেল ঠিকানাগুলির একটি কমা দিয়ে আলাদা করা মান প্রবেশ করান৷</translation> <translation id="5939518447894949180">রিসেট করুন</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">দয়া করে একটি বৈধ মান লিখুন৷ কাছাকাছির বৈধ মান হল <ph name="VALID_VALUE"/>৷</translation> <translation id="835897206747267392">অকার্যকর মান৷</translation> <translation id="1842960171412779397">নির্বাচন করুন</translation> <translation id="7673697353781729403">ঘন্টা</translation> +<translation id="4664250907885839816">'<ph name="ATSIGN"/>' অনুসরণ করে এমন একটি অংশে '<ph name="INVALIDCHARACTER"/>' চিহ্ন থাকা উচিত নয়৷</translation> <translation id="3450233048674729344">মানটি অবশ্যই <ph name="MAXIMUM"/>এর চেয়ে কম বা সমান হবে৷</translation> <translation id="3471999216963526757">৩০ সেকেন্ড পেছনে যান</translation> <translation id="668171684555832681">অন্যান্য...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">সক্রিয় করুন</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> টি ফাইল</translation> <translation id="6643016212128521049">সাফ করুন</translation> +<translation id="7888071071722539607">ইমেল ঠিনাকাটিতে দয়া করে একটি '<ph name="ATSIGN"/>' অন্তর্ভুক্ত করুন৷ '<ph name="INVALIDADDRESS"/>' এ একটি '<ph name="ATSIGN"/>' অনুপস্থিত৷</translation> <translation id="4851297395436456855">দ্রুত এগিয়ে যান</translation> <translation id="1088086359088493902">সেকেন্ড</translation> <translation id="3934680773876859118">PDF দস্তাবেজ লোড হতে ব্যর্থ</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_ca.xtb b/chromium/webkit/glue/resources/webkit_strings_ca.xtb index dd9fe0f4291..f1e66c0e43c 100644 --- a/chromium/webkit/glue/resources/webkit_strings_ca.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_ca.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Altres...</translation> <translation id="2426432199384958866">restableix la reproducció de la pel·lícula a temps real</translation> <translation id="248395913932153421">Dia</translation> +<translation id="1729654308190250600">Introduïu una adreça electrònica.</translation> <translation id="6015796118275082299">Any</translation> <translation id="9186171386827445984">S'està carregant el document: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> pàgines...</translation> <translation id="1235745349614807883">Esborra les cerques recents</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">marcador de llistes</translation> <translation id="4202807286478387388">salta</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Introduïu un nom d'usuari seguit de "<ph name="ATSIGN"/>". "<ph name="INVALIDADDRESS"/>" no és una adreça completa.</translation> +<translation id="2746543609216772311">El valor ha de ser <ph name="MINIMUM_DATE_OR_TIME"/> o posterior.</translation> <translation id="2572483411312390101">reprodueix</translation> <translation id="8785498733064193001">inicia la reproducció</translation> <translation id="7057186640035488495">moment de la pel·lícula</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">torna enrere ràpidament</translation> <translation id="7789962463072032349">pausa</translation> <translation id="6853785296079745596">amaga els subtítols ocults</translation> +<translation id="4360991593054037559">Introduïu un valor vàlid. Els valors vàlids més propers són <ph name="VALID_VALUE_LOW"/> i <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Altres...</translation> <translation id="8141602879876242471">És un índex on es poden realitzar cerques. Introdueix els termes de cerca:</translation> <translation id="1930711995431081526">estat</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">permet avançar ràpidament</translation> <translation id="4812940957355064477">Introduïu un número.</translation> <translation id="2548326553472216322">No hi ha cerques recents</translation> +<translation id="1938124657309484470">El valor ha de ser <ph name="MAXIMUM_DATE_OR_TIME"/> o anterior.</translation> <translation id="7263440858009898357">Seleccioneu un element de la llista.</translation> <translation id="901493112792887934">temps actual en segons</translation> <translation id="5164977714490026579">El valor ha de ser més gran o igual que <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Aquesta setmana</translation> <translation id="5966707198760109579">Setmana</translation> <translation id="2901282870647571346">estat actual de la pel·lícula</translation> +<translation id="2060505056492490888">"<ph name="DOT"/>" s'ha utilitzat en una posició incorrecta a "<ph name="INVALIDDOMAIN"/>".</translation> <translation id="2674318244760992338">peu</translation> <translation id="8987927404178983737">Mes</translation> <translation id="8115662671911883373">comença a mostrar subtítols ocults</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">marca</translation> <translation id="2846343701378493991">1024 (Mitjà)</translation> <translation id="1637811476055996098">Trieu els fitxers</translation> +<translation id="49969490063480558">Introduïu un domini precedit per "<ph name="ATSIGN"/>". "<ph name="INVALIDADDRESS"/>" no és una adreça electrònica completa.</translation> <translation id="5476505524087279545">desmarca</translation> <translation id="2148716181193084225">Avui</translation> <translation id="2507943997699731163">Empleneu aquest camp.</translation> <translation id="3785482301506746191">barra de moment de la pel·lícula</translation> <translation id="739024184232394898">Altres...</translation> +<translation id="383465348367842624">Un nom d'usuari seguit de "<ph name="ATSIGN"/>" no pot contenir el símbol "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="5468998798572797635">surt de la pantalla completa</translation> <translation id="5919473608089529604">No s'ha pogut carregar el connector.</translation> <translation id="5546461542133609677">activa el so</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Introduïu una llista d'adreces electròniques separades per comes.</translation> <translation id="5939518447894949180">Restablir</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Introduïu un valor vàlid. El valor vàlid més proper és <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Valor no vàlid.</translation> <translation id="1842960171412779397">selecciona</translation> <translation id="7673697353781729403">Hores</translation> +<translation id="4664250907885839816">Un domini precedit per "<ph name="ATSIGN"/>" no pot contenir el símbol "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="3450233048674729344">El valor ha de ser més petit o igual que <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">retrocedeix 30 segons</translation> <translation id="668171684555832681">Altres...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">activa</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> fitxers</translation> <translation id="6643016212128521049">Esborra</translation> +<translation id="7888071071722539607">Incloeu el símbol "<ph name="ATSIGN"/>" a l'adreça electrònica. Al camp "<ph name="INVALIDADDRESS"/>" falta el símbol "<ph name="ATSIGN"/>".</translation> <translation id="4851297395436456855">avança ràpidament</translation> <translation id="1088086359088493902">Segons</translation> <translation id="3934680773876859118">No es pot carregar el document en format PDF</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_cs.xtb b/chromium/webkit/glue/resources/webkit_strings_cs.xtb index 777bb41a198..615a93e064f 100644 --- a/chromium/webkit/glue/resources/webkit_strings_cs.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_cs.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Jiné…</translation> <translation id="2426432199384958866">vrátit se k přehrávání v reálném čase</translation> <translation id="248395913932153421">Den</translation> +<translation id="1729654308190250600">Vyplňte e-mailovou adresu.</translation> <translation id="6015796118275082299">Rok</translation> <translation id="9186171386827445984">Načítání dokumentu: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> stran...</translation> <translation id="1235745349614807883">Smazat nedávná vyhledávání</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">značka seznamu</translation> <translation id="4202807286478387388">přejít</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Zadejte část před znakem <ph name="ATSIGN"/>. Adresa <ph name="INVALIDADDRESS"/> není úplná.</translation> +<translation id="2746543609216772311">Datum musí být <ph name="MINIMUM_DATE_OR_TIME"/> nebo později.</translation> <translation id="2572483411312390101">přehrát</translation> <translation id="8785498733064193001">zahájit přehrávání</translation> <translation id="7057186640035488495">čas filmu</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">rychlé přetáčení zpět</translation> <translation id="7789962463072032349">pozastavit</translation> <translation id="6853785296079745596">skrýt titulky</translation> +<translation id="4360991593054037559">Zadejte platnou hodnotu. Dvě nejbližší hodnoty jsou <ph name="VALID_VALUE_LOW"/> a <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Jiné…</translation> <translation id="8141602879876242471">Toto je prohledávatelný index. Zadejte hledaná klíčová slova:</translation> <translation id="1930711995431081526">stav</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">rychlé přetáčení vpřed</translation> <translation id="4812940957355064477">Zadejte prosím číslo.</translation> <translation id="2548326553472216322">Žádná nedávná vyhledávání</translation> +<translation id="1938124657309484470">Datum musí být <ph name="MAXIMUM_DATE_OR_TIME"/> nebo dříve.</translation> <translation id="7263440858009898357">Vyberte prosím v seznamu některou položku.</translation> <translation id="901493112792887934">aktuální čas v sekundách</translation> <translation id="5164977714490026579">Hodnota musí být větší nebo rovna <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Tento týden</translation> <translation id="5966707198760109579">Týden</translation> <translation id="2901282870647571346">aktuální stav filmu</translation> +<translation id="2060505056492490888">Znak <ph name="DOT"/> v doméně <ph name="INVALIDDOMAIN"/> není použitý správně.</translation> <translation id="2674318244760992338">zápatí</translation> <translation id="8987927404178983737">Měsíc</translation> <translation id="8115662671911883373">zahájit zobrazování titulků</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">zaškrtnout</translation> <translation id="2846343701378493991">1024 (Střední kvalita)</translation> <translation id="1637811476055996098">Zvolit soubory</translation> +<translation id="49969490063480558">Zadejte část za znakem <ph name="ATSIGN"/>. Adresa <ph name="INVALIDADDRESS"/> není úplná.</translation> <translation id="5476505524087279545">odstranit zaškrtnutí</translation> <translation id="2148716181193084225">Dnes</translation> <translation id="2507943997699731163">Vyplňte prosím toto pole.</translation> <translation id="3785482301506746191">posuvník filmu</translation> <translation id="739024184232394898">Jiné…</translation> +<translation id="383465348367842624">Část před znakem <ph name="ATSIGN"/> nesmí obsahovat znak <ph name="INVALIDCHARACTER"/>.</translation> <translation id="5468998798572797635">ukončit režim celé obrazovky</translation> <translation id="5919473608089529604">Plugin se nepodařilo načíst.</translation> <translation id="5546461542133609677">zapnout zvuk</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Zadejte seznam e-mailových adres oddělených čárkami.</translation> <translation id="5939518447894949180">Resetovat</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Zadejte platnou hodnotu. Nejbližší platná hodnota je <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Neplatná hodnota.</translation> <translation id="1842960171412779397">zvolit</translation> <translation id="7673697353781729403">Hodiny</translation> +<translation id="4664250907885839816">Část za znakem <ph name="ATSIGN"/> nesmí obsahovat znak <ph name="INVALIDCHARACTER"/>.</translation> <translation id="3450233048674729344">Hodnota musí být menší nebo rovna <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">zpět o 30 sekund</translation> <translation id="668171684555832681">Další...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">aktivovat</translation> <translation id="8444882422881193423">Počet souborů: <ph name="NUMBER_OF_FILES"/></translation> <translation id="6643016212128521049">Vymazat</translation> +<translation id="7888071071722539607">Do e-mailové adresy zahrňte znak <ph name="ATSIGN"/>. V adrese <ph name="INVALIDADDRESS"/> chybí znak <ph name="ATSIGN"/>.</translation> <translation id="4851297395436456855">přetočit vpřed</translation> <translation id="1088086359088493902">Sekundy</translation> <translation id="3934680773876859118">Načítání dokumentu PDF se nezdařilo.</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_da.xtb b/chromium/webkit/glue/resources/webkit_strings_da.xtb index 849404309af..f461c7389aa 100644 --- a/chromium/webkit/glue/resources/webkit_strings_da.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_da.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Andet...</translation> <translation id="2426432199384958866">sæt filmstreaming tilbage til realtid</translation> <translation id="248395913932153421">Dag</translation> +<translation id="1729654308190250600">Angiv en e-mailadresse, der ikke er tom.</translation> <translation id="6015796118275082299">År</translation> <translation id="9186171386827445984">Indlæser dokument: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> sider...</translation> <translation id="1235745349614807883">Slet nylige søgninger</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">listemarkering</translation> <translation id="4202807286478387388">hop</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Angiv den del, der kommer før "<ph name="ATSIGN"/>". "<ph name="INVALIDADDRESS"/>" er ufuldstændig.</translation> +<translation id="2746543609216772311">Værdien må ikke være tidligere end <ph name="MINIMUM_DATE_OR_TIME"/>.</translation> <translation id="2572483411312390101">afspil</translation> <translation id="8785498733064193001">start afspilning</translation> <translation id="7057186640035488495">filmtid</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">spol hurtigt tilbage</translation> <translation id="7789962463072032349">pause</translation> <translation id="6853785296079745596">skjul undertekster</translation> +<translation id="4360991593054037559">Angiv en gyldig værdi. De to nærmeste gyldige værdier er <ph name="VALID_VALUE_LOW"/> og <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Andet...</translation> <translation id="8141602879876242471">Der kan søges i dette indeks. Indtast søge-nøgleord:</translation> <translation id="1930711995431081526">status</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">spol hurtigt frem</translation> <translation id="4812940957355064477">Angiv et nummer.</translation> <translation id="2548326553472216322">Ingen nylige søgninger</translation> +<translation id="1938124657309484470">Værdien må ikke være senere end <ph name="MAXIMUM_DATE_OR_TIME"/>.</translation> <translation id="7263440858009898357">Vælg et punkt på listen.</translation> <translation id="901493112792887934">aktuel tid i sekunder</translation> <translation id="5164977714490026579">Værdien skal være større end eller lig med <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Denne uge</translation> <translation id="5966707198760109579">Uge</translation> <translation id="2901282870647571346">aktuel filmstatus</translation> +<translation id="2060505056492490888">"<ph name="DOT"/>" er placeret forkert i "<ph name="INVALIDDOMAIN"/>".</translation> <translation id="2674318244760992338">sidefod</translation> <translation id="8987927404178983737">Måned</translation> <translation id="8115662671911883373">start visning af undertekster</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">markér</translation> <translation id="2846343701378493991">1024 (Mellemklasse)</translation> <translation id="1637811476055996098">Vælg filer</translation> +<translation id="49969490063480558">Angiv den del, der kommer efter "<ph name="ATSIGN"/>". "<ph name="INVALIDADDRESS"/>" er ufuldstændig.</translation> <translation id="5476505524087279545">fjern markering</translation> <translation id="2148716181193084225">I dag</translation> <translation id="2507943997699731163">Udfyld dette felt.</translation> <translation id="3785482301506746191">filmtidsskyder</translation> <translation id="739024184232394898">Andet...</translation> +<translation id="383465348367842624">Den del, der kommer før "<ph name="ATSIGN"/>", må ikke indeholde "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="5468998798572797635">afslut fuld skærm</translation> <translation id="5919473608089529604">Pluginnet kunne ikke indlæses.</translation> <translation id="5546461542133609677">slå lyd til</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Angiv en kommasepareret liste over e-mailadresser.</translation> <translation id="5939518447894949180">Nulstil</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Angiv en gyldig værdi. Den nærmeste gyldige værdi er <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Ugyldig værdi.</translation> <translation id="1842960171412779397">vælg</translation> <translation id="7673697353781729403">Timer</translation> +<translation id="4664250907885839816">Den del, der kommer efter "<ph name="ATSIGN"/>", må ikke indeholde symbolet "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="3450233048674729344">Værdien skal være mindre end eller lig med <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">gå 30 sekunder tilbage</translation> <translation id="668171684555832681">Andre ...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">aktiver</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> filer</translation> <translation id="6643016212128521049">Ryd</translation> +<translation id="7888071071722539607">E-mailadressen skal indeholde et "<ph name="ATSIGN"/>". "<ph name="INVALIDADDRESS"/>" mangler et "<ph name="ATSIGN"/>".</translation> <translation id="4851297395436456855">spol frem</translation> <translation id="1088086359088493902">Sekunder</translation> <translation id="3934680773876859118">PDF-dokumentet kunne ikke indlæses</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_de.xtb b/chromium/webkit/glue/resources/webkit_strings_de.xtb index 280a9c1ae7d..bd7b34e279a 100644 --- a/chromium/webkit/glue/resources/webkit_strings_de.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_de.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Andere...</translation> <translation id="2426432199384958866">Vom Streaming zu Echtzeit zurückkehren</translation> <translation id="248395913932153421">Tag</translation> +<translation id="1729654308190250600">Geben Sie eine E-Mail-Adresse ein.</translation> <translation id="6015796118275082299">Jahr</translation> <translation id="9186171386827445984">Dokument wird geladen <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> Seiten...</translation> <translation id="1235745349614807883">Vor Kurzem durchgeführte Suchanfragen löschen</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">Listenmarkierung</translation> <translation id="4202807286478387388">springen</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Geben Sie etwas vor dem <ph name="ATSIGN"/>-Zeichen ein. Die Angabe "<ph name="INVALIDADDRESS"/>" ist unvollständig.</translation> +<translation id="2746543609216772311">Verwenden Sie <ph name="MINIMUM_DATE_OR_TIME"/> oder einen späteren Wert.</translation> <translation id="2572483411312390101">Wiedergeben</translation> <translation id="8785498733064193001">Wiedergabe starten</translation> <translation id="7057186640035488495">Filmdauer</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">Schneller Rücklauf</translation> <translation id="7789962463072032349">Pausieren</translation> <translation id="6853785296079745596">Untertitel ausblenden</translation> +<translation id="4360991593054037559">Geben Sie einen gültigen Wert ein. Die zwei nächstliegenden gültigen Werte sind <ph name="VALID_VALUE_LOW"/> und <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Andere...</translation> <translation id="8141602879876242471">Dieser Index kann durchsucht werden. Geben Sie Suchbegriffe ein:</translation> <translation id="1930711995431081526">Status</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">Schneller Vorlauf</translation> <translation id="4812940957355064477">Geben Sie eine Nummer ein.</translation> <translation id="2548326553472216322">Keine vor Kurzem durchgeführte Suchanfragen</translation> +<translation id="1938124657309484470">Verwenden Sie <ph name="MAXIMUM_DATE_OR_TIME"/> oder einen früheren Wert.</translation> <translation id="7263440858009898357">Wählen Sie ein Element in der Liste aus.</translation> <translation id="901493112792887934">Aktuelle Dauer in Sekunden</translation> <translation id="5164977714490026579">Wert muss größer als oder gleich <ph name="MINIMUM"/> sein.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Diese Woche</translation> <translation id="5966707198760109579">Woche</translation> <translation id="2901282870647571346">Aktueller Filmstatus</translation> +<translation id="2060505056492490888">Das Punktzeichen "<ph name="DOT"/>" steht in "<ph name="INVALIDDOMAIN"/>" an einer falschen Stelle.</translation> <translation id="2674318244760992338">Fußzeile</translation> <translation id="8987927404178983737">Monat</translation> <translation id="8115662671911883373">Untertitel ab sofort anzeigen</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">auswählen</translation> <translation id="2846343701378493991">1024 (mittlere Stufe)</translation> <translation id="1637811476055996098">Dateien auswählen</translation> +<translation id="49969490063480558">Geben Sie etwas nach dem <ph name="ATSIGN"/>-Zeichen ein. Die Angabe "<ph name="INVALIDADDRESS"/>" ist unvollständig.</translation> <translation id="5476505524087279545">Auswahl aufheben</translation> <translation id="2148716181193084225">Heute</translation> <translation id="2507943997699731163">Füllen Sie dieses Feld aus.</translation> <translation id="3785482301506746191">Video-Zeitachse</translation> <translation id="739024184232394898">Andere...</translation> +<translation id="383465348367842624">Vor dem <ph name="ATSIGN"/>-Zeichen darf das Zeichen "<ph name="INVALIDCHARACTER"/>" nicht verwendet werden.</translation> <translation id="5468998798572797635">Vollbildmodus beenden</translation> <translation id="5919473608089529604">Plug-in konnte nicht geladen werden.</translation> <translation id="5546461542133609677">Ton an</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Geben Sie eine durch Kommas getrennte Liste der E-Mail-Adressen ein.</translation> <translation id="5939518447894949180">Zurücksetzen</translation> <translation id="1921819250265091946">tt</translation> +<translation id="2613802280814924224">Geben Sie einen gültigen Wert ein. Der nächstliegende gültige Wert ist <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Ungültiger Wert.</translation> <translation id="1842960171412779397">auswählen</translation> <translation id="7673697353781729403">Stunden</translation> +<translation id="4664250907885839816">Nach dem <ph name="ATSIGN"/>-Zeichen darf das Zeichen "<ph name="INVALIDCHARACTER"/>" nicht verwendet werden.</translation> <translation id="3450233048674729344">Wert muss kleiner als oder gleich <ph name="MAXIMUM"/> sein.</translation> <translation id="3471999216963526757">30 Sekunden zurück</translation> <translation id="668171684555832681">Andere...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">aktivieren</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> Dateien</translation> <translation id="6643016212128521049">Löschen</translation> +<translation id="7888071071722539607">Die E-Mail-Adresse muss ein <ph name="ATSIGN"/>-Zeichen enthalten. In der Angabe "<ph name="INVALIDADDRESS"/>" fehlt ein <ph name="ATSIGN"/>-Zeichen.</translation> <translation id="4851297395436456855">Vorspulen</translation> <translation id="1088086359088493902">Sekunden</translation> <translation id="3934680773876859118">Fehler beim Laden des PDF-Dokuments</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_el.xtb b/chromium/webkit/glue/resources/webkit_strings_el.xtb index 846b67306d9..a9111fafd5d 100644 --- a/chromium/webkit/glue/resources/webkit_strings_el.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_el.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Άλλες…</translation> <translation id="2426432199384958866">επιστροφή ροής ταινίας σε πραγματικό χρόνο</translation> <translation id="248395913932153421">Ημέρα</translation> +<translation id="1729654308190250600">Καταχωρίστε μια διεύθυνση ηλεκτρονικού ταχυδρομείου.</translation> <translation id="6015796118275082299">Έτος</translation> <translation id="9186171386827445984">Φόρτωση εγγράφου: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> σελίδες...</translation> <translation id="1235745349614807883">Εκκαθάριση πρόσφατων αναζητήσεων</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">δείκτης λίστας</translation> <translation id="4202807286478387388">μεταπήδηση</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Καταχωρίστε το τμήμα της διεύθυνσης πριν το σύμβολο "<ph name="ATSIGN"/>". Η διεύθυνση "<ph name="INVALIDADDRESS"/>" δεν είναι πλήρης.</translation> +<translation id="2746543609216772311">Η τιμή πρέπει να είναι <ph name="MINIMUM_DATE_OR_TIME"/> ή μεταγενέστερη.</translation> <translation id="2572483411312390101">αναπαραγωγή</translation> <translation id="8785498733064193001">έναρξη αναπαραγωγής</translation> <translation id="7057186640035488495">χρόνος ταινίας</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">γρήγορη αναζήτηση προς τα πίσω</translation> <translation id="7789962463072032349">παύση</translation> <translation id="6853785296079745596">απόκρυψη υπότιτλων</translation> +<translation id="4360991593054037559">Καταχωρίστε μια έγκυρη τιμή. Οι δύο πιο κοντινές έγκυρες τιμές είναι <ph name="VALID_VALUE_LOW"/> και <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Άλλες…</translation> <translation id="8141602879876242471">Πρόκειται για ευρετήριο με δυνατότητα αναζήτησης. Πληκτρολογήστε λέξεις-κλειδιά αναζήτησης:</translation> <translation id="1930711995431081526">κατάσταση</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">γρήγορη αναζήτηση προς τα εμπρός</translation> <translation id="4812940957355064477">Εισαγάγετε έναν αριθμό.</translation> <translation id="2548326553472216322">Δεν υπάρχουν πρόσφατες αναζητήσεις</translation> +<translation id="1938124657309484470">Η τιμή πρέπει να είναι <ph name="MAXIMUM_DATE_OR_TIME"/> ή προγενέστερη.</translation> <translation id="7263440858009898357">Επιλέξτε ένα στοιχείο από τη λίστα.</translation> <translation id="901493112792887934">τρέχων χρόνος σε δευτερόλεπτα</translation> <translation id="5164977714490026579">Η τιμή πρέπει να είναι μεγαλύτερη ή ίση του <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Αυτήν την εβδομάδα</translation> <translation id="5966707198760109579">Εβδομάδα</translation> <translation id="2901282870647571346">τρέχουσα κατάσταση ταινίας</translation> +<translation id="2060505056492490888">Το σύμβολο "<ph name="DOT"/>" χρησιμοποιείται σε λάθος θέση στη διεύθυνση "<ph name="INVALIDDOMAIN"/>".</translation> <translation id="2674318244760992338">υποσέλιδο</translation> <translation id="8987927404178983737">Μήνας</translation> <translation id="8115662671911883373">έναρξη προβολής υπότιτλων</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">ενεργοποίηση</translation> <translation id="2846343701378493991">1024 (Μέτριος βαθμός)</translation> <translation id="1637811476055996098">Επιλογή αρχείων</translation> +<translation id="49969490063480558">Καταχωρίστε το τμήμα της διεύθυνσης μετά το σύμβολο "<ph name="ATSIGN"/>". Η διεύθυνση "<ph name="INVALIDADDRESS"/>" δεν είναι πλήρης.</translation> <translation id="5476505524087279545">απενεργοποίηση</translation> <translation id="2148716181193084225">Σήμερα</translation> <translation id="2507943997699731163">Συμπληρώστε αυτό το πεδίο.</translation> <translation id="3785482301506746191">δείκτης χρόνου ταινίας</translation> <translation id="739024184232394898">Άλλες…</translation> +<translation id="383465348367842624">Το τμήμα της διεύθυνσης πριν το σύμβολο "<ph name="ATSIGN"/>" δεν πρέπει να περιέχει το σύμβολο "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="5468998798572797635">έξοδος από πλήρη οθόνη</translation> <translation id="5919473608089529604">Αδυναμία φόρτωσης προσθήκης.</translation> <translation id="5546461542133609677">κατάργηση σίγασης</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Εισαγάγετε μια λίστα διευθύνσεων ηλεκτρονικού ταχυδρομείου διαχωρισμένη με κόμματα.</translation> <translation id="5939518447894949180">Επαναφορά</translation> <translation id="1921819250265091946">ηη</translation> +<translation id="2613802280814924224">Καταχωρίστε μια έγκυρη τιμή. Η κοντινότερη έγκυρη τιμή είναι <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Μη έγκυρη τιμή.</translation> <translation id="1842960171412779397">επιλογή</translation> <translation id="7673697353781729403">Ώρες</translation> +<translation id="4664250907885839816">Το τμήμα της διεύθυνσης μετά το σύμβολο "<ph name="ATSIGN"/>" δεν πρέπει να περιέχει το σύμβολο "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="3450233048674729344">Η τιμή πρέπει να είναι μικρότερη ή ίση του <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">πίσω για 30 δευτερόλεπτα</translation> <translation id="668171684555832681">Άλλο...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">ενεργοποίηση</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> αρχεία</translation> <translation id="6643016212128521049">Εκκαθάριση</translation> +<translation id="7888071071722539607">Συμπεριλάβετε το σύμβολο "<ph name="ATSIGN"/>" στη διεύθυνση ηλεκτρονικού ταχυδρομείου. Από τη διεύθυνση "<ph name="INVALIDADDRESS"/>" λείπει το σύμβολο "<ph name="ATSIGN"/>".</translation> <translation id="4851297395436456855">γρήγορη προώθηση</translation> <translation id="1088086359088493902">Δευτερόλεπτα</translation> <translation id="3934680773876859118">Δεν ήταν δυνατή η φόρτωση του εγγράφου PDF</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_en-GB.xtb b/chromium/webkit/glue/resources/webkit_strings_en-GB.xtb index c6ae1f33fb7..6acd634e88f 100644 --- a/chromium/webkit/glue/resources/webkit_strings_en-GB.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_en-GB.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Other...</translation> <translation id="2426432199384958866">return streaming film to real time</translation> <translation id="248395913932153421">Day</translation> +<translation id="1729654308190250600">Please enter a non-empty email address.</translation> <translation id="6015796118275082299">Year</translation> <translation id="9186171386827445984">Loading document: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> pages...</translation> <translation id="1235745349614807883">Clear Recent Searches</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">list marker</translation> <translation id="4202807286478387388">jump</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Please enter a part followed by '<ph name="ATSIGN"/>'. '<ph name="INVALIDADDRESS"/>' is incomplete.</translation> +<translation id="2746543609216772311">Value must be <ph name="MINIMUM_DATE_OR_TIME"/> or later.</translation> <translation id="2572483411312390101">play</translation> <translation id="8785498733064193001">begin playback</translation> <translation id="7057186640035488495">film time</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">seek quickly back</translation> <translation id="7789962463072032349">pause</translation> <translation id="6853785296079745596">hide closed captions</translation> +<translation id="4360991593054037559">Please enter a valid value. The two nearest valid values are <ph name="VALID_VALUE_LOW"/> and <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Other...</translation> <translation id="8141602879876242471">This is a searchable index. Enter search keywords:</translation> <translation id="1930711995431081526">status</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">seek quickly forward</translation> <translation id="4812940957355064477">Please enter a number.</translation> <translation id="2548326553472216322">No recent searches</translation> +<translation id="1938124657309484470">Value must be <ph name="MAXIMUM_DATE_OR_TIME"/> or earlier.</translation> <translation id="7263440858009898357">Please select an item in the list.</translation> <translation id="901493112792887934">current time in seconds</translation> <translation id="5164977714490026579">Value must be greater than or equal to <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">This week</translation> <translation id="5966707198760109579">Week</translation> <translation id="2901282870647571346">current film status</translation> +<translation id="2060505056492490888">'<ph name="DOT"/>' is used at a wrong position in '<ph name="INVALIDDOMAIN"/>'.</translation> <translation id="2674318244760992338">footer</translation> <translation id="8987927404178983737">Month</translation> <translation id="8115662671911883373">start displaying closed captions</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">tick</translation> <translation id="2846343701378493991">1024 (Medium Grade)</translation> <translation id="1637811476055996098">Choose Files</translation> +<translation id="49969490063480558">Please enter a part following '<ph name="ATSIGN"/>'. '<ph name="INVALIDADDRESS"/>' is incomplete.</translation> <translation id="5476505524087279545">untick</translation> <translation id="2148716181193084225">Today</translation> <translation id="2507943997699731163">Please fill in this field.</translation> <translation id="3785482301506746191">film time scrubber</translation> <translation id="739024184232394898">Other...</translation> +<translation id="383465348367842624">A part followed by '<ph name="ATSIGN"/>' should not contain the symbol '<ph name="INVALIDCHARACTER"/>'.</translation> <translation id="5468998798572797635">exit full screen</translation> <translation id="5919473608089529604">Couldn't load plug-in.</translation> <translation id="5546461542133609677">un-mute</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Please enter a comma-separated list of email addresses.</translation> <translation id="5939518447894949180">Reset</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Please enter a valid value. The nearest valid value is <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Invalid value.</translation> <translation id="1842960171412779397">select</translation> <translation id="7673697353781729403">Hours</translation> +<translation id="4664250907885839816">A part following '<ph name="ATSIGN"/>' should not contain the symbol '<ph name="INVALIDCHARACTER"/>'.</translation> <translation id="3450233048674729344">Value must be less than or equal to <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">back 30 seconds</translation> <translation id="668171684555832681">Other...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">activate</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> files</translation> <translation id="6643016212128521049">Clear</translation> +<translation id="7888071071722539607">Please include an '<ph name="ATSIGN"/>' in the email address. '<ph name="INVALIDADDRESS"/>' is missing an '<ph name="ATSIGN"/>'.</translation> <translation id="4851297395436456855">fast forward</translation> <translation id="1088086359088493902">Seconds</translation> <translation id="3934680773876859118">Failed to load PDF document</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_es-419.xtb b/chromium/webkit/glue/resources/webkit_strings_es-419.xtb index 79c85e9e51c..7008094a196 100644 --- a/chromium/webkit/glue/resources/webkit_strings_es-419.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_es-419.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Otra...</translation> <translation id="2426432199384958866">volver a la transmisión de películas en tiempo real</translation> <translation id="248395913932153421">Día</translation> +<translation id="1729654308190250600">Ingresa una dirección de correo electrónico que no esté vacía.</translation> <translation id="6015796118275082299">Año</translation> <translation id="9186171386827445984">Cargando documento: páginas <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/>...</translation> <translation id="1235745349614807883">Eliminar búsquedas recientes</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">marcador de listas</translation> <translation id="4202807286478387388">saltar</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Ingresa texto antes del signo "<ph name="ATSIGN"/>". La dirección "<ph name="INVALIDADDRESS"/>" está incompleta.</translation> +<translation id="2746543609216772311">El valor debe ser igual o posterior a <ph name="MINIMUM_DATE_OR_TIME"/>.</translation> <translation id="2572483411312390101">reproducir</translation> <translation id="8785498733064193001">comenzar la reproducción</translation> <translation id="7057186640035488495">horario de película</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">buscar rápidamente hacia atrás</translation> <translation id="7789962463072032349">pausa</translation> <translation id="6853785296079745596">ocultar los subtítulos</translation> +<translation id="4360991593054037559">Ingresa un valor válido. Los dos valores válidos más aproximados son <ph name="VALID_VALUE_LOW"/> y <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Otra...</translation> <translation id="8141602879876242471">Se trata de un índice que admite búsquedas. Escribe las palabras clave de búsqueda:</translation> <translation id="1930711995431081526">estado</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">avanzar rápidamente</translation> <translation id="4812940957355064477">Debes ingresar un número.</translation> <translation id="2548326553472216322">No hay búsquedas recientes</translation> +<translation id="1938124657309484470">El valor debe ser igual o anterior a <ph name="MAXIMUM_DATE_OR_TIME"/>.</translation> <translation id="7263440858009898357">Selecciona un elemento de la lista</translation> <translation id="901493112792887934">tiempo actual en segundos</translation> <translation id="5164977714490026579">El valor debe ser mayor de o igual a <ph name="MINIMUM"/></translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Esta semana</translation> <translation id="5966707198760109579">Semana</translation> <translation id="2901282870647571346">estado actual de la película</translation> +<translation id="2060505056492490888">El signo "<ph name="DOT"/>" está colocado en una posición incorrecta en "<ph name="INVALIDDOMAIN"/>".</translation> <translation id="2674318244760992338">pie de página</translation> <translation id="8987927404178983737">Mes</translation> <translation id="8115662671911883373">empezar a mostrar subtítulos</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">marcar</translation> <translation id="2846343701378493991">1024 (Mediano)</translation> <translation id="1637811476055996098">Elegir archivos</translation> +<translation id="49969490063480558">Ingresa texto después del signo "<ph name="ATSIGN"/>". La dirección "<ph name="INVALIDADDRESS"/>" está incompleta.</translation> <translation id="5476505524087279545">desmarcar</translation> <translation id="2148716181193084225">Hoy</translation> <translation id="2507943997699731163">Completa este campo</translation> <translation id="3785482301506746191">control deslizante de duración de la película</translation> <translation id="739024184232394898">Otra...</translation> +<translation id="383465348367842624">El texto antes del signo "<ph name="ATSIGN"/>" no debe incluir el símbolo "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="5468998798572797635">salir de pantalla completa</translation> <translation id="5919473608089529604">No es posible cargar el complemento.</translation> <translation id="5546461542133609677">desactivar silencio</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Ingresa una lista de direcciones de correo electrónico separadas por coma</translation> <translation id="5939518447894949180">Restablecer</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Ingresa un valor válido. El valor válido más aproximado es <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Valor no válido.</translation> <translation id="1842960171412779397">seleccionar</translation> <translation id="7673697353781729403">Horas</translation> +<translation id="4664250907885839816">El texto después del signo "<ph name="ATSIGN"/>" no debe incluir el símbolo "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="3450233048674729344">El valor debe ser menor de o igual a <ph name="MAXIMUM"/></translation> <translation id="3471999216963526757">rebobinar 30 segundos</translation> <translation id="668171684555832681">Otro...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">activar</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> archivos</translation> <translation id="6643016212128521049">Borrar</translation> +<translation id="7888071071722539607">Incluye un signo "<ph name="ATSIGN"/>" en la dirección de correo electrónico. La dirección "<ph name="INVALIDADDRESS"/>" no incluye el signo "<ph name="ATSIGN"/>".</translation> <translation id="4851297395436456855">avance rápido</translation> <translation id="1088086359088493902">Segundos</translation> <translation id="3934680773876859118">No se pudo cargar el documento PDF</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_es.xtb b/chromium/webkit/glue/resources/webkit_strings_es.xtb index 42367dd2c56..7295a706dfa 100644 --- a/chromium/webkit/glue/resources/webkit_strings_es.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_es.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Otra...</translation> <translation id="2426432199384958866">volver a la emisión de películas en tiempo real</translation> <translation id="248395913932153421">Día</translation> +<translation id="1729654308190250600">Introduce una dirección de correo electrónico que no esté vacía.</translation> <translation id="6015796118275082299">Año</translation> <translation id="9186171386827445984">Cargando documento: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> páginas...</translation> <translation id="1235745349614807883">Eliminar búsquedas recientes</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">marcador de listas</translation> <translation id="4202807286478387388">saltar</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Introduce texto seguido del signo "<ph name="ATSIGN"/>". La dirección "<ph name="INVALIDADDRESS"/>" está incompleta.</translation> +<translation id="2746543609216772311">El valor debe ser igual o posterior a <ph name="MINIMUM_DATE_OR_TIME"/>.</translation> <translation id="2572483411312390101">reproducir</translation> <translation id="8785498733064193001">iniciar reproducción</translation> <translation id="7057186640035488495">cronología de la película</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">rebobinar rápidamente</translation> <translation id="7789962463072032349">pausar</translation> <translation id="6853785296079745596">ocultar subtítulos cerrados</translation> +<translation id="4360991593054037559">Introduce un valor válido. Los dos valores válidos más aproximados son <ph name="VALID_VALUE_LOW"/> y <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Otra...</translation> <translation id="8141602879876242471">Se trata de un índice que admite búsquedas. Introduce las palabras clave de búsqueda:</translation> <translation id="1930711995431081526">estado</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">avanzar rápidamente</translation> <translation id="4812940957355064477">Debes introducir un número.</translation> <translation id="2548326553472216322">No hay búsquedas recientes</translation> +<translation id="1938124657309484470">El valor debe ser igual o anterior a <ph name="MAXIMUM_DATE_OR_TIME"/>.</translation> <translation id="7263440858009898357">Selecciona un elemento de la lista</translation> <translation id="901493112792887934">tiempo actual en segundos</translation> <translation id="5164977714490026579">El valor debe superior o igual a <ph name="MINIMUM"/></translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Esta semana</translation> <translation id="5966707198760109579">Semana</translation> <translation id="2901282870647571346">estado actual de la película</translation> +<translation id="2060505056492490888">El signo "<ph name="DOT"/>" está colocado en una posición incorrecta en la dirección "<ph name="INVALIDDOMAIN"/>".</translation> <translation id="2674318244760992338">pie de página</translation> <translation id="8987927404178983737">Mes</translation> <translation id="8115662671911883373">iniciar la visualización de subtítulos cerrados</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">marcar</translation> <translation id="2846343701378493991">1024 (Mediano)</translation> <translation id="1637811476055996098">Elegir archivos</translation> +<translation id="49969490063480558">Introduce texto detrás del signo "<ph name="ATSIGN"/>". La dirección "<ph name="INVALIDADDRESS"/>" está incompleta.</translation> <translation id="5476505524087279545">desmarcar</translation> <translation id="2148716181193084225">Hoy</translation> <translation id="2507943997699731163">Completa este campo</translation> <translation id="3785482301506746191">control deslizante de duración de la película</translation> <translation id="739024184232394898">Otra...</translation> +<translation id="383465348367842624">El texto seguido del signo "<ph name="ATSIGN"/>" no debe incluir el símbolo "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="5468998798572797635">salir de pantalla completa</translation> <translation id="5919473608089529604">No se ha podido cargar el complemento.</translation> <translation id="5546461542133609677">activar sonido</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Introduce una lista de direcciones de correo electrónico separada por comas</translation> <translation id="5939518447894949180">Restablecer</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Introduce un valor válido. El valor válido más aproximado es <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Valor no válido</translation> <translation id="1842960171412779397">seleccionar</translation> <translation id="7673697353781729403">Horas</translation> +<translation id="4664250907885839816">El texto detrás del signo "<ph name="ATSIGN"/>" no debe incluir el símbolo "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="3450233048674729344">El valor debe inferior o igual a <ph name="MAXIMUM"/></translation> <translation id="3471999216963526757">rebobinar 30 segundos</translation> <translation id="668171684555832681">Otros...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">activar</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> archivos</translation> <translation id="6643016212128521049">Eliminar</translation> +<translation id="7888071071722539607">Incluye un signo "<ph name="ATSIGN"/>" en la dirección de correo electrónico. La dirección "<ph name="INVALIDADDRESS"/>" no incluye el signo "<ph name="ATSIGN"/>".</translation> <translation id="4851297395436456855">avance rápido</translation> <translation id="1088086359088493902">Segundos</translation> <translation id="3934680773876859118">Se ha producido un error al cargar el documento PDF.</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_et.xtb b/chromium/webkit/glue/resources/webkit_strings_et.xtb index 599b997ca55..14ba666ef7c 100644 --- a/chromium/webkit/glue/resources/webkit_strings_et.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_et.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Muu ...</translation> <translation id="2426432199384958866">video voogesituse lülitamine tagasi reaalajale</translation> <translation id="248395913932153421">päev</translation> +<translation id="1729654308190250600">Sisestage mittetühi e-posti aadress.</translation> <translation id="6015796118275082299">Aasta</translation> <translation id="9186171386827445984">Dokumendi laadimine: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> lehte ...</translation> <translation id="1235745349614807883">Kustuta viimased otsingud</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">loendilooja</translation> <translation id="4202807286478387388">liigu</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Sisestage märgile „<ph name="ATSIGN"/>” eelnev osa. Aadress „<ph name="INVALIDADDRESS"/>” pole täielik.</translation> +<translation id="2746543609216772311">Väärtus peab olema <ph name="MINIMUM_DATE_OR_TIME"/> või hilisem.</translation> <translation id="2572483411312390101">esitus</translation> <translation id="8785498733064193001">taasesituse alustamine</translation> <translation id="7057186640035488495">video aeg</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">kiiresti tagasikerimine</translation> <translation id="7789962463072032349">peata</translation> <translation id="6853785296079745596">subtiitrite peitmine</translation> +<translation id="4360991593054037559">Sisestage kehtiv väärtus. Kaks lähimat kehtivat väärtust on <ph name="VALID_VALUE_LOW"/> ja <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Muu ...</translation> <translation id="8141602879876242471">See on otsitav indeks. Sisestage otsingu jaoks märksõnad:</translation> <translation id="1930711995431081526">olek</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">kiiresti edasikerimine</translation> <translation id="4812940957355064477">Sisestage arv.</translation> <translation id="2548326553472216322">Pole viimaseid otsingud</translation> +<translation id="1938124657309484470">Väärtus peab olema <ph name="MAXIMUM_DATE_OR_TIME"/> või varasem.</translation> <translation id="7263440858009898357">Valige loendist element.</translation> <translation id="901493112792887934">praegune aeg sekundites</translation> <translation id="5164977714490026579">Väärtus peab olema suurem või võrdne <ph name="MINIMUM"/>-ga.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">See nädal</translation> <translation id="5966707198760109579">Nädal</translation> <translation id="2901282870647571346">video praegune olek</translation> +<translation id="2060505056492490888">Tähist „<ph name="DOT"/>” on aadressis „<ph name="INVALIDDOMAIN"/>” valesti kasutatud.</translation> <translation id="2674318244760992338">jalus</translation> <translation id="8987927404178983737">kuu</translation> <translation id="8115662671911883373">subtiitrite kuvamise alustamine</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">mrgista</translation> <translation id="2846343701378493991">1024 (keskmine)</translation> <translation id="1637811476055996098">Vali failid</translation> +<translation id="49969490063480558">Sisestage märgile „<ph name="ATSIGN"/>” järgnev osa. Aadress „<ph name="INVALIDADDRESS"/>” pole täielik.</translation> <translation id="5476505524087279545">eemalda mrgistus</translation> <translation id="2148716181193084225">Täna</translation> <translation id="2507943997699731163">Täitke see väli.</translation> <translation id="3785482301506746191">video ajakursor</translation> <translation id="739024184232394898">Muu ...</translation> +<translation id="383465348367842624">Märgile „<ph name="ATSIGN"/>” eelnev osa ei tohi sisaldada sümbolit „<ph name="INVALIDCHARACTER"/>”.</translation> <translation id="5468998798572797635">täisekraanilt väljumine</translation> <translation id="5919473608089529604">Pistikprogrammi ei saanud laadida.</translation> <translation id="5546461542133609677">vaigistuse tühistamine</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Sisestage meiliaadresside loend komadega eraldatult.</translation> <translation id="5939518447894949180">Lähtesta</translation> <translation id="1921819250265091946">pp</translation> +<translation id="2613802280814924224">Sisestage kehtiv väärtus. Lähim kehtiv väärtus on <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Kehtetu väärtus.</translation> <translation id="1842960171412779397">vali</translation> <translation id="7673697353781729403">Tunnid</translation> +<translation id="4664250907885839816">Märgile „<ph name="ATSIGN"/>” järgnev osa ei tohi sisaldada sümbolit „<ph name="INVALIDCHARACTER"/>”.</translation> <translation id="3450233048674729344">Väärtus peab olema väiksem või võrdne <ph name="MAXIMUM"/>-ga.</translation> <translation id="3471999216963526757">tagasi 30 sekundit</translation> <translation id="668171684555832681">Muu...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">aktiveeri</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> faili</translation> <translation id="6643016212128521049">Tühjenda</translation> +<translation id="7888071071722539607">Lisage e-posti aadressile märk „<ph name="ATSIGN"/>”. Aadressist „<ph name="INVALIDADDRESS"/>” puudub märk „<ph name="ATSIGN"/>”.</translation> <translation id="4851297395436456855">edasikerimine</translation> <translation id="1088086359088493902">Sekundid</translation> <translation id="3934680773876859118">PDF-dokumendi laadimine nurjus</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_fa.xtb b/chromium/webkit/glue/resources/webkit_strings_fa.xtb index d64898e023d..260e9408e3f 100644 --- a/chromium/webkit/glue/resources/webkit_strings_fa.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_fa.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">موارد دیگر...</translation> <translation id="2426432199384958866">بازگرداندن فیلم پخش جریانی به پخش بیدرنگ</translation> <translation id="248395913932153421">روز</translation> +<translation id="1729654308190250600">لطفاً یک آدرس ایمیل غیرخالی وارد کنید.</translation> <translation id="6015796118275082299">سال</translation> <translation id="9186171386827445984">در حال بارگیری سند: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> صفحات...</translation> <translation id="1235745349614807883">پاک کردن جستجوهای اخیر</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">علامت گذار لیست</translation> <translation id="4202807286478387388">پرش</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">لطفاً قسمت قبل از «<ph name="ATSIGN"/>» را وارد کنید. «<ph name="INVALIDADDRESS"/>» ناقص است.</translation> +<translation id="2746543609216772311">مقدار باید <ph name="MINIMUM_DATE_OR_TIME"/> یا بعد از آن باشد.</translation> <translation id="2572483411312390101">پخش</translation> <translation id="8785498733064193001">شروع پخش</translation> <translation id="7057186640035488495">زمان فیلم</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">جستجوی سریع به عقب</translation> <translation id="7789962463072032349">توقف موقت</translation> <translation id="6853785296079745596">پنهان کردن توصیفهای بسته</translation> +<translation id="4360991593054037559">لطفاً یک مقدار معتبر وارد کنید. نزدیکترین مقادیر معتبر <ph name="VALID_VALUE_LOW"/> و <ph name="VALID_VALUE_HIGHER"/> هستند.</translation> <translation id="1758486001363313524">موارد دیگر...</translation> <translation id="8141602879876242471">این نمایه قابل جستجو است. کلمات کلیدی جستجو را وارد کنید:</translation> <translation id="1930711995431081526">وضعیت</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">جستجو به جلو</translation> <translation id="4812940957355064477">لطفاً شمارهای را وارد کنید.</translation> <translation id="2548326553472216322">جستجوی جدیدی وجود ندارد</translation> +<translation id="1938124657309484470">مقدار باید <ph name="MAXIMUM_DATE_OR_TIME"/> یا قبل از آن باشد.</translation> <translation id="7263440858009898357">لطفاً یک مورد را در لیست انتخاب کنید.</translation> <translation id="901493112792887934">زمان کنونی به ثانیه</translation> <translation id="5164977714490026579">مقدار باید بیشتر یا مساوی با <ph name="MINIMUM"/> باشد.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">این هفته</translation> <translation id="5966707198760109579">هفته</translation> <translation id="2901282870647571346">وضعیت کنونی فیلم</translation> +<translation id="2060505056492490888">«<ph name="DOT"/>» در «<ph name="INVALIDDOMAIN"/>» در محل اشتباهی قرار دارد.</translation> <translation id="2674318244760992338">پانویس</translation> <translation id="8987927404178983737">ماه</translation> <translation id="8115662671911883373">شروع به نمایش توصیفهای بسته</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">علامتگذاری</translation> <translation id="2846343701378493991">1024 (درجه متوسط)</translation> <translation id="1637811476055996098">انتخاب فایلها</translation> +<translation id="49969490063480558">لطفاً قسمت بعد از «<ph name="ATSIGN"/>» را وارد کنید. «<ph name="INVALIDADDRESS"/>» ناقص است.</translation> <translation id="5476505524087279545">برداشتن علامت</translation> <translation id="2148716181193084225">امروز</translation> <translation id="2507943997699731163">لطفاً این قسمت را تکمیل کنید.</translation> <translation id="3785482301506746191">حذفکننده زمان فیلم</translation> <translation id="739024184232394898">موارد دیگر...</translation> +<translation id="383465348367842624">قسمت قبل از «<ph name="ATSIGN"/>» نباید حاوی نماد «<ph name="INVALIDCHARACTER"/>» باشد.</translation> <translation id="5468998798572797635">خروج از حالت تمام صفحه</translation> <translation id="5919473608089529604">افزونه بارگیری نشد.</translation> <translation id="5546461542133609677">صدادارکردن</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">لطفاً لیستی از آدرسهای ایمیل که با کاما از هم جدا شدهاند را وارد کنید.</translation> <translation id="5939518447894949180">بازنشانی</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">لطفاً یک مقدار معتبر وارد کنید. نزدیکترین مقدار معتبر <ph name="VALID_VALUE"/> است.</translation> <translation id="835897206747267392">مقدار نامعتبر.</translation> <translation id="1842960171412779397">انتخاب</translation> <translation id="7673697353781729403">ساعت</translation> +<translation id="4664250907885839816">قسمت بعد از «<ph name="ATSIGN"/>» نباید حاوی نماد «<ph name="INVALIDCHARACTER"/>» باشد.</translation> <translation id="3450233048674729344">مقدار باید کمتر یا برابر با <ph name="MAXIMUM"/> باشد.</translation> <translation id="3471999216963526757">بازگشت به ۳۰ ثانیه قبل</translation> <translation id="668171684555832681">دیگر...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">فعالسازی</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> فایل</translation> <translation id="6643016212128521049">پاک کردن</translation> +<translation id="7888071071722539607">لطفاً نماد «<ph name="ATSIGN"/>» را به آدرس ایمیل اضافه کنید. «<ph name="INVALIDADDRESS"/>» در «<ph name="ATSIGN"/>» موجود نیست.</translation> <translation id="4851297395436456855">سریع به جلو</translation> <translation id="1088086359088493902">ثانیه</translation> <translation id="3934680773876859118">بارگیری سند PDF انجام نشد</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_fi.xtb b/chromium/webkit/glue/resources/webkit_strings_fi.xtb index e5c02cbef20..cf024adae18 100644 --- a/chromium/webkit/glue/resources/webkit_strings_fi.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_fi.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Muu...</translation> <translation id="2426432199384958866">palauta suoratoistettava elokuva reaaliaikaiseksi</translation> <translation id="248395913932153421">Päivä</translation> +<translation id="1729654308190250600">Kirjoita ei-tyhjä sähköpostiosoite.</translation> <translation id="6015796118275082299">Vuosi</translation> <translation id="9186171386827445984">Ladataan asiakirjaa: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> sivua...</translation> <translation id="1235745349614807883">Poista viimeisimmät haut</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">luettelon merkitsijä</translation> <translation id="4202807286478387388">siirry</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Lisää <ph name="ATSIGN"/>-osaa ennen tuleva osa. <ph name="INVALIDADDRESS"/> on puutteellinen.</translation> +<translation id="2746543609216772311">Arvon on oltava <ph name="MINIMUM_DATE_OR_TIME"/> tai myöhempi.</translation> <translation id="2572483411312390101">toista</translation> <translation id="8785498733064193001">aloita toisto</translation> <translation id="7057186640035488495">elokuvan aikajana</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">kuvakelaus taaksepäin</translation> <translation id="7789962463072032349">tauko</translation> <translation id="6853785296079745596">piilota tekstitykset</translation> +<translation id="4360991593054037559">Syötä kelvollinen arvo. Kaksi lähintä kelvollista arvoa ovat <ph name="VALID_VALUE_LOW"/> ja <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Muu...</translation> <translation id="8141602879876242471">Tämä on haettavissa oleva hakemisto. Anna hakusanat:</translation> <translation id="1930711995431081526">tila</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">kuvakelaus eteenpäin</translation> <translation id="4812940957355064477">Anna numero.</translation> <translation id="2548326553472216322">Ei viimeisimpiä hakuja</translation> +<translation id="1938124657309484470">Arvon on oltava <ph name="MAXIMUM_DATE_OR_TIME"/> tai aiempi.</translation> <translation id="7263440858009898357">Valitse kohde luettelosta.</translation> <translation id="901493112792887934">nykyinen toistoaika sekunteina</translation> <translation id="5164977714490026579">Arvon tulee olla suurempi tai yhtä suuri kuin <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Tällä viikolla</translation> <translation id="5966707198760109579">Viikko</translation> <translation id="2901282870647571346">elokuvan nykyinen tila</translation> +<translation id="2060505056492490888"><ph name="DOT"/>-merkkiä on käytetty väärässä kohdassa osoitteessa <ph name="INVALIDDOMAIN"/>.</translation> <translation id="2674318244760992338">alaviite</translation> <translation id="8987927404178983737">Kuukausi</translation> <translation id="8115662671911883373">näytä tekstitykset</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">valitse</translation> <translation id="2846343701378493991">1024 (keskitaso)</translation> <translation id="1637811476055996098">Valitse tiedostot</translation> +<translation id="49969490063480558">Lisää <ph name="ATSIGN"/>-osaa seuraava osa. <ph name="INVALIDADDRESS"/> on puutteellinen.</translation> <translation id="5476505524087279545">poista valinta</translation> <translation id="2148716181193084225">Tänään</translation> <translation id="2507943997699731163">Täytä tämä kenttä.</translation> <translation id="3785482301506746191">elokuvan ajan säädin</translation> <translation id="739024184232394898">Muu...</translation> +<translation id="383465348367842624"><ph name="ATSIGN"/>-osaa ennen tulevassa osassa ei pitäisi olla merkkiä <ph name="INVALIDCHARACTER"/>.</translation> <translation id="5468998798572797635">poistu koko näytön tilasta</translation> <translation id="5919473608089529604">Laajennuksen lataaminen epäonnistui.</translation> <translation id="5546461542133609677">peruuta mykistys</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Anna pilkuilla erotettu sähköpostiosoitteiden luettelo.</translation> <translation id="5939518447894949180">Tyhjennä</translation> <translation id="1921819250265091946">pp</translation> +<translation id="2613802280814924224">Syötä kelvollinen arvo. Lähin kelvollinen arvo on <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Virheellinen arvo.</translation> <translation id="1842960171412779397">Valitse</translation> <translation id="7673697353781729403">Tuntia</translation> +<translation id="4664250907885839816"><ph name="ATSIGN"/>-osan jälkeen tulevassa osassa ei pitäisi olla merkkiä <ph name="INVALIDCHARACTER"/>.</translation> <translation id="3450233048674729344">Arvon tulee olla pienempi tai yhtä suuri kuin <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">30 sekuntia taaksepäin</translation> <translation id="668171684555832681">Joku muu profiili...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">aktivoi</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> tiedostoa</translation> <translation id="6643016212128521049">Tyhjennä</translation> +<translation id="7888071071722539607">Sähköpostiosoitteeseen kuuluu <ph name="ATSIGN"/>-osa. Osoitteesta <ph name="INVALIDADDRESS"/> puuttuu <ph name="ATSIGN"/>.</translation> <translation id="4851297395436456855">kelaus eteenpäin</translation> <translation id="1088086359088493902">Sekuntia</translation> <translation id="3934680773876859118">PDF-asiakirjan lataaminen epäonnistui</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_fil.xtb b/chromium/webkit/glue/resources/webkit_strings_fil.xtb index 04e1c68aa21..ddbb0e9f1f8 100644 --- a/chromium/webkit/glue/resources/webkit_strings_fil.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_fil.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Iba pa...</translation> <translation id="2426432199384958866">ibalik sa real time ang streaming ng pelikula</translation> <translation id="248395913932153421">Araw</translation> +<translation id="1729654308190250600">Mangyaring maglagay ng isang non-empty na email address.</translation> <translation id="6015796118275082299">Taon</translation> <translation id="9186171386827445984">Nilo-load ang dokumento: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> (na) pahina...</translation> <translation id="1235745349614807883">Lisiman ang Kasalukuyang Mga Paghahanap</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">Ilista ang marker</translation> <translation id="4202807286478387388">tumalon</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Mangyaring maglagay ng isang bahagi na sinusundan ng '<ph name="ATSIGN"/>.' Hindi kumpleto ang '<ph name="INVALIDADDRESS"/>.'</translation> +<translation id="2746543609216772311">Dapat <ph name="MINIMUM_DATE_OR_TIME"/> o mas bago ang value.</translation> <translation id="2572483411312390101">i-play</translation> <translation id="8785498733064193001">simulan ang pag-playback</translation> <translation id="7057186640035488495">oras ng pelikula</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">mabilisang maghanap nang pabalik</translation> <translation id="7789962463072032349">i-pause</translation> <translation id="6853785296079745596">itago ang mga nakasarang caption</translation> +<translation id="4360991593054037559">Mangyaring maglagay ng isang wastong value. Ang dalawang pinakamalapit na wastong value ay <ph name="VALID_VALUE_LOW"/> at <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Iba pa...</translation> <translation id="8141602879876242471">Isa itong paghahanap ng index. Ipasok ang paghahanap sa mga keyword:</translation> <translation id="1930711995431081526">katayuan</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">mabilisang maghanap nang pasulong</translation> <translation id="4812940957355064477">Mangyaring maglagay ng numero.</translation> <translation id="2548326553472216322">Walang kamakailang mga paghahanap</translation> +<translation id="1938124657309484470">Dapat <ph name="MAXIMUM_DATE_OR_TIME"/> o mas nauna ang value.</translation> <translation id="7263440858009898357">Mangyaring pumili ng item sa listahan.</translation> <translation id="901493112792887934">kasalukuyang oras ayon sa segundo</translation> <translation id="5164977714490026579">Dapat mas mataas kaysa sa o katumbas ng <ph name="MINIMUM"/> ang halaga.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Linggong ito</translation> <translation id="5966707198760109579">Linggo</translation> <translation id="2901282870647571346">kasalukuyang katayuan ng pelikula</translation> +<translation id="2060505056492490888">Ginamit ang '<ph name="DOT"/>' sa maling posisyon sa '<ph name="INVALIDDOMAIN"/>.'</translation> <translation id="2674318244760992338">footer</translation> <translation id="8987927404178983737">Buwan</translation> <translation id="8115662671911883373">simulan ang pagpapakita ng mga nakasarang caption</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">I-tsek</translation> <translation id="2846343701378493991">1024 (Katamtamang Grado)</translation> <translation id="1637811476055996098">Pumili ng Mga File</translation> +<translation id="49969490063480558">Mangyaring maglagay ng isang bahagi pagkatapos ng '<ph name="ATSIGN"/>.' Hindi kumpleto ang '<ph name="INVALIDADDRESS"/>.'</translation> <translation id="5476505524087279545">i-uncheck</translation> <translation id="2148716181193084225">Ngayon</translation> <translation id="2507943997699731163">Pakipunan ang field na ito.</translation> <translation id="3785482301506746191">scrubber ng oras ng pelikula</translation> <translation id="739024184232394898">Iba pa...</translation> +<translation id="383465348367842624">Hindi dapat naglalaman ng simbolong '<ph name="INVALIDCHARACTER"/>' ang bahagi bago ang '<ph name="ATSIGN"/>.'</translation> <translation id="5468998798572797635">lumabas sa full screen</translation> <translation id="5919473608089529604">Hindi ma-load ang plug-in.</translation> <translation id="5546461542133609677">i-unmute</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Mangyaring magpasok ng listahan ng email address na pinaghihiwalay ng kuwit.</translation> <translation id="5939518447894949180">I-reset</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Mangyaring maglagay ng isang wastong value. Ang pinakamalapit na wastong value ay <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Di-wastong halaga.</translation> <translation id="1842960171412779397">piliin</translation> <translation id="7673697353781729403">Oras</translation> +<translation id="4664250907885839816">Hindi dapat naglalaman ng simbolong '<ph name="INVALIDCHARACTER"/>' ang bahagi pagkatapos ng '<ph name="ATSIGN"/>.'</translation> <translation id="3450233048674729344">Dapat mas mababa kaysa sa o katumbas ng <ph name="MAXIMUM"/> ang halaga.</translation> <translation id="3471999216963526757">bumalik nang 30 segundo</translation> <translation id="668171684555832681">Iba pa...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">isaaktibo</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> mga file</translation> <translation id="6643016212128521049">I-clear</translation> +<translation id="7888071071722539607">Mangyaring magsama ng '<ph name="ATSIGN"/>' sa email address. Kulang ng '<ph name="ATSIGN"/>' ang '<ph name="INVALIDADDRESS"/>.'</translation> <translation id="4851297395436456855">i-fast forward</translation> <translation id="1088086359088493902">Segundo</translation> <translation id="3934680773876859118">Nabigong i-load ang dokumentong PDF</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_fr.xtb b/chromium/webkit/glue/resources/webkit_strings_fr.xtb index 98641282d56..7fb087ef230 100644 --- a/chromium/webkit/glue/resources/webkit_strings_fr.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_fr.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Autre…</translation> <translation id="2426432199384958866">revenir à une lecture en streaming des films en temps réel</translation> <translation id="248395913932153421">Jour</translation> +<translation id="1729654308190250600">Veuillez saisir une adresse e-mail dans le champ correspondant.</translation> <translation id="6015796118275082299">Année</translation> <translation id="9186171386827445984">Chargement du document : <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> pages...</translation> <translation id="1235745349614807883">Effacer les recherches récentes</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">marqueur de liste</translation> <translation id="4202807286478387388">accéder</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/> × <ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Veuillez saisir la partie manquante avant le caractère "<ph name="ATSIGN"/>". L'adresse "<ph name="INVALIDADDRESS"/>" est incomplète.</translation> +<translation id="2746543609216772311">La date ou l'heure doit être égale ou postérieure à "<ph name="MINIMUM_DATE_OR_TIME"/>".</translation> <translation id="2572483411312390101">lire</translation> <translation id="8785498733064193001">commencer la lecture</translation> <translation id="7057186640035488495">durée du film</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">recherche arrière rapide</translation> <translation id="7789962463072032349">pause</translation> <translation id="6853785296079745596">masquer les sous-titres</translation> +<translation id="4360991593054037559">Veuillez saisir une valeur valide. Les deux valeurs valides les plus proches sont "<ph name="VALID_VALUE_LOW"/>" et "<ph name="VALID_VALUE_HIGHER"/>".</translation> <translation id="1758486001363313524">Autre…</translation> <translation id="8141602879876242471">Vous pouvez lancer des recherches dans cet index. Pour cela, entrez des mots clés de recherche :</translation> <translation id="1930711995431081526">état</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">recherche avant rapide</translation> <translation id="4812940957355064477">Veuillez saisir un nombre.</translation> <translation id="2548326553472216322">Aucune recherche récente</translation> +<translation id="1938124657309484470">La date ou l'heure doit être égale ou antérieure à "<ph name="MAXIMUM_DATE_OR_TIME"/>".</translation> <translation id="7263440858009898357">Sélectionnez un élément dans la liste.</translation> <translation id="901493112792887934">durée actuelle en secondes</translation> <translation id="5164977714490026579">Cette valeur doit être supérieure ou égale à <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Cette semaine</translation> <translation id="5966707198760109579">Semaine</translation> <translation id="2901282870647571346">état actuel du film</translation> +<translation id="2060505056492490888">L'emplacement du caractère "<ph name="DOT"/>" est incorrect dans "<ph name="INVALIDDOMAIN"/>".</translation> <translation id="2674318244760992338">pied de page</translation> <translation id="8987927404178983737">Mois</translation> <translation id="8115662671911883373">commencer à afficher les sous-titres</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">cocher</translation> <translation id="2846343701378493991">1024 (sécurité moyenne)</translation> <translation id="1637811476055996098">Sélect. fichiers</translation> +<translation id="49969490063480558">Veuillez saisir la partie manquante après le symbole "<ph name="ATSIGN"/>". L'adresse "<ph name="INVALIDADDRESS"/>" est incomplète.</translation> <translation id="5476505524087279545">décocher</translation> <translation id="2148716181193084225">Aujourd'hui</translation> <translation id="2507943997699731163">Veuillez renseigner ce champ.</translation> <translation id="3785482301506746191">barre de défilement de la durée du film</translation> <translation id="739024184232394898">Autre…</translation> +<translation id="383465348367842624">La partie suivie du symbole "<ph name="ATSIGN"/>" ne doit pas contenir le caractère "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="5468998798572797635">quitter le mode plein écran</translation> <translation id="5919473608089529604">Impossible de charger le plug-in.</translation> <translation id="5546461542133609677">réactiver le son</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Veuillez saisir une liste d'adresses e-mail séparées par une virgule.</translation> <translation id="5939518447894949180">Réinitialiser</translation> <translation id="1921819250265091946">jj</translation> +<translation id="2613802280814924224">Veuillez saisir une valeur valide. La valeur valide la plus proche est "<ph name="VALID_VALUE"/>".</translation> <translation id="835897206747267392">Valeur incorrecte</translation> <translation id="1842960171412779397">sélectionner</translation> <translation id="7673697353781729403">Heures</translation> +<translation id="4664250907885839816">La partie précédée du symbole "<ph name="ATSIGN"/>" ne doit pas contenir le caractère "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="3450233048674729344">Cette valeur doit être inférieure ou égale à <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">revenir en arrière de 30 secondes</translation> <translation id="668171684555832681">Autre...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">activer</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> fichiers</translation> <translation id="6643016212128521049">Effacer</translation> +<translation id="7888071071722539607">Veuillez inclure "<ph name="ATSIGN"/>" dans l'adresse e-mail. Il manque un symbole "<ph name="ATSIGN"/>" dans "<ph name="INVALIDADDRESS"/>".</translation> <translation id="4851297395436456855">avance rapide</translation> <translation id="1088086359088493902">Secondes</translation> <translation id="3934680773876859118">Échec du chargement du document PDF</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_gu.xtb b/chromium/webkit/glue/resources/webkit_strings_gu.xtb index 9315de8bd0d..c9aa700cec5 100644 --- a/chromium/webkit/glue/resources/webkit_strings_gu.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_gu.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">અન્ય...</translation> <translation id="2426432199384958866">રિયલ ટાઇમ પર ધારાવાહિક ફિલ્મ પાછી કરો</translation> <translation id="248395913932153421">દિવસ</translation> +<translation id="1729654308190250600">કૃપા કરીને એક બિન-ખાલી ઇમેઇલ સરનામું દાખલ કરો.</translation> <translation id="6015796118275082299">વર્ષ</translation> <translation id="9186171386827445984">દસ્તાવેજ લોડ કરી રહ્યું છે: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> પૃષ્ઠ...</translation> <translation id="1235745349614807883">હાલની શોધને સાફ કરો</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">સૂચિ માર્કર</translation> <translation id="4202807286478387388">જંપ કરો</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">કૃપા કરીને '<ph name="ATSIGN"/>' ની આગળનો ભાગ દાખલ કરો. '<ph name="INVALIDADDRESS"/>' અપૂર્ણ છે.</translation> +<translation id="2746543609216772311">મૂલ્ય <ph name="MINIMUM_DATE_OR_TIME"/> અથવા પછીનું હોવું આવશ્યક છે.</translation> <translation id="2572483411312390101">ચલાવો</translation> <translation id="8785498733064193001">પ્લેબૅક શરૂ કરો</translation> <translation id="7057186640035488495">મૂવીનો સમય</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">ઝડપથી પાછા લો</translation> <translation id="7789962463072032349">થોભો</translation> <translation id="6853785296079745596">વિગતવાર ઉપશીર્ષક છુપાવો</translation> +<translation id="4360991593054037559">કૃપા કરીને એક માન્ય મૂલ્ય દાખલ કરો. બે નિકટતમ માન્ય મૂલ્યો <ph name="VALID_VALUE_LOW"/> અને <ph name="VALID_VALUE_HIGHER"/> છે.</translation> <translation id="1758486001363313524">અન્ય...</translation> <translation id="8141602879876242471">આ એક શોધસક્ષમ અનુક્રમણિકા છે. શોધ કીવર્ડ્સ દાખલ કરો:</translation> <translation id="1930711995431081526">સ્થિતિ</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">ઝડપથી આગળ લો</translation> <translation id="4812940957355064477">કૃપા કરીને એક નંબર દાખલ કરો.</translation> <translation id="2548326553472216322">હાલની શોધો નથી</translation> +<translation id="1938124657309484470">મૂલ્ય <ph name="MAXIMUM_DATE_OR_TIME"/> અથવા પહેલાંનું હોવું આવશ્યક છે.</translation> <translation id="7263440858009898357">કૃપા કરીને સૂચિમાંથી એક આઇટમ પસંદ કરો.</translation> <translation id="901493112792887934">સેકન્ડ્સમાં વર્તમાન સમય</translation> <translation id="5164977714490026579">મૂલ્ય <ph name="MINIMUM"/> જેટલું અથવા આનાથી વધુ હોવું આવશ્યક છે.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">આ અઠવાડિયે</translation> <translation id="5966707198760109579">અઠવાડિયું</translation> <translation id="2901282870647571346">વર્તમાન મૂવીની સ્થિતિ</translation> +<translation id="2060505056492490888">'<ph name="DOT"/>' નો ઉપયોગ '<ph name="INVALIDDOMAIN"/>' માં ખોટી જગ્યાએ થયો છે.</translation> <translation id="2674318244760992338">ફૂટર</translation> <translation id="8987927404178983737">મહિનો</translation> <translation id="8115662671911883373">વિગતવાર ઉપશીર્ષક પ્રદર્શન પ્રારંભ કરો</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">તપાસો</translation> <translation id="2846343701378493991">1024 (મધ્યમ ગ્રેડ)</translation> <translation id="1637811476055996098">ફાઇલો પસંદ કરો</translation> +<translation id="49969490063480558">કૃપા કરીને '<ph name="ATSIGN"/>' ને અનુસરી રહેલો ભાગ દાખલ કરો. '<ph name="INVALIDADDRESS"/>' અપૂર્ણ છે.</translation> <translation id="5476505524087279545">અનચેક કરો</translation> <translation id="2148716181193084225">આજે</translation> <translation id="2507943997699731163">કૃપા કરીને આ ફીલ્ડ ભરો.</translation> <translation id="3785482301506746191">મૂવી સમયનું સ્ક્રબર</translation> <translation id="739024184232394898">અન્ય...</translation> +<translation id="383465348367842624">'<ph name="ATSIGN"/>' દ્વારા અનુસરાઈ રહેલા ભાગમાં '<ph name="INVALIDCHARACTER"/>' પ્રતીક શામેલ હોવું જોઈએ નહીં.</translation> <translation id="5468998798572797635">પૂર્ણ સ્ક્રીનથી બહાર નીકળો</translation> <translation id="5919473608089529604">પ્લગ-ઇન લોડ કરી શકાયુ નથી.</translation> <translation id="5546461542133609677">અનમ્યૂટ કરો</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">કૃપા કરીને અલ્પવિરામથી વિભાજિત ઇમેઇલ સરનામાંઓની સૂચિ દાખલ કરો.</translation> <translation id="5939518447894949180">રીસેટ કરો</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">કૃપા કરીને એક માન્ય મૂલ્ય દાખલ કરો. નિકટતમ માન્ય મૂલ્ય <ph name="VALID_VALUE"/> છે.</translation> <translation id="835897206747267392">અમાન્ય મૂલ્ય.</translation> <translation id="1842960171412779397">પસંદ કરો</translation> <translation id="7673697353781729403">કલાક</translation> +<translation id="4664250907885839816">'<ph name="ATSIGN"/>' ને અનુસરી રહેલા ભાગમાં '<ph name="INVALIDCHARACTER"/>' પ્રતીક શામેલ હોવું જોઈએ નહીં.</translation> <translation id="3450233048674729344">મૂલ્ય <ph name="MAXIMUM"/> જેટલું અથવા આનાથી ઓછું હોવું આવશ્યક છે.</translation> <translation id="3471999216963526757">30 સેકન્ડ પાછા જાઓ</translation> <translation id="668171684555832681">અન્ય...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">સક્રિય કરો</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> ફાઇલો</translation> <translation id="6643016212128521049">સાફ કરો</translation> +<translation id="7888071071722539607">કૃપા કરીને ઇમેઇલ સરનામાંમાં '<ph name="ATSIGN"/>' શામેલ કરો. '<ph name="INVALIDADDRESS"/>' માં '<ph name="ATSIGN"/>' ખૂટી રહ્યું છે.</translation> <translation id="4851297395436456855">ઝડપથી આગળ વધો</translation> <translation id="1088086359088493902">સેકંડ</translation> <translation id="3934680773876859118">PDF દસ્તાવેજ લોડ કરવામાં નિષ્ફળ રહ્યા</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_hi.xtb b/chromium/webkit/glue/resources/webkit_strings_hi.xtb index 53477892869..0f00848c1dc 100644 --- a/chromium/webkit/glue/resources/webkit_strings_hi.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_hi.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">अन्य...</translation> <translation id="2426432199384958866">स्ट्रीम हो रही फ़िल्म को रीयल टाइम में वापस लाएं</translation> <translation id="248395913932153421">दिन</translation> +<translation id="1729654308190250600">कृपया गैर-रिक्त ईमेल पता डालें.</translation> <translation id="6015796118275082299">वर्ष</translation> <translation id="9186171386827445984">दस्तावेज़ लोड कर रहा है: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> पृष्ठ...</translation> <translation id="1235745349614807883">हाल ही की खोजें साफ़ करें</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">सूची चिन्हक</translation> <translation id="4202807286478387388">जाएं</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">कृपया '<ph name="ATSIGN"/>' के पहले वाला भाग डालें. '<ph name="INVALIDADDRESS"/>' अधूरा है.</translation> +<translation id="2746543609216772311">मान <ph name="MINIMUM_DATE_OR_TIME"/> या बाद का होना चाहिए.</translation> <translation id="2572483411312390101">चलाएं</translation> <translation id="8785498733064193001">प्लेबैक शुरू करें</translation> <translation id="7057186640035488495">फि़ल्म का समय</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">तेज़ी से पीछे करें</translation> <translation id="7789962463072032349">पॉज़ करें</translation> <translation id="6853785296079745596">बंद कैप्शन छिपाएं</translation> +<translation id="4360991593054037559">कृपया कोई मान्य मान डालें. दो निकटतम मान्य मान <ph name="VALID_VALUE_LOW"/> और <ph name="VALID_VALUE_HIGHER"/> हैं.</translation> <translation id="1758486001363313524">अन्य...</translation> <translation id="8141602879876242471">इस अनुक्रमणिका को खोजा जा सकता है. खोज कुंजीशब्द प्रविष्ट करें:</translation> <translation id="1930711995431081526">स्थिति</translation> @@ -30,11 +34,12 @@ <translation id="370665806235115550">लोड हो रहा है...</translation> <translation id="2723001399770238859">ऑडियो</translation> <translation id="6845533974506654842">दबाएं</translation> -<translation id="8244226242650769279">चित्र मानचित्र</translation> +<translation id="8244226242650769279">चित्र नक्शे</translation> <translation id="310520048233152454">कृपया URL लिखें.</translation> <translation id="9039488204461337220">तेज़ी से आगे करें</translation> <translation id="4812940957355064477">कृपया कोई संख्या डालें.</translation> <translation id="2548326553472216322">हाल ही कोई खोज नहीं</translation> +<translation id="1938124657309484470">मान <ph name="MAXIMUM_DATE_OR_TIME"/> या पहले का होना चाहिए.</translation> <translation id="7263440858009898357">कृपया सूची में किसी आइटम को चुनें.</translation> <translation id="901493112792887934">वर्तमान समय, सेकंड में</translation> <translation id="5164977714490026579">मान <ph name="MINIMUM"/> से कम या इसके बराबर होना चाहिए.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">इस सप्ताह</translation> <translation id="5966707198760109579">सप्ताह</translation> <translation id="2901282870647571346">फ़िल्म की वर्तमान स्थिति</translation> +<translation id="2060505056492490888">'<ph name="DOT"/>' का '<ph name="INVALIDDOMAIN"/>' में गलत स्थान पर उपयोग किया गया है.</translation> <translation id="2674318244760992338">पाद लेख</translation> <translation id="8987927404178983737">माह</translation> <translation id="8115662671911883373">बंद कैप्शन दिखाना प्रारंभ करें</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">चेक करें</translation> <translation id="2846343701378493991">1024 (मध्यम ग्रेड)</translation> <translation id="1637811476055996098">फ़ाइलें चुनें</translation> +<translation id="49969490063480558">कृपया '<ph name="ATSIGN"/>' के बाद आने वाला भाग डालें. '<ph name="INVALIDADDRESS"/>' अधूरा है.</translation> <translation id="5476505524087279545">अनचेक करें</translation> <translation id="2148716181193084225">आज</translation> <translation id="2507943997699731163">कृपया इस फ़ील्ड को भरें.</translation> <translation id="3785482301506746191">फ़िल्म समय स्क्रबर</translation> <translation id="739024184232394898">अन्य...</translation> +<translation id="383465348367842624">'<ph name="ATSIGN"/>' के बाद आने वाले भाग में '<ph name="INVALIDCHARACTER"/>' प्रतीक शामिल नहीं होना चाहिए.</translation> <translation id="5468998798572797635">पूर्ण स्क्रीन से बाहर निकलें</translation> <translation id="5919473608089529604">प्लग-इन लोड नहीं किया जा सका.</translation> <translation id="5546461542133609677">अनम्यूट करें</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">कृपया ईमेल पतों की अल्पविराम द्वारा विभाजित सूची दर्ज करें.</translation> <translation id="5939518447894949180">रीसेट करें</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">कृपया कोई मान्य मान डालें. निकटतम मान्य मान <ph name="VALID_VALUE"/> है.</translation> <translation id="835897206747267392">अमान्य मान.</translation> <translation id="1842960171412779397">चुनें</translation> <translation id="7673697353781729403">घंटे</translation> +<translation id="4664250907885839816">'<ph name="ATSIGN"/>' के बाद आने वाले भाग में '<ph name="INVALIDCHARACTER"/>' प्रतीक शामिल नहीं होना चाहिए.</translation> <translation id="3450233048674729344">मान <ph name="MAXIMUM"/> से कम या इसके बराबर होना चाहिए.</translation> <translation id="3471999216963526757">30 सेकंड पीछे करें</translation> <translation id="668171684555832681">अन्य...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">सक्रिय करें</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> फ़ाइल</translation> <translation id="6643016212128521049">साफ़ करें</translation> +<translation id="7888071071722539607">कृपया ईमेल पते में '<ph name="ATSIGN"/>' शामिल करें. '<ph name="INVALIDADDRESS"/>' में '<ph name="ATSIGN"/>' नहीं है.</translation> <translation id="4851297395436456855">फ़ास्ट फ़ॉरवर्ड</translation> <translation id="1088086359088493902">सेकंड</translation> <translation id="3934680773876859118">PDF दस्तावेज़ लोड करने में विफल</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_hr.xtb b/chromium/webkit/glue/resources/webkit_strings_hr.xtb index 8c55cf18b3a..69d24eaad2b 100644 --- a/chromium/webkit/glue/resources/webkit_strings_hr.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_hr.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Drugo...</translation> <translation id="2426432199384958866">vraćanje strujanja filma u stvarno vrijeme</translation> <translation id="248395913932153421">Dan</translation> +<translation id="1729654308190250600">Unesite e-adresu koja nije prazna vrijednost.</translation> <translation id="6015796118275082299">Godina</translation> <translation id="9186171386827445984">Učitavanje dokumenta: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> stranica...</translation> <translation id="1235745349614807883">Obriši najnovija pretraživanja</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">oznaka popisa</translation> <translation id="4202807286478387388">skoči</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Unesite dio adrese ispred znaka "<ph name="ATSIGN"/>". "<ph name="INVALIDADDRESS"/>" nije potpuna e-adresa.</translation> +<translation id="2746543609216772311">Vrijednost mora biti <ph name="MINIMUM_DATE_OR_TIME"/> ili nakon toga.</translation> <translation id="2572483411312390101">reprodukcija</translation> <translation id="8785498733064193001">početak reprodukcije</translation> <translation id="7057186640035488495">vrijeme filma</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">brzo traženje unatrag</translation> <translation id="7789962463072032349">pauziraj</translation> <translation id="6853785296079745596">sakrivanje titlova</translation> +<translation id="4360991593054037559">Unesite važeću vrijednost. Dvije su najbliže važeće vrijednosti <ph name="VALID_VALUE_LOW"/> i <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Drugo...</translation> <translation id="8141602879876242471">Ovaj je indeks moguće pretraživati. Unesite ključne riječi za pretraživanje:</translation> <translation id="1930711995431081526">status</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">brzo traženje unaprijed</translation> <translation id="4812940957355064477">Unesite broj.</translation> <translation id="2548326553472216322">Nema najnovijih pretraživanja</translation> +<translation id="1938124657309484470">Vrijednost mora biti <ph name="MAXIMUM_DATE_OR_TIME"/> ili prije toga.</translation> <translation id="7263440858009898357">Odaberite stavku s popisa.</translation> <translation id="901493112792887934">trenutačno vrijeme u sekundama</translation> <translation id="5164977714490026579">Vrijednost mora biti <ph name="MINIMUM"/> ili veća.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Ovaj tjedan</translation> <translation id="5966707198760109579">Tjedan</translation> <translation id="2901282870647571346">trenutačan status filma</translation> +<translation id="2060505056492490888">Znak "<ph name="DOT"/>" upotrebljava se na pogrešnom položaju u domeni "<ph name="INVALIDDOMAIN"/>".</translation> <translation id="2674318244760992338">podnožje</translation> <translation id="8987927404178983737">Mjesec</translation> <translation id="8115662671911883373">početak prikazivanja titlova</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">označi</translation> <translation id="2846343701378493991">1024 (srednji)</translation> <translation id="1637811476055996098">Odabir datoteka</translation> +<translation id="49969490063480558">Unesite dio adrese iza znaka "<ph name="ATSIGN"/>". "<ph name="INVALIDADDRESS"/>" nije potpuna e-adresa.</translation> <translation id="5476505524087279545">ukloni oznaku</translation> <translation id="2148716181193084225">Danas</translation> <translation id="2507943997699731163">Ispunite ovo polje.</translation> <translation id="3785482301506746191">vremenski klizač filma</translation> <translation id="739024184232394898">Drugo...</translation> +<translation id="383465348367842624">Dio adrese ispred znaka "<ph name="ATSIGN"/>" ne smije sadržavati simbol "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="5468998798572797635">izlazak iz cijelog zaslona</translation> <translation id="5919473608089529604">Nije bilo moguće učitati dodatak.</translation> <translation id="5546461542133609677">uključivanje zvuka</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Unesite popis adresa e-pošte odijeljen zarezima.</translation> <translation id="5939518447894949180">Ponovno postavi</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Unesite važeću vrijednost. Najbliža je važeća vrijednost <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Nevažeća vrijednost.</translation> <translation id="1842960171412779397">odaberi</translation> <translation id="7673697353781729403">Sati</translation> +<translation id="4664250907885839816">Dio adrese iza znaka "<ph name="ATSIGN"/>" ne smije sadržavati simbol "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="3450233048674729344">Vrijednost mora biti <ph name="MAXIMUM"/> ili manja.</translation> <translation id="3471999216963526757">30 sekundi unatrag</translation> <translation id="668171684555832681">Ostalo...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">aktiviraj</translation> <translation id="8444882422881193423">Broj datoteka: <ph name="NUMBER_OF_FILES"/></translation> <translation id="6643016212128521049">Izbriši</translation> +<translation id="7888071071722539607">Uključite znak "<ph name="ATSIGN"/>" u e-adresu. U adresi "<ph name="INVALIDADDRESS"/>" nedostaje znak "<ph name="ATSIGN"/>".</translation> <translation id="4851297395436456855">brzo unaprijed</translation> <translation id="1088086359088493902">Sekunde</translation> <translation id="3934680773876859118">Učitavanje dokumenta PDF nije uspjelo</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_hu.xtb b/chromium/webkit/glue/resources/webkit_strings_hu.xtb index f4374dbc182..deeaf2e9871 100644 --- a/chromium/webkit/glue/resources/webkit_strings_hu.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_hu.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Más...</translation> <translation id="2426432199384958866">közvetített videó visszaállítása valós időre</translation> <translation id="248395913932153421">nap</translation> +<translation id="1729654308190250600">Kérjük, ne hagyja üresen az e-mail cím mezőjét.</translation> <translation id="6015796118275082299">Év</translation> <translation id="9186171386827445984">Dokumentum betöltése: <ph name="NUMBER_OF_PAGES"/>/<ph name="PAGE_NUMBER"/>. oldal...</translation> <translation id="1235745349614807883">Friss keresések törlése</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">listajelölő</translation> <translation id="4202807286478387388">Mehet</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Kérjük, adja meg a „<ph name="ATSIGN"/>” előtti részt is. A „<ph name="INVALIDADDRESS"/>” cím nem teljes.</translation> +<translation id="2746543609216772311">Az érték <ph name="MINIMUM_DATE_OR_TIME"/> vagy azt követő kell, hogy legyen.</translation> <translation id="2572483411312390101">lejátszás</translation> <translation id="8785498733064193001">lejátszás indítása</translation> <translation id="7057186640035488495">film ideje</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">gyors visszakeresés</translation> <translation id="7789962463072032349">szüneteltetés</translation> <translation id="6853785296079745596">feliratok elrejtése</translation> +<translation id="4360991593054037559">Kérjük, érvényes értéket adjon meg. A két legközelebbi érvényes érték <ph name="VALID_VALUE_LOW"/> és <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Más...</translation> <translation id="8141602879876242471">Ez egy kereshető index. Írjon be keresési kulcsszavakat:</translation> <translation id="1930711995431081526">állapot</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">gyors keresés előre</translation> <translation id="4812940957355064477">Kérjük, adjon meg egy számot.</translation> <translation id="2548326553472216322">Nincsenek friss keresések</translation> +<translation id="1938124657309484470">Az érték <ph name="MAXIMUM_DATE_OR_TIME"/> vagy azt megelőző kell, hogy legyen.</translation> <translation id="7263440858009898357">Kérjük, válasszon egyet a lista elemei közül.</translation> <translation id="901493112792887934">jelenlegi idő másodpercben</translation> <translation id="5164977714490026579">Az érték legyen nagyobb vagy egyenlő, mint <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Ezen a héten</translation> <translation id="5966707198760109579">Hét</translation> <translation id="2901282870647571346">a jelenlegi film állapota</translation> +<translation id="2060505056492490888">A „<ph name="DOT"/>” rossz helyen van a(z) „<ph name="INVALIDDOMAIN"/>” címben.</translation> <translation id="2674318244760992338">lábléc</translation> <translation id="8987927404178983737">hónap</translation> <translation id="8115662671911883373">feliratok megjelenítése</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">Megjelölés</translation> <translation id="2846343701378493991">1024 (Közepes)</translation> <translation id="1637811476055996098">Fájlok kiválasztása</translation> +<translation id="49969490063480558">Kérjük, adja meg a „<ph name="ATSIGN"/>” utáni részt is. A(z) „<ph name="INVALIDADDRESS"/>” cím nem teljes.</translation> <translation id="5476505524087279545">Megjelölés eltávolítása</translation> <translation id="2148716181193084225">Ma</translation> <translation id="2507943997699731163">Kérjük, töltse ki ezt a mezőt.</translation> <translation id="3785482301506746191">filmidővezérlő</translation> <translation id="739024184232394898">Más...</translation> +<translation id="383465348367842624">A „<ph name="ATSIGN"/>” előtti rész nem tartalmazhat „<ph name="INVALIDCHARACTER"/>” karaktert.</translation> <translation id="5468998798572797635">kilépés a teljes képernyős nézetből</translation> <translation id="5919473608089529604">Nem sikerült betölteni a plug-int.</translation> <translation id="5546461542133609677">némítás feloldása</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Kérjük, adjon meg egy vesszőkkel elválasztott e-mail címlistát.</translation> <translation id="5939518447894949180">Visszaállítás</translation> <translation id="1921819250265091946">nn</translation> +<translation id="2613802280814924224">Kérjük, érvényes értéket adjon meg. A legközelebbi érvényes érték <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Érvénytelen érték.</translation> <translation id="1842960171412779397">Kiválasztás</translation> <translation id="7673697353781729403">Óra</translation> +<translation id="4664250907885839816">A „<ph name="ATSIGN"/>” utáni rész nem tartalmazhat „<ph name="INVALIDCHARACTER"/>” karaktert.</translation> <translation id="3450233048674729344">Az érték legyen kisebb vagy egyenlő, mint <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">vissza 30 másodperccel</translation> <translation id="668171684555832681">Egyéb...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">Aktiválás</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> fájl</translation> <translation id="6643016212128521049">Törlés</translation> +<translation id="7888071071722539607">Kérjük, írjon egy „<ph name="ATSIGN"/>” karaktert az e-mail címbe. A(z) „<ph name="INVALIDADDRESS"/>” címből hiányzik a „<ph name="ATSIGN"/>” jel.</translation> <translation id="4851297395436456855">gyors előretekerés</translation> <translation id="1088086359088493902">Másodperc</translation> <translation id="3934680773876859118">PDF dokumentum betöltése sikertelen</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_id.xtb b/chromium/webkit/glue/resources/webkit_strings_id.xtb index 242e8d32f27..7a48dc93dff 100644 --- a/chromium/webkit/glue/resources/webkit_strings_id.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_id.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Lainnya...</translation> <translation id="2426432199384958866">kembalikan streaming film ke waktu nyata</translation> <translation id="248395913932153421">Hari</translation> +<translation id="1729654308190250600">Jangan mengosongkan bidang alamat email.</translation> <translation id="6015796118275082299">Tahun</translation> <translation id="9186171386827445984">Memuat dokumen: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> halaman...</translation> <translation id="1235745349614807883">Hapus Penelusuran Barusan</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">penanda daftar</translation> <translation id="4202807286478387388">lompati</translation> <translation id="4611115858363067980"><ph name="FILENAME"/> - <ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Masukkan bagian yang diikuti dengan '<ph name="ATSIGN"/>'. '<ph name="INVALIDADDRESS"/>' tidak lengkap.</translation> +<translation id="2746543609216772311">Tanggal harus <ph name="MINIMUM_DATE_OR_TIME"/> atau setelahnya.</translation> <translation id="2572483411312390101">mainkan</translation> <translation id="8785498733064193001">mulai pemutaran</translation> <translation id="7057186640035488495">waktu film</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">mencari mundur dengan cepat</translation> <translation id="7789962463072032349">jeda</translation> <translation id="6853785296079745596">sembunyikan teks tertutup</translation> +<translation id="4360991593054037559">Masukkan nilai yang valid. Dua nilai valid terdekat adalah <ph name="VALID_VALUE_LOW"/> dan <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Lainnya...</translation> <translation id="8141602879876242471">Terdapat indeks yang dapat dicari. Masukkan kata kunci penelusuran:</translation> <translation id="1930711995431081526">status</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">mencari maju dengan cepat</translation> <translation id="4812940957355064477">Masukkan nomor.</translation> <translation id="2548326553472216322">Tidak ada penelusuran terkini</translation> +<translation id="1938124657309484470">Tanggal harus <ph name="MAXIMUM_DATE_OR_TIME"/> atau lebih awal.</translation> <translation id="7263440858009898357">Pilih item pada daftar.</translation> <translation id="901493112792887934">waktu saat ini dalam detik</translation> <translation id="5164977714490026579">Nilai harus lebih besar daripada atau sama dengan <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Minggu ini</translation> <translation id="5966707198760109579">Minggu</translation> <translation id="2901282870647571346">status film saat ini</translation> +<translation id="2060505056492490888">'<ph name="DOT"/>' digunakan pada posisi yang salah di '<ph name="INVALIDDOMAIN"/>'.</translation> <translation id="2674318244760992338">footer</translation> <translation id="8987927404178983737">Bulan</translation> <translation id="8115662671911883373">mulai menampilkan teks tertutup</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">centangi</translation> <translation id="2846343701378493991">1024 (Tingkat Menengah)</translation> <translation id="1637811476055996098">Pilih File</translation> +<translation id="49969490063480558">Masukkan bagian setelah '<ph name="ATSIGN"/>'. '<ph name="INVALIDADDRESS"/>' tidak lengkap.</translation> <translation id="5476505524087279545">batalkan centang</translation> <translation id="2148716181193084225">Hari ini</translation> <translation id="2507943997699731163">Harap isi bidang ini.</translation> <translation id="3785482301506746191">scrubber waktu film</translation> <translation id="739024184232394898">Lainnya...</translation> +<translation id="383465348367842624">Bagian sebelum '<ph name="ATSIGN"/>' tidak boleh berisi simbol '<ph name="INVALIDCHARACTER"/>'.</translation> <translation id="5468998798572797635">keluar dari tampilan layar penuh</translation> <translation id="5919473608089529604">Tidak dapat memuat plugin.</translation> <translation id="5546461542133609677">suarakan</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Masukkan daftar alamat email yang dipisahkan dengan koma.</translation> <translation id="5939518447894949180">Atur ulang</translation> <translation id="1921819250265091946">hh</translation> +<translation id="2613802280814924224">Masukkan nilai yang valid. Nilai valid terdekatnya adalah <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Nilai tidak valid.</translation> <translation id="1842960171412779397">pilih</translation> <translation id="7673697353781729403">Jam</translation> +<translation id="4664250907885839816">Bagian setelah '<ph name="ATSIGN"/>' tidak boleh berisi simbol '<ph name="INVALIDCHARACTER"/>'.</translation> <translation id="3450233048674729344">Nilai harus lebih kecil atau sama dengan <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">mundur 30 detik</translation> <translation id="668171684555832681">Lainnya...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">aktifkan</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> file</translation> <translation id="6643016212128521049">Hapus</translation> +<translation id="7888071071722539607">Sertakan '<ph name="ATSIGN"/>' pada alamat email. '<ph name="INVALIDADDRESS"/>' tidak memiliki '<ph name="ATSIGN"/>'.</translation> <translation id="4851297395436456855">maju cepat</translation> <translation id="1088086359088493902">Detik</translation> <translation id="3934680773876859118">Gagal memuat dokumen PDF</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_it.xtb b/chromium/webkit/glue/resources/webkit_strings_it.xtb index 70857787b74..369cd1fd4c9 100644 --- a/chromium/webkit/glue/resources/webkit_strings_it.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_it.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Altro...</translation> <translation id="2426432199384958866">ritorna a tempo reale per filmato in streaming</translation> <translation id="248395913932153421">Giorno</translation> +<translation id="1729654308190250600">Inserisci un indirizzo email valido.</translation> <translation id="6015796118275082299">Anno</translation> <translation id="9186171386827445984">Caricamento del documento in corso: pagine <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/>...</translation> <translation id="1235745349614807883">Cancella ricerche recenti</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">indicatore elenco</translation> <translation id="4202807286478387388">vai</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Inserisci una parte seguita da "<ph name="ATSIGN"/>". Il valore "<ph name="INVALIDADDRESS"/>" è incompleto.</translation> +<translation id="2746543609216772311">Il valore deve essere <ph name="MINIMUM_DATE_OR_TIME"/> o successivo.</translation> <translation id="2572483411312390101">riproduci</translation> <translation id="8785498733064193001">inizia riproduzione</translation> <translation id="7057186640035488495">tempo filmato</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">cerca velocemente indietro</translation> <translation id="7789962463072032349">pausa</translation> <translation id="6853785296079745596">nascondi sottotitoli</translation> +<translation id="4360991593054037559">Inserisci un valore valido. I due valori validi più vicini sono <ph name="VALID_VALUE_LOW"/> e <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Altro...</translation> <translation id="8141602879876242471">Questo è un indice di ricerca. Inserisci le parole chiave di ricerca:</translation> <translation id="1930711995431081526">stato</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">cerca velocemente in avanti</translation> <translation id="4812940957355064477">Inserisci un numero.</translation> <translation id="2548326553472216322">Nessuna ricerca recente</translation> +<translation id="1938124657309484470">Il valore deve essere <ph name="MAXIMUM_DATE_OR_TIME"/> o precedente.</translation> <translation id="7263440858009898357">Seleziona un elemento nell'elenco.</translation> <translation id="901493112792887934">tempo attuale in secondi</translation> <translation id="5164977714490026579">Il valore deve essere superiore o uguale a <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Questa settimana</translation> <translation id="5966707198760109579">Settimana</translation> <translation id="2901282870647571346">stato corrente del filmato</translation> +<translation id="2060505056492490888">Il segno "<ph name="DOT"/>" è utilizzato in una posizione errata in "<ph name="INVALIDDOMAIN"/>".</translation> <translation id="2674318244760992338">piè di pagina</translation> <translation id="8987927404178983737">Mese</translation> <translation id="8115662671911883373">avvia la visualizzazione dei sottotitoli</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">seleziona</translation> <translation id="2846343701378493991">1024 (Medium Grade)</translation> <translation id="1637811476055996098">Scegli file</translation> +<translation id="49969490063480558">Inserisci una parte dopo "<ph name="ATSIGN"/>". Il valore "<ph name="INVALIDADDRESS"/>" è incompleto.</translation> <translation id="5476505524087279545">deseleziona</translation> <translation id="2148716181193084225">Oggi</translation> <translation id="2507943997699731163">Compila questo campo.</translation> <translation id="3785482301506746191">dispositivo di scorrimento tempo filmato</translation> <translation id="739024184232394898">Altro...</translation> +<translation id="383465348367842624">Una parte seguita da "<ph name="ATSIGN"/>" non deve contenere il simbolo "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="5468998798572797635">esci da schermo intero</translation> <translation id="5919473608089529604">Impossibile caricare il plug-in.</translation> <translation id="5546461542133609677">riattiva audio</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Inserisci un elenco di indirizzi email separati da virgola.</translation> <translation id="5939518447894949180">Ripristina</translation> <translation id="1921819250265091946">gg</translation> +<translation id="2613802280814924224">Inserisci un valore valido. Il valore valido più vicino è <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Valore non valido.</translation> <translation id="1842960171412779397">seleziona</translation> <translation id="7673697353781729403">Orario</translation> +<translation id="4664250907885839816">Una parte che segue "<ph name="ATSIGN"/>" non deve contenere il simbolo "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="3450233048674729344">Il valore deve essere inferiore o uguale a <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">indietro di 30 secondi</translation> <translation id="668171684555832681">Altro...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">attiva</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> file</translation> <translation id="6643016212128521049">Cancella</translation> +<translation id="7888071071722539607">Aggiungi un simbolo "<ph name="ATSIGN"/>" nell'indirizzo email. In "<ph name="INVALIDADDRESS"/>" manca un simbolo "<ph name="ATSIGN"/>".</translation> <translation id="4851297395436456855">avanzamento rapido</translation> <translation id="1088086359088493902">Secondi</translation> <translation id="3934680773876859118">Caricamento del documento PDF non riuscito</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_iw.xtb b/chromium/webkit/glue/resources/webkit_strings_iw.xtb index e0adf0e94e1..9546a05c41b 100644 --- a/chromium/webkit/glue/resources/webkit_strings_iw.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_iw.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">אחר...</translation> <translation id="2426432199384958866">החזר סרט בהזרמה לזמן אמת</translation> <translation id="248395913932153421">יום</translation> +<translation id="1729654308190250600">הזן ערך נדרש בשדה של כתובת הדוא"ל.</translation> <translation id="6015796118275082299">שנה</translation> <translation id="9186171386827445984">טוען מסמך: דפים <ph name="NUMBER_OF_PAGES"/>/<ph name="PAGE_NUMBER"/>...</translation> <translation id="1235745349614807883">הסר חיפושים אחרונים</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">סמן רשימה</translation> <translation id="4202807286478387388">קפוץ</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">הזן חלק ולאחריו '<ph name="ATSIGN"/>'. השדה '<ph name="INVALIDADDRESS"/>' אינו מלא.</translation> +<translation id="2746543609216772311">על הערך להיות <ph name="MINIMUM_DATE_OR_TIME"/> ומעלה.</translation> <translation id="2572483411312390101">הפעל</translation> <translation id="8785498733064193001">התחל בהפעלה</translation> <translation id="7057186640035488495">משך הסרט</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">הרץ במהירות אחורה</translation> <translation id="7789962463072032349">השהה</translation> <translation id="6853785296079745596">הסתר כתוביות סגורות</translation> +<translation id="4360991593054037559">הזן ערך חוקי. שני הערכים החוקיים הקרובים ביותר הם <ph name="VALID_VALUE_LOW"/> ו-<ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">אחר...</translation> <translation id="8141602879876242471">זהו אינדקס שניתן לבצע בו חיפוש. הזן מילות מפתח לחיפוש:</translation> <translation id="1930711995431081526">מצב</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">הרץ קדימה במהירות</translation> <translation id="4812940957355064477">הזן מספר.</translation> <translation id="2548326553472216322">אין חיפושים אחרונים</translation> +<translation id="1938124657309484470">על הערך להיות <ph name="MAXIMUM_DATE_OR_TIME"/> או מוקדם יותר.</translation> <translation id="7263440858009898357">בחר פריט מהרשימה.</translation> <translation id="901493112792887934">זמן נוכחי בשניות</translation> <translation id="5164977714490026579">הערך חייב להיות גדול מ-<ph name="MINIMUM"/> או שווה לו.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">השבוע</translation> <translation id="5966707198760109579">שבוע</translation> <translation id="2901282870647571346">מצב סרט נוכחי</translation> +<translation id="2060505056492490888">נעשה שימוש ב-'<ph name="DOT"/>' במיקום שגוי ב-'<ph name="INVALIDDOMAIN"/>'.</translation> <translation id="2674318244760992338">כותרת תחתונה</translation> <translation id="8987927404178983737">חודש</translation> <translation id="8115662671911883373">התחל להציג כתוביות סגורות</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">סמן</translation> <translation id="2846343701378493991">1024 (Medium Grade)</translation> <translation id="1637811476055996098">בחר קבצים</translation> +<translation id="49969490063480558">הזן חלק ולאחריו '<ph name="ATSIGN"/>'. השדה '<ph name="INVALIDADDRESS"/>' אינו מלא.</translation> <translation id="5476505524087279545">בטל סימון</translation> <translation id="2148716181193084225">היום</translation> <translation id="2507943997699731163">מלא שדה זה.</translation> <translation id="3785482301506746191">מסתיר משך סרט</translation> <translation id="739024184232394898">אחר...</translation> +<translation id="383465348367842624">חלק ולאחריו '<ph name="ATSIGN"/>' לא אמור לכלול את הסמל '<ph name="INVALIDCHARACTER"/>'.</translation> <translation id="5468998798572797635">צא ממסך מלא</translation> <translation id="5919473608089529604">לא היתה אפשרות לטעון את הפלאגין.</translation> <translation id="5546461542133609677">בטל השתקה</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">הזן רשימה של כתובות דוא"ל המופרדות באמצעות פסיקים.</translation> <translation id="5939518447894949180">אפס</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">הזן ערך חוקי. הערך החוקי הקרוב ביותר הוא <ph name="VALID_VALUE"/></translation> <translation id="835897206747267392">ערך לא חוקי.</translation> <translation id="1842960171412779397">בחר</translation> <translation id="7673697353781729403">שעות</translation> +<translation id="4664250907885839816">חלק ולאחריו '<ph name="ATSIGN"/>' לא אמור לכלול את הסמל '<ph name="INVALIDCHARACTER"/>'.</translation> <translation id="3450233048674729344">הערך חייב להיות קטן מ-<ph name="MAXIMUM"/> או שווה לו.</translation> <translation id="3471999216963526757">חזור אחורה 30 שניות</translation> <translation id="668171684555832681">אחר...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">הפעל</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> קבצים</translation> <translation id="6643016212128521049">נקה</translation> +<translation id="7888071071722539607">כלול '<ph name="ATSIGN"/>' בכתובת הדוא"ל. ב-'<ph name="INVALIDADDRESS"/>' חסר '<ph name="ATSIGN"/>'.</translation> <translation id="4851297395436456855">הרץ קדימה</translation> <translation id="1088086359088493902">שניות</translation> <translation id="3934680773876859118">הטעינה של מסמך PDF נכשלה</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_ja.xtb b/chromium/webkit/glue/resources/webkit_strings_ja.xtb index a9c1f1651b0..00be052ed42 100644 --- a/chromium/webkit/glue/resources/webkit_strings_ja.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_ja.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">その他...</translation> <translation id="2426432199384958866">ストリーミング映画をリアル タイムに戻す</translation> <translation id="248395913932153421">日</translation> +<translation id="1729654308190250600">メール アドレスを入力してください。</translation> <translation id="6015796118275082299">年</translation> <translation id="9186171386827445984">ドキュメントの読み込み中: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> ページ...</translation> <translation id="1235745349614807883">最近の検索履歴を消去</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">リスト マーカー</translation> <translation id="4202807286478387388">ジャンプ</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">「<ph name="ATSIGN"/>」の前の文字列を入力してください。「<ph name="INVALIDADDRESS"/>」は完全なメール アドレスではありません。</translation> +<translation id="2746543609216772311"><ph name="MINIMUM_DATE_OR_TIME"/> 以降の値を指定する必要があります。</translation> <translation id="2572483411312390101">再生</translation> <translation id="8785498733064193001">再生を開始</translation> <translation id="7057186640035488495">上映時間</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">シークで巻き戻し</translation> <translation id="7789962463072032349">一時停止</translation> <translation id="6853785296079745596">クローズド キャプションを非表示</translation> +<translation id="4360991593054037559">有効な値を入力してください。有効な値として最も近いのは <ph name="VALID_VALUE_LOW"/> と <ph name="VALID_VALUE_HIGHER"/> です。</translation> <translation id="1758486001363313524">その他...</translation> <translation id="8141602879876242471">このインデックスは検索できます。キーワードを入力してください:</translation> <translation id="1930711995431081526">ステータス</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">シークで早送り</translation> <translation id="4812940957355064477">数字を入力してください。</translation> <translation id="2548326553472216322">最近の検索はありません</translation> +<translation id="1938124657309484470"><ph name="MAXIMUM_DATE_OR_TIME"/> 以前の値を指定する必要があります。</translation> <translation id="7263440858009898357">リスト内の項目を選択してください。</translation> <translation id="901493112792887934">現在の時間(秒単位)</translation> <translation id="5164977714490026579">値は <ph name="MINIMUM"/> 以上にする必要があります。</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">今週</translation> <translation id="5966707198760109579">週</translation> <translation id="2901282870647571346">現在の映画のステータス</translation> +<translation id="2060505056492490888">「<ph name="INVALIDDOMAIN"/>」内の「<ph name="DOT"/>」の位置が間違っています。</translation> <translation id="2674318244760992338">フッター</translation> <translation id="8987927404178983737">月</translation> <translation id="8115662671911883373">クローズド キャプションの表示を開始</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">チェックを付ける</translation> <translation id="2846343701378493991">1024 (中)</translation> <translation id="1637811476055996098">ファイル選択</translation> +<translation id="49969490063480558">「<ph name="ATSIGN"/>」に続く文字列を入力してください。「<ph name="INVALIDADDRESS"/>」は完全なメール アドレスではありません。</translation> <translation id="5476505524087279545">チェックを外す</translation> <translation id="2148716181193084225">今日</translation> <translation id="2507943997699731163">このフィールドを入力してください。</translation> <translation id="3785482301506746191">シークバー</translation> <translation id="739024184232394898">その他...</translation> +<translation id="383465348367842624">「<ph name="ATSIGN"/>」の前の文字列に記号「<ph name="INVALIDCHARACTER"/>」を使用しないでください。</translation> <translation id="5468998798572797635">全画面表示を終了</translation> <translation id="5919473608089529604">プラグインを読み込むことができませんでした。</translation> <translation id="5546461542133609677">ミュートを解除</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">メール アドレスのカンマ区切りリストを入力してください。</translation> <translation id="5939518447894949180">リセット</translation> <translation id="1921819250265091946">日</translation> +<translation id="2613802280814924224">有効な値を入力してください。有効な値として最も近いのは <ph name="VALID_VALUE"/> です。</translation> <translation id="835897206747267392">値が無効です。</translation> <translation id="1842960171412779397">選択</translation> <translation id="7673697353781729403">時間</translation> +<translation id="4664250907885839816">「<ph name="ATSIGN"/>」に続く文字列に記号「<ph name="INVALIDCHARACTER"/>」を使用しないでください。</translation> <translation id="3450233048674729344">値は <ph name="MAXIMUM"/> 以下にする必要があります。</translation> <translation id="3471999216963526757">30 秒戻る</translation> <translation id="668171684555832681">その他...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">アクティブにする</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> ファイル</translation> <translation id="6643016212128521049">クリア</translation> +<translation id="7888071071722539607">メール アドレスに「<ph name="ATSIGN"/>」を挿入してください。「<ph name="INVALIDADDRESS"/>」内に「<ph name="ATSIGN"/>」がありません。</translation> <translation id="4851297395436456855">早送り</translation> <translation id="1088086359088493902">秒</translation> <translation id="3934680773876859118">PDF ドキュメントを読み込むことができませんでした</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_kn.xtb b/chromium/webkit/glue/resources/webkit_strings_kn.xtb index c4b2d2a1d7d..87d1b6112dd 100644 --- a/chromium/webkit/glue/resources/webkit_strings_kn.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_kn.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">ಇತರೆ...</translation> <translation id="2426432199384958866">ಸ್ಟ್ರೀಮಿಂಗ್ ಚಲನಚಿತ್ರವನ್ನು ನೈಜ ಸಮಯಕ್ಕೆ ಹಿಂತಿರುಗಿಸಿ</translation> <translation id="248395913932153421">ದಿನ</translation> +<translation id="1729654308190250600">ಖಾಲಿ-ಅಲ್ಲದ ಇಮೇಲ್ ವಿಳಾಸವನ್ನು ನಮೂದಿಸಿ.</translation> <translation id="6015796118275082299">ವರ್ಷ</translation> <translation id="9186171386827445984">ಲೋಡಿಂಗ್ ಡಾಕ್ಯುಮೆಂಟ್: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> ಪುಟಗಳು...</translation> <translation id="1235745349614807883">ಇತ್ತೀಚಿನ ಹುಡುಕಾಟವನ್ನು ತೆರವುಗೊಳಿಸಿ</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">ಪಟ್ಟಿ ಗುರುತು</translation> <translation id="4202807286478387388">ಹಾರು</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">'<ph name="ATSIGN"/>' ನಂತರದ ಭಾಗವನ್ನು ನಮೂದಿಸಿ. '<ph name="INVALIDADDRESS"/>' ಅಪೂರ್ಣವಾಗಿದೆ.</translation> +<translation id="2746543609216772311">ಮೌಲ್ಯವು <ph name="MINIMUM_DATE_OR_TIME"/> ಅಥವಾ ನಂತರದ್ದಾಗಿರಬೇಕು.</translation> <translation id="2572483411312390101">ಪ್ಲೇ ಮಾಡಿ</translation> <translation id="8785498733064193001">ಪ್ಲೇಬ್ಯಾಕ್ ಪ್ರಾರಂಭಿಸಿ</translation> <translation id="7057186640035488495">ಚಲನಚಿತ್ರ ಸಮಯ</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">ತ್ವರಿತವಾಗಿ ಹಿಂದಕ್ಕೆ ಪಡೆಯಿರಿ</translation> <translation id="7789962463072032349">ವಿರಾಮ</translation> <translation id="6853785296079745596">ಮುಚ್ಚಿರುವ ಶೀರ್ಷಿಕೆಗಳನ್ನು ಮರೆಮಾಡಿ</translation> +<translation id="4360991593054037559">ಮಾನ್ಯವಾದ ಮೌಲ್ಯವನ್ನು ನಮೂದಿಸಿ. <ph name="VALID_VALUE_LOW"/> ಮತ್ತು <ph name="VALID_VALUE_HIGHER"/> ಎರಡು ಹತ್ತಿರದ ಮಾನ್ಯ ಮೌಲ್ಯಗಳಾಗಿವೆ.</translation> <translation id="1758486001363313524">ಇತರೆ...</translation> <translation id="8141602879876242471">ಇದು ಹುಡುಕಾಡಬಹುದಾದ ಸೂಚಿಕೆ ಹುಡುಕಾಟ ಕೀವರ್ಡ್ಗಳನ್ನು ನಮೂದಿಸಿ:</translation> <translation id="1930711995431081526">ಸ್ಥಿತಿ</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">ತ್ವರಿತವಾಗಿ ಮುಂದೆ ಪಡೆಯಿರಿ</translation> <translation id="4812940957355064477">ದಯವಿಟ್ಟು ಸಂಖ್ಯೆಯನ್ನು ನಮೂದಿಸಿ.</translation> <translation id="2548326553472216322">ಇತ್ತೀಚಿನ ಹುಡುಕಾಟಗಳು ಇಲ್ಲ</translation> +<translation id="1938124657309484470">ಮೌಲ್ಯವು <ph name="MAXIMUM_DATE_OR_TIME"/> ಅಥವಾ ಹಿಂದಿನದ್ದಾಗಿರಬೇಕು.</translation> <translation id="7263440858009898357">ಪಟ್ಟಿಯಲ್ಲಿನ ಐಟಂ ಅನ್ನು ದಯವಿಟ್ಟು ಆಯ್ಕೆ ಮಾಡಿ.</translation> <translation id="901493112792887934">ಸೆಕೆಂಡ್ಗಳಲ್ಲಿ ಪ್ರಸ್ತುತ ಸಮಯ</translation> <translation id="5164977714490026579">ಮೌಲ್ಯವು <ph name="MINIMUM"/> ಕ್ಕಿಂತಲೂ ಹೆಚ್ಚಾಗಿರಬೇಕು ಅಥವಾ ಸಮನಾಗಿರಬೇಕು.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">ಈ ವಾರ</translation> <translation id="5966707198760109579">ವಾರ</translation> <translation id="2901282870647571346">ಪ್ರಸ್ತುತ ಚಲನಚಿತ್ರದ ಸ್ಥಿತಿ</translation> +<translation id="2060505056492490888">'<ph name="DOT"/>' ಅನ್ನು '<ph name="INVALIDDOMAIN"/>' ನಲ್ಲಿ ತಪ್ಪಾದ ಸ್ಥಾನದಲ್ಲಿ ಬಳಸಲಾಗಿದೆ.</translation> <translation id="2674318244760992338">ಅಡಿಟಿಪ್ಪಣಿ</translation> <translation id="8987927404178983737">ತಿಂಗಳು</translation> <translation id="8115662671911883373">ಮುಚ್ಚಲಾಗಿರುವ ಶೀರ್ಷಿಕೆಗಳ ಪ್ರದರ್ಶಿಸುವಿಕೆಯನ್ನು ಪ್ರಾರಂಭಿಸಿ</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">ಪರಿಶೀಲಿಸು</translation> <translation id="2846343701378493991">1024 (ಮದ್ಯಮ ಶ್ರೇಣಿ)</translation> <translation id="1637811476055996098">ಫೈಲ್ಗಳನ್ನು ಆರಿಸಿ</translation> +<translation id="49969490063480558">'<ph name="ATSIGN"/>' ನಂತರದ ಒಂದು ಭಾಗವನ್ನು ನಮೂದಿಸಿ. '<ph name="INVALIDADDRESS"/>' ಅಪೂರ್ಣವಾಗಿದೆ.</translation> <translation id="5476505524087279545">ಪರೀಕ್ಷಿಸಬೇಡಿ</translation> <translation id="2148716181193084225">ಇಂದು</translation> <translation id="2507943997699731163">ದಯವಿಟ್ಟು ಈ ಕ್ಷೇತ್ರವನ್ನು ಭರ್ತಿ ಮಾಡಿ.</translation> <translation id="3785482301506746191">ಚಲನಚಿತ್ರ ಸಮಯ ಸ್ಕ್ರಬ್ಬರ್</translation> <translation id="739024184232394898">ಇತರೆ...</translation> +<translation id="383465348367842624">'<ph name="ATSIGN"/>' ನಂತರದ ಭಾಗವು '<ph name="INVALIDCHARACTER"/>' ಚಿಹ್ನೆಯನ್ನು ಒಳಗೊಂಡಿರಬಾರದು.</translation> <translation id="5468998798572797635">ಪೂರ್ಣಪರದೆಯಿಂದ ನಿರ್ಗಮಿಸು</translation> <translation id="5919473608089529604">ಪ್ಲಗ್-ಇನ್ ಅನ್ನು ಲೋಡ್ ಮಾಡಲು ಸಾಧ್ಯವಾಗಲಿಲ್ಲ.</translation> <translation id="5546461542133609677">ಅನ್ಮ್ಯೂಟ್ ಮಾಡು</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">ದಯವಿಟ್ಟು ಅಲ್ಪ ವಿರಾಮದಿಂದ ಬೇರ್ಪಡಿಸಿದ ಇಮೇಲ್ ವಿಳಾಸಗಳ ಪಟ್ಟಿಯನ್ನು ನಮೂದಿಸಿ.</translation> <translation id="5939518447894949180">ಮರುಹೊಂದಿಸು</translation> <translation id="1921819250265091946">ದಿದಿ</translation> +<translation id="2613802280814924224">ಮಾನ್ಯ ಮೌಲ್ಯವನ್ನು ನಮೂದಿಸಿ. ಹತ್ತಿರದ ಮಾನ್ಯ ಮೌಲ್ಯವು <ph name="VALID_VALUE"/> ಆಗಿದೆ.</translation> <translation id="835897206747267392">ಅಮಾನ್ಯ ಮೌಲ್ಯ.</translation> <translation id="1842960171412779397">ಆಯ್ಕೆ ಮಾಡಿ</translation> <translation id="7673697353781729403">ಗಂಟೆಗಳು</translation> +<translation id="4664250907885839816">'<ph name="ATSIGN"/>' ನಂತರದ ಭಾಗವು '<ph name="INVALIDCHARACTER"/>' ಚಿಹ್ನೆಯನ್ನು ಒಳಗೊಂಡಿರಬಾರದು.</translation> <translation id="3450233048674729344">ಮೌಲ್ಯವು <ph name="MAXIMUM"/> ಕ್ಕೆ ಸಮನಾಗಿರಬಹುದು ಅಥವಾ ಅದಕ್ಕಿಂತಲೂ ಕಡಿಮೆ ಆಗಿರಬಹುದು.</translation> <translation id="3471999216963526757">30 ಸೆಕೆಂಡ್ಗಳಲ್ಲಿ ಮರಳಿ</translation> <translation id="668171684555832681">ಇತರೆ...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">ಸಕ್ರಿಯಗೊಳಿಸು</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> ಫೈಲ್ಗಳು</translation> <translation id="6643016212128521049">ತೆರವುಗೊಳಿಸಿ</translation> +<translation id="7888071071722539607">ಇಮೇಲ್ ವಿಳಾಸದಲ್ಲಿ ಒಂದು '<ph name="ATSIGN"/>' ಅನ್ನು ಸೇರಿಸಿ. '<ph name="ATSIGN"/>' ನಲ್ಲಿ '<ph name="INVALIDADDRESS"/>' ಕಾಣೆಯಾಗಿದೆ.</translation> <translation id="4851297395436456855">ವೇಗವಾಗಿ ಮುಂದಕ್ಕೆ</translation> <translation id="1088086359088493902">ಸೆಕೆಂಡುಗಳು</translation> <translation id="3934680773876859118">PDF ಡಾಕ್ಯುಮೆಂಟ್ ಅನ್ನು ಲೋಡ್ ಮಾಡಲು ವಿಫಲವಾಗಿದೆ</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_ko.xtb b/chromium/webkit/glue/resources/webkit_strings_ko.xtb index 8a06301cb8f..c5b4bdc7694 100644 --- a/chromium/webkit/glue/resources/webkit_strings_ko.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_ko.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">다른 시간...</translation> <translation id="2426432199384958866">스트리밍 영화를 실시간 방송으로 되돌리기</translation> <translation id="248395913932153421">일</translation> +<translation id="1729654308190250600">비어 있지 않은 이메일 주소를 입력해 주세요.</translation> <translation id="6015796118275082299">연도</translation> <translation id="9186171386827445984">문서 로드 중: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/>페이지</translation> <translation id="1235745349614807883">최근 검색 삭제</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">목록 표시기</translation> <translation id="4202807286478387388">건너뛰기</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">'<ph name="ATSIGN"/>' 앞 부분을 입력해 주세요. '<ph name="INVALIDADDRESS"/>'(이)가 완전하지 않습니다.</translation> +<translation id="2746543609216772311">값은 <ph name="MINIMUM_DATE_OR_TIME"/> 이후여야 합니다.</translation> <translation id="2572483411312390101">재생</translation> <translation id="8785498733064193001">재생 시작</translation> <translation id="7057186640035488495">영화 시간</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">뒤로 빠르게 탐색</translation> <translation id="7789962463072032349">일시중지</translation> <translation id="6853785296079745596">캡션 숨기기</translation> +<translation id="4360991593054037559">유효한 값을 입력해 주세요. 가장 근접한 유효 값 2개는 <ph name="VALID_VALUE_LOW"/> 및 <ph name="VALID_VALUE_HIGHER"/>입니다.</translation> <translation id="1758486001363313524">다른 일자...</translation> <translation id="8141602879876242471">이것은 검색 색인합니다. 검색 키워드 입력:</translation> <translation id="1930711995431081526">상태</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">앞으로 빠르게 탐색</translation> <translation id="4812940957355064477">숫자를 입력하세요.</translation> <translation id="2548326553472216322">최근 수행된 검색 없음</translation> +<translation id="1938124657309484470">값은 <ph name="MAXIMUM_DATE_OR_TIME"/> 이전이어야 합니다.</translation> <translation id="7263440858009898357">목록에서 항목을 선택하세요.</translation> <translation id="901493112792887934">현재 시간(초)</translation> <translation id="5164977714490026579">값은 <ph name="MINIMUM"/> 이상이어야 합니다.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">이번 주</translation> <translation id="5966707198760109579">주</translation> <translation id="2901282870647571346">현재 영화 상태</translation> +<translation id="2060505056492490888">'<ph name="INVALIDDOMAIN"/>'에서 '<ph name="DOT"/>'의 위치가 잘못되었습니다.</translation> <translation id="2674318244760992338">바닥글</translation> <translation id="8987927404178983737">월</translation> <translation id="8115662671911883373">캡션 표시 시작</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">선택</translation> <translation id="2846343701378493991">1024(중간 등급)</translation> <translation id="1637811476055996098">파일 선택</translation> +<translation id="49969490063480558">'<ph name="ATSIGN"/>' 뒷 부분을 입력해 주세요. '<ph name="INVALIDADDRESS"/>'(이)가 완전하지 않습니다.</translation> <translation id="5476505524087279545">선택취소</translation> <translation id="2148716181193084225">오늘</translation> <translation id="2507943997699731163">이 입력란을 작성하세요.</translation> <translation id="3785482301506746191">영화 시간 스크러버</translation> <translation id="739024184232394898">다른 주...</translation> +<translation id="383465348367842624">'<ph name="ATSIGN"/>' 앞 부분에 '<ph name="INVALIDCHARACTER"/>' 기호가 포함되면 안됩니다.</translation> <translation id="5468998798572797635">전체화면 닫기</translation> <translation id="5919473608089529604">플러그인을 로드할 수 없습니다.</translation> <translation id="5546461542133609677">음소거 해제</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">이메일 주소를 쉼표로 구분하여 입력하세요.</translation> <translation id="5939518447894949180">재설정</translation> <translation id="1921819250265091946">일</translation> +<translation id="2613802280814924224">유효한 값을 입력해 주세요. 가장 근접한 유효 값은 <ph name="VALID_VALUE"/>입니다.</translation> <translation id="835897206747267392">값이 잘못되었습니다.</translation> <translation id="1842960171412779397">선택</translation> <translation id="7673697353781729403">시간</translation> +<translation id="4664250907885839816">'<ph name="ATSIGN"/>' 다음 부분에 '<ph name="INVALIDCHARACTER"/>' 기호가 포함되면 안됩니다.</translation> <translation id="3450233048674729344">값은 <ph name="MAXIMUM"/> 이하여야 합니다.</translation> <translation id="3471999216963526757">30초 뒤로</translation> <translation id="668171684555832681">기타...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">활성화</translation> <translation id="8444882422881193423">파일 <ph name="NUMBER_OF_FILES"/>개</translation> <translation id="6643016212128521049">삭제</translation> +<translation id="7888071071722539607">이메일 주소에 '<ph name="ATSIGN"/>'를 포함해 주세요. '<ph name="INVALIDADDRESS"/>'에 '<ph name="ATSIGN"/>'가 없습니다.</translation> <translation id="4851297395436456855">빨리 감기</translation> <translation id="1088086359088493902">초</translation> <translation id="3934680773876859118">PDF 문서를 로드하지 못했습니다.</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_lt.xtb b/chromium/webkit/glue/resources/webkit_strings_lt.xtb index 1f93a2c05e6..7f067950160 100644 --- a/chromium/webkit/glue/resources/webkit_strings_lt.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_lt.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Kita...</translation> <translation id="2426432199384958866">transliuojamą vaizdo įrašą grąžinti į realųjį laiką</translation> <translation id="248395913932153421">Diena</translation> +<translation id="1729654308190250600">Įveskite el. pašto adresą (nepalikite lauko tuščio).</translation> <translation id="6015796118275082299">Metai</translation> <translation id="9186171386827445984">Įkeliamas dokumentas: <ph name="PAGE_NUMBER"/> / <ph name="NUMBER_OF_PAGES"/> psl...</translation> <translation id="1235745349614807883">Išvalyti pastarąsias paieškas</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">sąrašo žymeklis</translation> <translation id="4202807286478387388">peršokti</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Įveskite el. pašto adreso dalį iki „<ph name="ATSIGN"/>“. „<ph name="INVALIDADDRESS"/>“ nėra visas el. pašto adresas.</translation> +<translation id="2746543609216772311">Vertė turi būti <ph name="MINIMUM_DATE_OR_TIME"/> ar vėlesnė data.</translation> <translation id="2572483411312390101">paleisti</translation> <translation id="8785498733064193001">pradėti atkūrimą</translation> <translation id="7057186640035488495">filmo laikas</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">greitai eiti atgal</translation> <translation id="7789962463072032349">pristabdyti</translation> <translation id="6853785296079745596">slėpti uždaras antraštes</translation> +<translation id="4360991593054037559">Įveskite galiojančią vertę. Dvi artimiausios vertės yra <ph name="VALID_VALUE_LOW"/> ir <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Kita...</translation> <translation id="8141602879876242471">Tai yra ieškotinas indeksas. Įveskite paieškos raktinių žodžių:</translation> <translation id="1930711995431081526">būsena</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">greitai eiti pirmyn</translation> <translation id="4812940957355064477">Įveskite skaičių.</translation> <translation id="2548326553472216322">Pastaruoju metu paieškų nevykdyta</translation> +<translation id="1938124657309484470">Vertė turi būti <ph name="MAXIMUM_DATE_OR_TIME"/> ar ankstesnė data.</translation> <translation id="7263440858009898357">Pasirinkite sąraše pateiktą elementą.</translation> <translation id="901493112792887934">dabartinis laikas sekundėmis</translation> <translation id="5164977714490026579">Vertė turi būti <ph name="MINIMUM"/> arba didesnė.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Ši savaitė</translation> <translation id="5966707198760109579">Savaitė</translation> <translation id="2901282870647571346">dabartinė filmo būsena</translation> +<translation id="2060505056492490888">„<ph name="DOT"/>“ naudojamas netinkamoje „<ph name="INVALIDDOMAIN"/>“ vietoje.</translation> <translation id="2674318244760992338">poraštė</translation> <translation id="8987927404178983737">Mėnuo</translation> <translation id="8115662671911883373">pateikti uždaras antraštes</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">tikrinti</translation> <translation id="2846343701378493991">1024 (vidutinio lygio)</translation> <translation id="1637811476055996098">Pasirinkti failus</translation> +<translation id="49969490063480558">Įveskite dalį po „<ph name="ATSIGN"/>“. „<ph name="INVALIDADDRESS"/>“ nėra visas el. pašto adresas.</translation> <translation id="5476505524087279545">Nuimti žymėjimą</translation> <translation id="2148716181193084225">Šiandien</translation> <translation id="2507943997699731163">Užpildykite šį lauką.</translation> <translation id="3785482301506746191">filmo laiko valdiklis</translation> <translation id="739024184232394898">Kita...</translation> +<translation id="383465348367842624">Prieš „<ph name="ATSIGN"/>“ esančioje dalyje neturėtų būti simbolio „<ph name="INVALIDCHARACTER"/>“.</translation> <translation id="5468998798572797635">išeiti iš viso ekrano režimo</translation> <translation id="5919473608089529604">Nepavyko įkelti papildinio.</translation> <translation id="5546461542133609677">įjungti garsą</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Įveskite kableliais atskirtą el. pašto adresų sąrašą.</translation> <translation id="5939518447894949180">Nustatyti iš naujo</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Įveskite tinkamą vertę. Artimiausia tinkama vertė yra <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Neteisinga vertė.</translation> <translation id="1842960171412779397">pasirinkti</translation> <translation id="7673697353781729403">Valandos</translation> +<translation id="4664250907885839816">Po „<ph name="ATSIGN"/>“ esančioje dalyje neturėtų būti simbolio „<ph name="INVALIDCHARACTER"/>“.</translation> <translation id="3450233048674729344">Vertė turi būti <ph name="MAXIMUM"/> arba mažesnė.</translation> <translation id="3471999216963526757">atgal 30 sek.</translation> <translation id="668171684555832681">Kita...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">aktyvinti</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> failai (-ų)</translation> <translation id="6643016212128521049">Išvalyti</translation> +<translation id="7888071071722539607">Į el. pašto adresą įtraukite „<ph name="ATSIGN"/>“. „<ph name="INVALIDADDRESS"/>“ trūksta „<ph name="ATSIGN"/>“.</translation> <translation id="4851297395436456855">sukti pirmyn</translation> <translation id="1088086359088493902">Sekundės</translation> <translation id="3934680773876859118">Nepavyko įkelti PDF dokumento</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_lv.xtb b/chromium/webkit/glue/resources/webkit_strings_lv.xtb index 9eea8e88050..5a1357a3476 100644 --- a/chromium/webkit/glue/resources/webkit_strings_lv.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_lv.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Cits...</translation> <translation id="2426432199384958866">atsākt filmas straumēšanu reāllaikā</translation> <translation id="248395913932153421">Diena</translation> +<translation id="1729654308190250600">Lūdzu, ievadiet e-pasta adresi.</translation> <translation id="6015796118275082299">Gads</translation> <translation id="9186171386827445984">Notiek dokumenta ielāde: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> lappuses...</translation> <translation id="1235745349614807883">Dzēst nesenos meklējumus</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">sarakstu marķieris</translation> <translation id="4202807286478387388">lekt</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Lūdzu, ievadiet daļu, kas atrodas pirms zīmes <ph name="ATSIGN"/>. “<ph name="INVALIDADDRESS"/>” ir nepilna adrese.</translation> +<translation id="2746543609216772311">Vērtībai ir jābūt “<ph name="MINIMUM_DATE_OR_TIME"/>” vai vēlākam datumam vai laikam.</translation> <translation id="2572483411312390101">atskaņot</translation> <translation id="8785498733064193001">sākt atskaņošanu</translation> <translation id="7057186640035488495">filmas laiks</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">ātri pārtīt atpakaļ</translation> <translation id="7789962463072032349">pauzēt</translation> <translation id="6853785296079745596">slēpt slēgtos parakstus</translation> +<translation id="4360991593054037559">Lūdzu, ievadiet derīgu vērtību. Divas tuvākās derīgās vērtības ir <ph name="VALID_VALUE_LOW"/> un <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Cits...</translation> <translation id="8141602879876242471">Šis ir indekss ar meklēšanas iespējām. Ievadīt meklēšanas atslēgvārdus:</translation> <translation id="1930711995431081526">statuss</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">ātri pārtīt uz priekšu</translation> <translation id="4812940957355064477">Lūdzu, ievadiet skaitli.</translation> <translation id="2548326553472216322">Nav nesenu meklējumu</translation> +<translation id="1938124657309484470">Vērtībai ir jābūt “<ph name="MAXIMUM_DATE_OR_TIME"/>” vai agrākam datumam vai laikam.</translation> <translation id="7263440858009898357">Atlasiet vienumu sarakstā.</translation> <translation id="901493112792887934">pašreizējais laiks sekundēs</translation> <translation id="5164977714490026579">Vērtībai ir jābūt lielākai vai vienādai ar <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Šī nedēļa</translation> <translation id="5966707198760109579">Nedēļa</translation> <translation id="2901282870647571346">pašreizējais filmas statuss</translation> +<translation id="2060505056492490888">Punkts (<ph name="DOT"/>) atrodas nepareizā vietā (<ph name="INVALIDDOMAIN"/>).</translation> <translation id="2674318244760992338">kājene</translation> <translation id="8987927404178983737">Mēnesis</translation> <translation id="8115662671911883373">sākt slēgto parakstu rādīšanu</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">prbaudt</translation> <translation id="2846343701378493991">1024 (Vidēja Atzīme)</translation> <translation id="1637811476055996098">Izvēlēties failus</translation> +<translation id="49969490063480558">Lūdzu, ievadiet daļu, kas atrodas aiz zīmes <ph name="ATSIGN"/>. “<ph name="INVALIDADDRESS"/>” ir nepilna adrese.</translation> <translation id="5476505524087279545">neprbaudt</translation> <translation id="2148716181193084225">Šodien</translation> <translation id="2507943997699731163">Aizpildiet šo lauku.</translation> <translation id="3785482301506746191">filmas laika slīdnis</translation> <translation id="739024184232394898">Cits...</translation> +<translation id="383465348367842624">Daļā, kas atrodas pirms zīmes <ph name="ATSIGN"/>, nedrīkst būt ietverts simbols <ph name="INVALIDCHARACTER"/>.</translation> <translation id="5468998798572797635">iziet no pilnekrāna režīma</translation> <translation id="5919473608089529604">Nevarēja ielādēt spraudni.</translation> <translation id="5546461542133609677">rādīt</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Lūdzu, ievadiet ar komatu atdalītu e-pasta adrešu sarakstu.</translation> <translation id="5939518447894949180">Atiestatīt</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Lūdzu, ievadiet derīgu vērtību. Tuvākā derīgā vērtība ir <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Nederīga vērtība.</translation> <translation id="1842960171412779397">Atlasiet</translation> <translation id="7673697353781729403">Stundas</translation> +<translation id="4664250907885839816">Daļā, kas atrodas aiz zīmes <ph name="ATSIGN"/>, nedrīkst būt ietverts simbols <ph name="INVALIDCHARACTER"/>.</translation> <translation id="3450233048674729344">Vērtībai ir jābūt mazākai vai vienādai ar <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">atpakaļ par 30 sekundēm</translation> <translation id="668171684555832681">Cits</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">aktivizt</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> faili</translation> <translation id="6643016212128521049">Notīrīt</translation> +<translation id="7888071071722539607">E-pasta adresē ietveriet zīmi <ph name="ATSIGN"/>. Adresē “<ph name="INVALIDADDRESS"/>” trūkst zīmes <ph name="ATSIGN"/>.</translation> <translation id="4851297395436456855">pārtīt uz priekšu</translation> <translation id="1088086359088493902">Sekundes</translation> <translation id="3934680773876859118">Neizdevās ielādēt PDF dokumentu</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_ml.xtb b/chromium/webkit/glue/resources/webkit_strings_ml.xtb index d8f1efe8681..839bbe8c8de 100644 --- a/chromium/webkit/glue/resources/webkit_strings_ml.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_ml.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">മറ്റുള്ളവ...</translation> <translation id="2426432199384958866">സ്ട്രീമിംഗ് മൂവിയെ തൽസമയത്തിലേക്ക് മാറ്റുക</translation> <translation id="248395913932153421">ദിവസം</translation> +<translation id="1729654308190250600">ശൂന്യമായിടാതെ, ഇമെയിൽ വിലാസം നൽകുക.</translation> <translation id="6015796118275082299">വര്ഷം</translation> <translation id="9186171386827445984">പ്രമാണങ്ങള് ലോഡുചെയ്യുന്നു: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> പേജുകള്...</translation> <translation id="1235745349614807883">അടുത്തിടെയുള്ള തിരയലുകള് മായ്ക്കുക</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">പട്ടിക മാര്ക്കര്</translation> <translation id="4202807286478387388">jump</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">'<ph name="ATSIGN"/>' എന്നതിനുശേഷം ഒരു ഭാഗം നൽകുക.'<ph name="INVALIDADDRESS"/>' അപൂർണ്ണമാണ്.</translation> +<translation id="2746543609216772311">മൂല്യം <ph name="MINIMUM_DATE_OR_TIME"/> എന്നതോ അതിനുശേഷമുള്ള തീയതിയോ ആയിരിക്കണം.</translation> <translation id="2572483411312390101">പ്ലേ ചെയ്യുക</translation> <translation id="8785498733064193001">പ്ലേബാക്ക് ആരംഭിക്കുക</translation> <translation id="7057186640035488495">മൂവി ടൈം</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">പെട്ടെന്ന് പിന്നോട്ട് പോകുക</translation> <translation id="7789962463072032349">താല്ക്കാലികമായി നിര്ത്തുക</translation> <translation id="6853785296079745596">അടച്ച അടിക്കുറിപ്പുകൾ മറയ്ക്കുക</translation> +<translation id="4360991593054037559">സാധുവായ മൂല്യം നൽകുക. സാധുവായ ഏറ്റവുമടുത്ത രണ്ട് മൂല്യങ്ങൾ <ph name="VALID_VALUE_LOW"/>, <ph name="VALID_VALUE_HIGHER"/> എന്നിവയാണ്.</translation> <translation id="1758486001363313524">മറ്റുള്ളവ...</translation> <translation id="8141602879876242471">ഇത് തിരയാവുന്ന സൂചികയാണ്. തിരയല് കീവേഡുകള് നല്കുക:</translation> <translation id="1930711995431081526">നില</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">പെട്ടെന്ന് മുന്നോട്ട് പോകുക</translation> <translation id="4812940957355064477">ഒരു നമ്പർ നൽകുക.</translation> <translation id="2548326553472216322">സമീപകാല തിരയലുകള് ഇല്ല</translation> +<translation id="1938124657309484470">മൂല്യം <ph name="MAXIMUM_DATE_OR_TIME"/> എന്നതോ അതിനുമുമ്പുള്ള തീയതിയോ ആയിരിക്കണം.</translation> <translation id="7263440858009898357">പട്ടികയിലെ ഒരു ഇനം ദയവായി തിരഞ്ഞെടുക്കുക</translation> <translation id="901493112792887934">നിലവിലെ സമയം നിമിഷങ്ങളിൽ</translation> <translation id="5164977714490026579">മൂല്യം <ph name="MINIMUM"/> എന്നതില് കൂടുതലോ സമമോ ആയിരിക്കണം.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">ഈ ആഴ്ച</translation> <translation id="5966707198760109579">ആഴ്ച</translation> <translation id="2901282870647571346">നിലവിലെ മൂവി നില</translation> +<translation id="2060505056492490888">'<ph name="DOT"/>', '<ph name="INVALIDDOMAIN"/>' എന്നതിൽ തെറ്റായ സ്ഥാനത്താണ് ഉപയോഗിച്ചിരിക്കുന്നത്.</translation> <translation id="2674318244760992338">അടിക്കുറിപ്പ്</translation> <translation id="8987927404178983737">മാസം</translation> <translation id="8115662671911883373">അടച്ച അടിക്കുറിപ്പുകൾ പ്രദർശിപ്പിക്കുന്നത് ആരംഭിക്കുക</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">പരിശോധിക്കൂ</translation> <translation id="2846343701378493991">1024 (മീഡിയം ഗ്രേഡ്)</translation> <translation id="1637811476055996098">ഫയലുകൾ തിരഞ്ഞെടുക്കുക</translation> +<translation id="49969490063480558">'<ph name="ATSIGN"/>' എന്നതിനുശേഷം ഒരു ഭാഗം നൽകുക.'<ph name="INVALIDADDRESS"/>' അപൂർണ്ണമാണ്.</translation> <translation id="5476505524087279545">അണ്ചെക്ക് ചെയ്യുക</translation> <translation id="2148716181193084225">ഇന്ന്</translation> <translation id="2507943997699731163">ദയവായി ഈ ഫീല്ഡ് പൂരിപ്പിക്കുക.</translation> <translation id="3785482301506746191">മൂവി ടൈം സ്ക്രബ്ബർ</translation> <translation id="739024184232394898">മറ്റുള്ളവ...</translation> +<translation id="383465348367842624">'<ph name="ATSIGN"/>' എന്നതിനുശേഷം വരുന്ന ഒരു ഭാഗത്തിൽ '<ph name="INVALIDCHARACTER"/>' ചിഹ്നം ഉണ്ടാകരുത്.</translation> <translation id="5468998798572797635">പൂർണ്ണ സ്ക്രീനിൽ നിന്ന് പുറത്തുകടക്കുക</translation> <translation id="5919473608089529604">പ്ലഗ്-ഇൻ ലോഡുചെയ്യാൻ കഴിഞ്ഞില്ല.</translation> <translation id="5546461542133609677">ശബ്ദമുള്ളതാക്കുക</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">ഇമെയില് വിലാസങ്ങളുടെ കോമയാല് വേര്തിരിച്ച ഒരു പട്ടിക ദയവായി നല്കുക.</translation> <translation id="5939518447894949180">വീണ്ടും സജ്ജീകരിക്കുക</translation> <translation id="1921819250265091946">തീയതി</translation> +<translation id="2613802280814924224">സാധുവായ ഒരു മൂല്യം നൽകുക. ഏറ്റവുമടുത്ത സാധുവായ മൂല്യം <ph name="VALID_VALUE"/> ആണ്.</translation> <translation id="835897206747267392">അസാധുവായ മൂല്യം.</translation> <translation id="1842960171412779397">തിരഞ്ഞെടുക്കൂ</translation> <translation id="7673697353781729403">മണിക്കൂര്</translation> +<translation id="4664250907885839816">'<ph name="ATSIGN"/>' എന്നതിനുശേഷം വരുന്ന ഭാഗത്തിൽ '<ph name="INVALIDCHARACTER"/>' ചിഹ്നം ഉണ്ടാകരുത്.</translation> <translation id="3450233048674729344">മൂല്യം <ph name="MAXIMUM"/> എന്നതില് കുറവോ സമമോ ആയിരിക്കണം.</translation> <translation id="3471999216963526757">30 നിമിഷം പിന്നോട്ട്</translation> <translation id="668171684555832681">മറ്റുള്ളവ...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">ആക്റ്റിവേറ്റ് ചെയ്യുക</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> ഫയലുകള്</translation> <translation id="6643016212128521049">മായ്ക്കുക</translation> +<translation id="7888071071722539607">ഇമെയിൽ വിലാസത്തിൽ '<ph name="ATSIGN"/>' ഉൾപ്പെടുത്തുക. '<ph name="INVALIDADDRESS"/>' എന്നതിൽ ഒരു '<ph name="ATSIGN"/>' കാണുന്നില്ല.</translation> <translation id="4851297395436456855">വേഗത്തിൽ മുന്നോട്ട് പോകുക</translation> <translation id="1088086359088493902">സെക്കൻഡ്</translation> <translation id="3934680773876859118">PDF പ്രമാണം ലോഡുചെയ്യുന്നത് പരാജയപ്പെട്ടു</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_mr.xtb b/chromium/webkit/glue/resources/webkit_strings_mr.xtb index 4f475fbfa80..bc6aae29e07 100644 --- a/chromium/webkit/glue/resources/webkit_strings_mr.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_mr.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">अन्य...</translation> <translation id="2426432199384958866">रिअल टाइमकडे प्रवाह चित्रपट परत करा</translation> <translation id="248395913932153421">दिवस</translation> +<translation id="1729654308190250600">कृपया एक रिक्त-नसलेला ईमेल पत्ता प्रविष्ट करा.</translation> <translation id="6015796118275082299">वर्ष</translation> <translation id="9186171386827445984">दस्तऐवज लोड करत आहे: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> पृष्ठे...</translation> <translation id="1235745349614807883">अलीकडील शोध साफ करा</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">सूची चिन्हक</translation> <translation id="4202807286478387388">जंप करा</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">कृपया '<ph name="ATSIGN"/>' मागुन येणारा भाग प्रविष्ट करा. '<ph name="INVALIDADDRESS"/>' अपूर्ण आहे.</translation> +<translation id="2746543609216772311">मूल्य <ph name="MINIMUM_DATE_OR_TIME"/> किंवा नंतरचे असणे आवश्यक आहे.</translation> <translation id="2572483411312390101">प्ले करा</translation> <translation id="8785498733064193001">प्लेबॅक आरंभ करा</translation> <translation id="7057186640035488495">चित्रपटाची वेळ</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">द्रुतपणे परत शोधून काढा</translation> <translation id="7789962463072032349">विराम द्या</translation> <translation id="6853785296079745596">बंद मथळा लपवा</translation> +<translation id="4360991593054037559">कृपया एक वैध मूल्य प्रविष्ट करा. दोन जवळील वैध मूल्ये <ph name="VALID_VALUE_LOW"/> आणि <ph name="VALID_VALUE_HIGHER"/> आहेत.</translation> <translation id="1758486001363313524">अन्य...</translation> <translation id="8141602879876242471">ही शोध घेण्यायोग्य अनुक्रमणिका आहे. शोध कीवर्ड प्रविष्ट करा:</translation> <translation id="1930711995431081526">स्थिती</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">द्रुतपणे अग्रेषण शोधून काढा</translation> <translation id="4812940957355064477">कृपया एक नंबर प्रविष्ट करा.</translation> <translation id="2548326553472216322">अलीकडील शोध नाहीत</translation> +<translation id="1938124657309484470">मूल्य <ph name="MAXIMUM_DATE_OR_TIME"/> किंवा आधीचे असणे आवश्यक आहे.</translation> <translation id="7263440858009898357">कृपया सूचीमधील आयटम निवडा.</translation> <translation id="901493112792887934">वर्तमान वेळ सेकंदांमध्ये</translation> <translation id="5164977714490026579">मूल्य <ph name="MINIMUM"/> पेक्षा मोठे किंवा समान असावे.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">या आठवड्यात</translation> <translation id="5966707198760109579">आठवडा</translation> <translation id="2901282870647571346">वर्तमान चित्रपट स्थिती</translation> +<translation id="2060505056492490888">'<ph name="DOT"/>' '<ph name="INVALIDDOMAIN"/>' मध्ये चुकीच्या स्थितीवर वापरले आहे.</translation> <translation id="2674318244760992338">अधोलेख</translation> <translation id="8987927404178983737">महिना</translation> <translation id="8115662671911883373">बंद मथळा प्रदर्शित करणे प्रारंभ करा</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">तपासा</translation> <translation id="2846343701378493991">1024 (मध्यम प्रत)</translation> <translation id="1637811476055996098">फायली निवडा</translation> +<translation id="49969490063480558">कृपया '<ph name="ATSIGN"/>' चे अनुसरण करणारा भाग प्रविष्ट करा. '<ph name="INVALIDADDRESS"/>' अपूर्ण आहे.</translation> <translation id="5476505524087279545">अनचेक</translation> <translation id="2148716181193084225">आज</translation> <translation id="2507943997699731163">कृपया हे फील्ड भरा.</translation> <translation id="3785482301506746191">चित्रपट वेळ स्क्रबर</translation> <translation id="739024184232394898">अन्य...</translation> +<translation id="383465348367842624">'<ph name="ATSIGN"/>' मागुन येणार्या भागामध्ये '<ph name="INVALIDCHARACTER"/>' चिन्ह नसावे.</translation> <translation id="5468998798572797635">पूर्ण स्क्रीनमधून निर्गमन करा</translation> <translation id="5919473608089529604">प्लग-इन लोड करणे शक्य झाले नाही.</translation> <translation id="5546461542133609677">सशब्द करा</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">कृपया ईमेल पत्त्यांची स्वल्पविरामाद्वारे विभक्त सूची प्रविष्ट करा.</translation> <translation id="5939518447894949180">रीसेट करा</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">कृपया एक वैध मूल्य प्रविष्ट करा. जवळील वैध मूल्य <ph name="VALID_VALUE"/> आहे.</translation> <translation id="835897206747267392">अवैध मूल्य.</translation> <translation id="1842960171412779397">निवडा</translation> <translation id="7673697353781729403">तास</translation> +<translation id="4664250907885839816">'<ph name="ATSIGN"/>' चे अनुसरण करणार्या भागामध्ये '<ph name="INVALIDCHARACTER"/>' चिन्ह नसावे.</translation> <translation id="3450233048674729344">मूल्य <ph name="MAXIMUM"/> पेक्षा कमी किंवा समान असावे.</translation> <translation id="3471999216963526757">परत 30 सेकंद</translation> <translation id="668171684555832681">अन्य...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">सक्रिय करा</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> फायली</translation> <translation id="6643016212128521049">साफ करा</translation> +<translation id="7888071071722539607">कृपया ईमेल पत्त्यामध्ये '<ph name="ATSIGN"/>' समाविष्ट करा. '<ph name="INVALIDADDRESS"/>' '<ph name="ATSIGN"/>' गमावत आहे.</translation> <translation id="4851297395436456855">जलद अग्रेषण</translation> <translation id="1088086359088493902">सेकंद</translation> <translation id="3934680773876859118">PDF दस्तऐवज लोड करणे अयशस्वी</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_ms.xtb b/chromium/webkit/glue/resources/webkit_strings_ms.xtb index 55a69880660..c94d5b0ea3e 100644 --- a/chromium/webkit/glue/resources/webkit_strings_ms.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_ms.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Lain-lain...</translation> <translation id="2426432199384958866">kembalikan penstriman filem pada masa nyata</translation> <translation id="248395913932153421">Hari</translation> +<translation id="1729654308190250600">Sila masukkan alamat e-mel bukan kosong.</translation> <translation id="6015796118275082299">Tahun</translation> <translation id="9186171386827445984">Memuatkan dokumen: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> halaman...</translation> <translation id="1235745349614807883">Kosongkan Carian Baru-baru Ini</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">penanda senarai</translation> <translation id="4202807286478387388">lompat</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Sila masukkan bahagian diikuti oleh '<ph name="ATSIGN"/>'. '<ph name="INVALIDADDRESS"/>' tidak lengkap.</translation> +<translation id="2746543609216772311">Nilai mestilah <ph name="MINIMUM_DATE_OR_TIME"/> atau kemudian.</translation> <translation id="2572483411312390101">main</translation> <translation id="8785498733064193001">mulakan main balik</translation> <translation id="7057186640035488495">masa filem</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">cari ke belakang dengan cepat</translation> <translation id="7789962463072032349">jeda</translation> <translation id="6853785296079745596">sembunyikan kapsyen tertutup</translation> +<translation id="4360991593054037559">Sila masukkan nilai yang sah. Dua nilai sah yang terdekat ialah <ph name="VALID_VALUE_LOW"/> dan <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Lain-lain...</translation> <translation id="8141602879876242471">Ini adalah indeks boleh dicari. Masukkan kata kunci carian:</translation> <translation id="1930711995431081526">status</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">cari ke hadapan dengan cepat</translation> <translation id="4812940957355064477">Sila masukkan nombor.</translation> <translation id="2548326553472216322">Tiada carian baru-baru ini</translation> +<translation id="1938124657309484470">Nilai mestilah <ph name="MAXIMUM_DATE_OR_TIME"/> atau lebih awal.</translation> <translation id="7263440858009898357">Sila pilih item dalam senarai.</translation> <translation id="901493112792887934">masa semasa dalam saat</translation> <translation id="5164977714490026579">Nilai mesti lebih besar daripada atau sama dengan <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Minggu ini</translation> <translation id="5966707198760109579">Minggu</translation> <translation id="2901282870647571346">status filem semasa</translation> +<translation id="2060505056492490888">'<ph name="DOT"/>' digunakan pada kedudukan yang salah dalam '<ph name="INVALIDDOMAIN"/>'.</translation> <translation id="2674318244760992338">pembawah</translation> <translation id="8987927404178983737">Bulan</translation> <translation id="8115662671911883373">mula memaparkan kapsyen tertutup</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">periksa</translation> <translation id="2846343701378493991">1024 (Gred Sederhana)</translation> <translation id="1637811476055996098">Pilih Fail</translation> +<translation id="49969490063480558">Sila masukkan bahagian selepas '<ph name="ATSIGN"/>'. '<ph name="INVALIDADDRESS"/>' tidak lengkap.</translation> <translation id="5476505524087279545">nyahpilih</translation> <translation id="2148716181193084225">Hari ini</translation> <translation id="2507943997699731163">Sila isikan medan ini.</translation> <translation id="3785482301506746191">pembersih masa filem</translation> <translation id="739024184232394898">Lain-lain...</translation> +<translation id="383465348367842624">Bahagian yang diikuti oleh '<ph name="ATSIGN"/>' tidak boleh mengandungi simbol '<ph name="INVALIDCHARACTER"/>'.</translation> <translation id="5468998798572797635">keluar daripada skrin penuh</translation> <translation id="5919473608089529604">Tidak dapat memuatkan pemalam.</translation> <translation id="5546461542133609677">nyahredam</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Sila masukkan senarai alamat e-mel yang dipisahkan dengan koma.</translation> <translation id="5939518447894949180">Tetapkan semula</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Sila masukkan nilai yang sah. Nilai sah yang terdekat ialah <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Nilai tidak sah.</translation> <translation id="1842960171412779397">pilih</translation> <translation id="7673697353781729403">Jam</translation> +<translation id="4664250907885839816">Bahagian selepas '<ph name="ATSIGN"/>' tidak boleh mengandungi simbol '<ph name="INVALIDCHARACTER"/>'.</translation> <translation id="3450233048674729344">Nilai mestilah kurang daripada atau sama dengan <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">30 saat ke belakang</translation> <translation id="668171684555832681">Lain-lain...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">aktifkan</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> fail</translation> <translation id="6643016212128521049">Kosongkan</translation> +<translation id="7888071071722539607">Sila masukkan '<ph name="ATSIGN"/>' dalam alamat e-mel. '<ph name="INVALIDADDRESS"/>' tiada '<ph name="ATSIGN"/>'.</translation> <translation id="4851297395436456855">mara laju</translation> <translation id="1088086359088493902">Saat</translation> <translation id="3934680773876859118">Gagal untuk memuatkan dokumen PDF</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_nl.xtb b/chromium/webkit/glue/resources/webkit_strings_nl.xtb index 5f813c93006..9b1cdd85f30 100644 --- a/chromium/webkit/glue/resources/webkit_strings_nl.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_nl.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Anders...</translation> <translation id="2426432199384958866">terug naar streamen van film in realtime</translation> <translation id="248395913932153421">Dag</translation> +<translation id="1729654308190250600">Geef een e-mailadres op.</translation> <translation id="6015796118275082299">Jaar</translation> <translation id="9186171386827445984">Document wordt geladen: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> pagina's...</translation> <translation id="1235745349614807883">Recente zoekopdrachten wissen</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">lijstmarkering</translation> <translation id="4202807286478387388">Gaan naar</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Geef een naamgedeelte op, gevolgd door '<ph name="ATSIGN"/>'. '<ph name="INVALIDADDRESS"/>' is onvolledig.</translation> +<translation id="2746543609216772311">Waarde moet <ph name="MINIMUM_DATE_OR_TIME"/> of later zijn.</translation> <translation id="2572483411312390101">afspelen</translation> <translation id="8785498733064193001">afspelen starten</translation> <translation id="7057186640035488495">tijd van de film</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">snel achteruit zoeken</translation> <translation id="7789962463072032349">onderbreken</translation> <translation id="6853785296079745596">ondertiteling verbergen</translation> +<translation id="4360991593054037559">Geef een geldige waarde op. De twee dichtstbijzijnde geldige waarden zijn <ph name="VALID_VALUE_LOW"/> en <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Anders...</translation> <translation id="8141602879876242471">Dit is een doorzoekbare index. Geef zoekwoorden op:</translation> <translation id="1930711995431081526">status</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">snel vooruit zoeken</translation> <translation id="4812940957355064477">Voer een getal in.</translation> <translation id="2548326553472216322">Geen recente zoekopdrachten</translation> +<translation id="1938124657309484470">Waarde moet <ph name="MAXIMUM_DATE_OR_TIME"/> of eerder zijn.</translation> <translation id="7263440858009898357">Selecteer een item in de lijst.</translation> <translation id="901493112792887934">huidige tijd in seconden</translation> <translation id="5164977714490026579">Waarde moet groter dan of gelijk zijn aan <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Deze week</translation> <translation id="5966707198760109579">Week</translation> <translation id="2901282870647571346">huidige filmstatus</translation> +<translation id="2060505056492490888">'<ph name="DOT"/>' wordt op een verkeerde positie gebruikt in '<ph name="INVALIDDOMAIN"/>'.</translation> <translation id="2674318244760992338">voettekst</translation> <translation id="8987927404178983737">Maand</translation> <translation id="8115662671911883373">het weergeven van ondertiteling starten</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">Selecteren</translation> <translation id="2846343701378493991">1024 (gemiddeld niveau)</translation> <translation id="1637811476055996098">Bestanden kiezen</translation> +<translation id="49969490063480558">Geef een adresgedeelte op na '<ph name="ATSIGN"/>'. '<ph name="INVALIDADDRESS"/>' is onvolledig.</translation> <translation id="5476505524087279545">Deselecteren</translation> <translation id="2148716181193084225">Vandaag</translation> <translation id="2507943997699731163">Vul dit veld in.</translation> <translation id="3785482301506746191">schuifbalk met tijd van de film</translation> <translation id="739024184232394898">Anders...</translation> +<translation id="383465348367842624">Het naamgedeelte vóór '<ph name="ATSIGN"/>' mag niet het teken '<ph name="INVALIDCHARACTER"/>' bevatten.</translation> <translation id="5468998798572797635">volledig scherm sluiten</translation> <translation id="5919473608089529604">Kan plug-in niet laden.</translation> <translation id="5546461542133609677">dempen opheffen</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Voer een door komma's gescheiden lijst met e-mailadressen in.</translation> <translation id="5939518447894949180">Herstellen</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Geef een geldige waarde op. De dichtstbijzijnde geldige waarde is <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Ongeldige waarde.</translation> <translation id="1842960171412779397">Selecteren</translation> <translation id="7673697353781729403">Uur</translation> +<translation id="4664250907885839816">Het adresgedeelte na '<ph name="ATSIGN"/>' mag niet het teken '<ph name="INVALIDCHARACTER"/>' bevatten.</translation> <translation id="3450233048674729344">Waarde moet kleiner dan of gelijk zijn aan <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">30 seconden terug</translation> <translation id="668171684555832681">Anders...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">Activeren</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> bestanden</translation> <translation id="6643016212128521049">Wissen</translation> +<translation id="7888071071722539607">Gebruik een '<ph name="ATSIGN"/>' in thet e-mailadres. In '<ph name="INVALIDADDRESS"/>' ontbreekt een '<ph name="ATSIGN"/>'.</translation> <translation id="4851297395436456855">snel vooruitspoelen</translation> <translation id="1088086359088493902">Seconden</translation> <translation id="3934680773876859118">PDF-document kan niet worden geladen</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_no.xtb b/chromium/webkit/glue/resources/webkit_strings_no.xtb index 5f83840b57d..62bd07ee42d 100644 --- a/chromium/webkit/glue/resources/webkit_strings_no.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_no.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Andre</translation> <translation id="2426432199384958866">gå tilbake til direkteavspilling av filmen i sanntid</translation> <translation id="248395913932153421">Dag</translation> +<translation id="1729654308190250600">Skriv inn en ikke-tom e-postadresse.</translation> <translation id="6015796118275082299">År</translation> <translation id="9186171386827445984">Laster inn dokument: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> sider</translation> <translation id="1235745349614807883">Fjern nylige søk</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">listemarkør</translation> <translation id="4202807286478387388">hopp</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Skriv inn en del etterfulgt av «<ph name="ATSIGN"/>». «<ph name="INVALIDADDRESS"/>» er ufullstendig.</translation> +<translation id="2746543609216772311">Verdien må være <ph name="MINIMUM_DATE_OR_TIME"/> eller senere.</translation> <translation id="2572483411312390101">spill av</translation> <translation id="8785498733064193001">start avspillingen</translation> <translation id="7057186640035488495">gå til et annet tidspunkt</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">spol raskt bakover</translation> <translation id="7789962463072032349">stans midlertidig</translation> <translation id="6853785296079745596">skjul teksting</translation> +<translation id="4360991593054037559">Skriv inn en gyldig verdi. De to nærmeste, gyldige verdiene er <ph name="VALID_VALUE_LOW"/> og <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Andre</translation> <translation id="8141602879876242471">Dette er en søkbar indeks. Angi søkeordene:</translation> <translation id="1930711995431081526">status</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">spol raskt fremover</translation> <translation id="4812940957355064477">Skriv inn et tall.</translation> <translation id="2548326553472216322">Ingen nylige søk</translation> +<translation id="1938124657309484470">Verdien må være <ph name="MAXIMUM_DATE_OR_TIME"/> eller før.</translation> <translation id="7263440858009898357">Velg en artikkel i listen.</translation> <translation id="901493112792887934">gjeldende tid i sekunder</translation> <translation id="5164977714490026579">Verdien må være større enn eller lik <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Denne uken</translation> <translation id="5966707198760109579">Uke</translation> <translation id="2901282870647571346">gjeldende filmstatus</translation> +<translation id="2060505056492490888">«<ph name="DOT"/>» er brukt på feil sted i «<ph name="INVALIDDOMAIN"/>».</translation> <translation id="2674318244760992338">fotnote</translation> <translation id="8987927404178983737">Måned</translation> <translation id="8115662671911883373">slå på tekstingen</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">merk av</translation> <translation id="2846343701378493991">1024 (middels)</translation> <translation id="1637811476055996098">Velg filer</translation> +<translation id="49969490063480558">Skriv inn en del etterfulgt av «<ph name="ATSIGN"/>». «<ph name="INVALIDADDRESS"/>» er ufullstendig.</translation> <translation id="5476505524087279545">fjern merke</translation> <translation id="2148716181193084225">I dag</translation> <translation id="2507943997699731163">Vennligst fyll ut dette feltet.</translation> <translation id="3785482301506746191">videotidslinje</translation> <translation id="739024184232394898">Andre</translation> +<translation id="383465348367842624">En del etterfulgt av «<ph name="ATSIGN"/>» kan ikke inneholde symbolet «<ph name="INVALIDCHARACTER"/>».</translation> <translation id="5468998798572797635">avslutt fullskjerm</translation> <translation id="5919473608089529604">Kunne ikke laste inn programtillegget.</translation> <translation id="5546461542133609677">slå på lyden</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Skriv inn en liste over e-postadresser atskilt med komma.</translation> <translation id="5939518447894949180">Tilbakestill</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Skriv inn en gyldig verdi. Den nærmeste, gyldige verdien er <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Ugyldig verdi</translation> <translation id="1842960171412779397">velg</translation> <translation id="7673697353781729403">Timer</translation> +<translation id="4664250907885839816">En del etterfulgt av «<ph name="ATSIGN"/>» kan ikke inneholde symbolet «<ph name="INVALIDCHARACTER"/>».</translation> <translation id="3450233048674729344">Verdien må være mindre enn eller lik <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">30 sekunder bakover</translation> <translation id="668171684555832681">Annen</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">aktiver</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> filer</translation> <translation id="6643016212128521049">Tøm</translation> +<translation id="7888071071722539607">Inkluder en «<ph name="ATSIGN"/>» i e-postadressen. «<ph name="INVALIDADDRESS"/>» mangler en «<ph name="ATSIGN"/>».</translation> <translation id="4851297395436456855">spol fremover</translation> <translation id="1088086359088493902">Sekunder</translation> <translation id="3934680773876859118">Kan ikke laste inn PDF-dokument</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_pl.xtb b/chromium/webkit/glue/resources/webkit_strings_pl.xtb index dff6ec24da0..7bdd27fb16c 100644 --- a/chromium/webkit/glue/resources/webkit_strings_pl.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_pl.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Inny...</translation> <translation id="2426432199384958866">powróć do czasu rzeczywistego strumieniowo przesyłanego filmu</translation> <translation id="248395913932153421">Dzień</translation> +<translation id="1729654308190250600">Podaj adres e-mail.</translation> <translation id="6015796118275082299">Rok</translation> <translation id="9186171386827445984">Wczytywanie dokumentu: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> stron...</translation> <translation id="1235745349614807883">Wyczyść ostatnie wyszukiwania</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">znacznik listy</translation> <translation id="4202807286478387388">przejdź</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Podaj część przed znakiem „<ph name="ATSIGN"/>”. Adres „<ph name="INVALIDADDRESS"/>” jest niepełny.</translation> +<translation id="2746543609216772311">Musisz podać wartość <ph name="MINIMUM_DATE_OR_TIME"/> lub późniejszą.</translation> <translation id="2572483411312390101">odtwórz</translation> <translation id="8785498733064193001">rozpocznij odtwarzanie</translation> <translation id="7057186640035488495">czas filmu</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">szybko przewiń do tyłu</translation> <translation id="7789962463072032349">wstrzymaj</translation> <translation id="6853785296079745596">ukryj napisy</translation> +<translation id="4360991593054037559">Podaj prawidłową wartość. Dwie najbliższe prawidłowe wartości to <ph name="VALID_VALUE_LOW"/> i <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Inny...</translation> <translation id="8141602879876242471">Ten indeks można przeszukiwać. Wprowadź wyszukiwane słowa kluczowe:</translation> <translation id="1930711995431081526">stan</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">szybko przewiń do przodu</translation> <translation id="4812940957355064477">Wpisz liczbę.</translation> <translation id="2548326553472216322">Brak ostatnich wyszukiwań</translation> +<translation id="1938124657309484470">Musisz podać wartość <ph name="MAXIMUM_DATE_OR_TIME"/> lub wcześniejszą.</translation> <translation id="7263440858009898357">Wybierz element z listy.</translation> <translation id="901493112792887934">bieżący czas w sekundach</translation> <translation id="5164977714490026579">Wartość nie może być mniejsza niż <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">W tym tygodniu</translation> <translation id="5966707198760109579">Tydzień</translation> <translation id="2901282870647571346">bieżący stan filmu</translation> +<translation id="2060505056492490888">„<ph name="DOT"/>” występuje w niewłaściwym miejscu w „<ph name="INVALIDDOMAIN"/>”.</translation> <translation id="2674318244760992338">stopka</translation> <translation id="8987927404178983737">Miesiąc</translation> <translation id="8115662671911883373">zacznij pokazywać napisy</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">zaznacz</translation> <translation id="2846343701378493991">1024 (średni poziom)</translation> <translation id="1637811476055996098">Wybierz pliki</translation> +<translation id="49969490063480558">Podaj część po znaku „<ph name="ATSIGN"/>”. Adres „<ph name="INVALIDADDRESS"/>” jest niepełny.</translation> <translation id="5476505524087279545">odznacz</translation> <translation id="2148716181193084225">Dzisiaj</translation> <translation id="2507943997699731163">Wypełnij to pole.</translation> <translation id="3785482301506746191">pasek czasu odtwarzania filmu</translation> <translation id="739024184232394898">Inny...</translation> +<translation id="383465348367842624">Część przed znakiem „<ph name="ATSIGN"/>” nie może zawierać symbolu „<ph name="INVALIDCHARACTER"/>”.</translation> <translation id="5468998798572797635">zamknij pełny ekran</translation> <translation id="5919473608089529604">Nie można załadować wtyczki.</translation> <translation id="5546461542133609677">wyłącz wyciszenie</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Podaj listę adresów e-mail rozdzielonych przecinkami.</translation> <translation id="5939518447894949180">Resetuj</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Podaj prawidłową wartość. Najbliższa prawidłowa wartość to <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Nieprawidłowa wartość.</translation> <translation id="1842960171412779397">wybierz</translation> <translation id="7673697353781729403">Godziny</translation> +<translation id="4664250907885839816">Część po znaku „<ph name="ATSIGN"/>” nie może zawierać symbolu „<ph name="INVALIDCHARACTER"/>”.</translation> <translation id="3450233048674729344">Wartość nie może być większa niż <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">30 sekund do tyłu</translation> <translation id="668171684555832681">Inny...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">aktywuj</translation> <translation id="8444882422881193423">Liczba plików: <ph name="NUMBER_OF_FILES"/></translation> <translation id="6643016212128521049">Wyczyść</translation> +<translation id="7888071071722539607">Uwzględnij znak „<ph name="ATSIGN"/>” w adresie e-mail. W adresie „<ph name="INVALIDADDRESS"/>” brakuje znaku „<ph name="ATSIGN"/>”.</translation> <translation id="4851297395436456855">przewiń do przodu</translation> <translation id="1088086359088493902">Sekundy</translation> <translation id="3934680773876859118">Nie można wczytać dokumentu PDF</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_pt-BR.xtb b/chromium/webkit/glue/resources/webkit_strings_pt-BR.xtb index f0ad9231b3b..adfbf684fda 100644 --- a/chromium/webkit/glue/resources/webkit_strings_pt-BR.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_pt-BR.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Outras...</translation> <translation id="2426432199384958866">retornar filme em fluxo contínuo para tempo real</translation> <translation id="248395913932153421">Dia</translation> +<translation id="1729654308190250600">Insira um endereço de e-mail que não esteja vazio.</translation> <translation id="6015796118275082299">Ano</translation> <translation id="9186171386827445984">Carregando documento: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> páginas...</translation> <translation id="1235745349614807883">Limpar pesquisas recentes</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">marcador de lista</translation> <translation id="4202807286478387388">pular</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Insira uma parte seguida por "<ph name="ATSIGN"/>". "<ph name="INVALIDADDRESS"/>" está incompleto.</translation> +<translation id="2746543609216772311">O valor deve ser <ph name="MINIMUM_DATE_OR_TIME"/> ou posterior.</translation> <translation id="2572483411312390101">reproduzir</translation> <translation id="8785498733064193001">iniciar reprodução</translation> <translation id="7057186640035488495">tempo de filme</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">retroceder rapidamente</translation> <translation id="7789962463072032349">pausar</translation> <translation id="6853785296079745596">ocultar legendas ocultas</translation> +<translation id="4360991593054037559">Insira um valor válido. Os dois valores válidos mais próximos são <ph name="VALID_VALUE_LOW"/> e <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Outras...</translation> <translation id="8141602879876242471">Este é um índice pesquisável. Insira palavras-chave de pesquisa:</translation> <translation id="1930711995431081526">status</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">avançar rapidamente</translation> <translation id="4812940957355064477">Insira um número.</translation> <translation id="2548326553472216322">Nenhuma pesquisa recente</translation> +<translation id="1938124657309484470">O valor deve ser <ph name="MAXIMUM_DATE_OR_TIME"/> ou anterior.</translation> <translation id="7263440858009898357">Selecione um item da lista.</translation> <translation id="901493112792887934">tempo atual em segundos</translation> <translation id="5164977714490026579">O valor deve ser maior ou igual a <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Esta semana</translation> <translation id="5966707198760109579">Semana</translation> <translation id="2901282870647571346">status atual do filme</translation> +<translation id="2060505056492490888">"<ph name="DOT"/>" está sendo usado em uma posição incorreta em "<ph name="INVALIDDOMAIN"/>".</translation> <translation id="2674318244760992338">rodapé</translation> <translation id="8987927404178983737">Mês</translation> <translation id="8115662671911883373">começar a exibir legendas ocultas</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">marcar</translation> <translation id="2846343701378493991">1024 (Nível médio)</translation> <translation id="1637811476055996098">Escolher arquivos</translation> +<translation id="49969490063480558">Insira uma parte depois de "<ph name="ATSIGN"/>". "<ph name="INVALIDADDRESS"/>" está incompleto.</translation> <translation id="5476505524087279545">desmarcar</translation> <translation id="2148716181193084225">Hoje</translation> <translation id="2507943997699731163">Preencha este campo.</translation> <translation id="3785482301506746191">barra de progressão do filme</translation> <translation id="739024184232394898">Outras...</translation> +<translation id="383465348367842624">Uma parte seguida por "<ph name="ATSIGN"/>" não deve conter o símbolo "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="5468998798572797635">sair do modo tela cheia</translation> <translation id="5919473608089529604">Não foi possível carregar o plug-in.</translation> <translation id="5546461542133609677">ativar som</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Insira uma lista de endereços de e-mail separados por vírgula.</translation> <translation id="5939518447894949180">Redefinir</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Insira um valor válido. O valor válido mais próximo é <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Valor inválido.</translation> <translation id="1842960171412779397">selecione</translation> <translation id="7673697353781729403">Horas</translation> +<translation id="4664250907885839816">A parte depois de "<ph name="ATSIGN"/>" não deve conter o símbolo "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="3450233048674729344">O valor deve ser menor ou igual a <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">voltar 30 segundos</translation> <translation id="668171684555832681">Outro...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">ativar</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> arquivos</translation> <translation id="6643016212128521049">Limpar</translation> +<translation id="7888071071722539607">Inclua um "<ph name="ATSIGN"/>" no endereço de e-mail. "<ph name="INVALIDADDRESS"/>" está com um "<ph name="ATSIGN"/>" faltando.</translation> <translation id="4851297395436456855">avanço rápido</translation> <translation id="1088086359088493902">Segundos</translation> <translation id="3934680773876859118">Falha ao carregar o documento PDF</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_pt-PT.xtb b/chromium/webkit/glue/resources/webkit_strings_pt-PT.xtb index fdf55585ee2..33c711b9aa8 100644 --- a/chromium/webkit/glue/resources/webkit_strings_pt-PT.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_pt-PT.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Outra...</translation> <translation id="2426432199384958866">fazer regressar a transmissão do filme para tempo real</translation> <translation id="248395913932153421">Dia</translation> +<translation id="1729654308190250600">Introduza um endereço de email que não esteja vazio.</translation> <translation id="6015796118275082299">Ano</translation> <translation id="9186171386827445984">A carregar o documento: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> páginas...</translation> <translation id="1235745349614807883">Limpar pesquisas recentes</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">marcador de lista</translation> <translation id="4202807286478387388">ir para</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Introduza uma parte seguida de "<ph name="ATSIGN"/>". "<ph name="INVALIDADDRESS"/>" está incompleto.</translation> +<translation id="2746543609216772311">O valor tem de ser <ph name="MINIMUM_DATE_OR_TIME"/> ou posterior.</translation> <translation id="2572483411312390101">reproduzir</translation> <translation id="8785498733064193001">iniciar reprodução</translation> <translation id="7057186640035488495">tempo do filme</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">recuar rapidamente</translation> <translation id="7789962463072032349">pausa</translation> <translation id="6853785296079745596">esconder legendas ocultas</translation> +<translation id="4360991593054037559">Introduza um valor válido. Os dois valores válidos mais próximos são <ph name="VALID_VALUE_LOW"/> e <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Outra...</translation> <translation id="8141602879876242471">Este índice é pesquisável. Introduza palavras-chave de pesquisa:</translation> <translation id="1930711995431081526">estado</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">avançar rapidamente</translation> <translation id="4812940957355064477">Introduza um número.</translation> <translation id="2548326553472216322">Nenhuma pesquisa recente</translation> +<translation id="1938124657309484470">O valor tem de ser <ph name="MAXIMUM_DATE_OR_TIME"/> ou anterior.</translation> <translation id="7263440858009898357">Seleccione um item na lista.</translation> <translation id="901493112792887934">tempo atual em segundos</translation> <translation id="5164977714490026579">O valor tem de ser superior ou igual a <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Esta semana</translation> <translation id="5966707198760109579">Semana</translation> <translation id="2901282870647571346">estado atual do filme</translation> +<translation id="2060505056492490888">"<ph name="DOT"/>" está a ser utilizado numa posição errada em "<ph name="INVALIDDOMAIN"/>".</translation> <translation id="2674318244760992338">rodapé</translation> <translation id="8987927404178983737">Mês</translation> <translation id="8115662671911883373">apresentar legendas ocultas</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">verificar</translation> <translation id="2846343701378493991">1024 (Tamanho médio)</translation> <translation id="1637811476055996098">Escolher Ficheiros</translation> +<translation id="49969490063480558">Introduza uma parte a seguir a "<ph name="ATSIGN"/>". "<ph name="INVALIDADDRESS"/>" está incompleto.</translation> <translation id="5476505524087279545">desmarcar</translation> <translation id="2148716181193084225">Hoje</translation> <translation id="2507943997699731163">Preencha este campo.</translation> <translation id="3785482301506746191">scrubber do tempo do filme</translation> <translation id="739024184232394898">Outra...</translation> +<translation id="383465348367842624">Uma parte seguida de "<ph name="ATSIGN"/>" não deve conter o símbolo "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="5468998798572797635">sair do modo de ecrã inteiro</translation> <translation id="5919473608089529604">Não foi possível carregar o plug-in.</translation> <translation id="5546461542133609677">reativar som</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Introduza uma lista de endereços de e-mail separados por vírgula.</translation> <translation id="5939518447894949180">Repor</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Introduza um valor válido. O valor válido mais próximo é <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Valor inválido.</translation> <translation id="1842960171412779397">seleccionar</translation> <translation id="7673697353781729403">Horas</translation> +<translation id="4664250907885839816">Uma parte a seguir a "<ph name="ATSIGN"/>" não deve conter o símbolo "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="3450233048674729344">O valor tem de ser inferior ou igual a <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">recuar 30 segundos</translation> <translation id="668171684555832681">Outros...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">activar</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> ficheiros</translation> <translation id="6643016212128521049">Limpar</translation> +<translation id="7888071071722539607">Inclua um "<ph name="ATSIGN"/>" no endereço de email. Falta um "<ph name="ATSIGN"/>" em "<ph name="INVALIDADDRESS"/>".</translation> <translation id="4851297395436456855">avanço rápido</translation> <translation id="1088086359088493902">Segundos</translation> <translation id="3934680773876859118">Falha ao carregar o documento em PDF</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_ro.xtb b/chromium/webkit/glue/resources/webkit_strings_ro.xtb index 7558d19ee2f..32fda27e1ee 100644 --- a/chromium/webkit/glue/resources/webkit_strings_ro.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_ro.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Altele...</translation> <translation id="2426432199384958866">reveniți la redarea în timp real a filmului transmis în flux</translation> <translation id="248395913932153421">Zi</translation> +<translation id="1729654308190250600">Introduceți o adresă de e-mail concretă.</translation> <translation id="6015796118275082299">An</translation> <translation id="9186171386827445984">Se încarcă documentul: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> (de) pagini...</translation> <translation id="1235745349614807883">Ștergeți căutările recente</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">marcator listă</translation> <translation id="4202807286478387388">Salt</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Introduceți o valoare urmată de semnul „<ph name="ATSIGN"/>”. Adresa „<ph name="INVALIDADDRESS"/>” nu este completă.</translation> +<translation id="2746543609216772311">Valoarea pentru dată/oră trebuie să fie <ph name="MINIMUM_DATE_OR_TIME"/> sau una ulterioară.</translation> <translation id="2572483411312390101">redați</translation> <translation id="8785498733064193001">începeți redarea</translation> <translation id="7057186640035488495">durată film</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">derulați rapid înapoi</translation> <translation id="7789962463072032349">pauză</translation> <translation id="6853785296079745596">ascundeți subtitrările</translation> +<translation id="4360991593054037559">Introduceți o valoare validă. Cele mai apropiate valori valide sunt <ph name="VALID_VALUE_LOW"/> și <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Altele...</translation> <translation id="8141602879876242471">Acesta este un index în care se poate căuta. Introduceți cuvintele cheie pentru căutare:</translation> <translation id="1930711995431081526">stare</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">derulați rapid înainte</translation> <translation id="4812940957355064477">Introduceți un număr.</translation> <translation id="2548326553472216322">Nicio căutare recentă</translation> +<translation id="1938124657309484470">Valoarea pentru dată/oră trebuie să fie <ph name="MAXIMUM_DATE_OR_TIME"/> sau una anterioară.</translation> <translation id="7263440858009898357">Selectați un articol din listă.</translation> <translation id="901493112792887934">timp actual în secunde</translation> <translation id="5164977714490026579">Valoarea trebuie să fie mai mare sau egală cu <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Săptămâna aceasta</translation> <translation id="5966707198760109579">Săptămână</translation> <translation id="2901282870647571346">starea actuală a filmului</translation> +<translation id="2060505056492490888">Semnul „<ph name="DOT"/>” apare poziționat greșit în „<ph name="INVALIDDOMAIN"/>”.</translation> <translation id="2674318244760992338">notă de subsol</translation> <translation id="8987927404178983737">Lună</translation> <translation id="8115662671911883373">începeți să afișați subtitrările</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">Bifați</translation> <translation id="2846343701378493991">1024 (Grad mediu)</translation> <translation id="1637811476055996098">Alegeți fișierele</translation> +<translation id="49969490063480558">Introduceți o valoare după semnul „<ph name="ATSIGN"/>”. Adresa „<ph name="INVALIDADDRESS"/>” nu este completă.</translation> <translation id="5476505524087279545">Debifați</translation> <translation id="2148716181193084225">Astăzi</translation> <translation id="2507943997699731163">Completați acest câmp.</translation> <translation id="3785482301506746191">glisor redare film</translation> <translation id="739024184232394898">Altele...</translation> +<translation id="383465348367842624">Valoarea urmată de semnul „<ph name="ATSIGN"/>” nu trebuie să conțină simbolul „<ph name="INVALIDCHARACTER"/>”.</translation> <translation id="5468998798572797635">ieșiți din ecranul complet</translation> <translation id="5919473608089529604">Nu s-a putut încărca pluginul.</translation> <translation id="5546461542133609677">activați sunetul</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Introduceți o listă de adrese de e-mail separate prin virgulă.</translation> <translation id="5939518447894949180">Resetați</translation> <translation id="1921819250265091946">zz</translation> +<translation id="2613802280814924224">Introduceți o valoare validă. Cea mai apropiată valoare validă este <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Valoare nevalidă.</translation> <translation id="1842960171412779397">Selectați</translation> <translation id="7673697353781729403">Ore</translation> +<translation id="4664250907885839816">Valoarea care urmează după semnul „<ph name="ATSIGN"/>” nu trebuie să conțină simbolul „<ph name="INVALIDCHARACTER"/>”.</translation> <translation id="3450233048674729344">Valoarea trebuie să fie mai mică sau egală cu <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">înapoi cu 30 de secunde</translation> <translation id="668171684555832681">Altul...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">Activați</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> fișiere</translation> <translation id="6643016212128521049">Ștergeți</translation> +<translation id="7888071071722539607">Includeți semnul „<ph name="ATSIGN"/>” în adresa de e-mail. Din adresa „<ph name="INVALIDADDRESS"/>” lipsește semnul „<ph name="ATSIGN"/>”.</translation> <translation id="4851297395436456855">rapid înainte</translation> <translation id="1088086359088493902">Secunde</translation> <translation id="3934680773876859118">Încărcarea documentului PDF nu a reușit</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_ru.xtb b/chromium/webkit/glue/resources/webkit_strings_ru.xtb index 43f80d90e0c..8b2e4e7dd4a 100644 --- a/chromium/webkit/glue/resources/webkit_strings_ru.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_ru.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Другое…</translation> <translation id="2426432199384958866">передача потокового видео в реальном времени</translation> <translation id="248395913932153421">День</translation> +<translation id="1729654308190250600">Введите адрес электронной почты.</translation> <translation id="6015796118275082299">Год</translation> <translation id="9186171386827445984">Загрузка документа: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> стр.</translation> <translation id="1235745349614807883">Очистить недавние поиски</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">маркер списка</translation> <translation id="4202807286478387388">перейти</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Введите часть адреса до символа "<ph name="ATSIGN"/>". Адрес "<ph name="INVALIDADDRESS"/>" неполный.</translation> +<translation id="2746543609216772311">Минимальное значение должно быть <ph name="MINIMUM_DATE_OR_TIME"/>.</translation> <translation id="2572483411312390101">воспроизведение</translation> <translation id="8785498733064193001">начать воспроизведение</translation> <translation id="7057186640035488495">продолжительность ролика</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">перемотка назад</translation> <translation id="7789962463072032349">Пауза</translation> <translation id="6853785296079745596">скрыть субтитры</translation> +<translation id="4360991593054037559">Введите допустимое значение. Ближайшие допустимые значения: <ph name="VALID_VALUE_LOW"/> и <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Другое…</translation> <translation id="8141602879876242471">Это индекс с возможностью поиска. Введите ключевые слова для поиска:</translation> <translation id="1930711995431081526">статус</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">перемотка вперед</translation> <translation id="4812940957355064477">Введите число.</translation> <translation id="2548326553472216322">Нет недавних поисков</translation> +<translation id="1938124657309484470">Максимальное значение должно быть <ph name="MAXIMUM_DATE_OR_TIME"/>.</translation> <translation id="7263440858009898357">Выберите один из пунктов списка.</translation> <translation id="901493112792887934">текущее время в секундах</translation> <translation id="5164977714490026579">Значение должно быть больше или равно <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">На этой неделе</translation> <translation id="5966707198760109579">Неделя</translation> <translation id="2901282870647571346">текущий статус ролика</translation> +<translation id="2060505056492490888">Недопустимое положение символа "<ph name="DOT"/>" в адресе "<ph name="INVALIDDOMAIN"/>".</translation> <translation id="2674318244760992338">нижний колонтитул</translation> <translation id="8987927404178983737">Месяц</translation> <translation id="8115662671911883373">показать субтитры</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">поставить галочку</translation> <translation id="2846343701378493991">1024 (Средний размер)</translation> <translation id="1637811476055996098">Выбрать файлы</translation> +<translation id="49969490063480558">Введите часть адреса после символа "<ph name="ATSIGN"/>". Адрес "<ph name="INVALIDADDRESS"/>" неполный.</translation> <translation id="5476505524087279545">снять галочку</translation> <translation id="2148716181193084225">Сегодня</translation> <translation id="2507943997699731163">Заполните это поле.</translation> <translation id="3785482301506746191">полоса прокрутки</translation> <translation id="739024184232394898">Другое…</translation> +<translation id="383465348367842624">Часть адреса до символа "<ph name="ATSIGN"/>" не должна содержать символ "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="5468998798572797635">выход из полноэкранного режима</translation> <translation id="5919473608089529604">Не удалось загрузить плагин.</translation> <translation id="5546461542133609677">включение звука</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Введите адреса электронной почты через запятую.</translation> <translation id="5939518447894949180">Сбросить</translation> <translation id="1921819250265091946">дд</translation> +<translation id="2613802280814924224">Введите допустимое значение. Ближайшее допустимое значение: <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Недопустимые данные.</translation> <translation id="1842960171412779397">выбрать</translation> <translation id="7673697353781729403">Часы</translation> +<translation id="4664250907885839816">Часть адреса после символа "<ph name="ATSIGN"/>" не должна содержать символ "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="3450233048674729344">Значение должно быть меньше или равно <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">назад на 30 секунд</translation> <translation id="668171684555832681">Другой...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">активировать</translation> <translation id="8444882422881193423">Число файлов: <ph name="NUMBER_OF_FILES"/></translation> <translation id="6643016212128521049">Очистить</translation> +<translation id="7888071071722539607">Адрес электронной почты должен содержать символ "<ph name="ATSIGN"/>". В адресе "<ph name="INVALIDADDRESS"/>" отсутствует символ "<ph name="ATSIGN"/>".</translation> <translation id="4851297395436456855">перемотка вперед</translation> <translation id="1088086359088493902">Секунды</translation> <translation id="3934680773876859118">Не удалось загрузить документ PDF</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_sk.xtb b/chromium/webkit/glue/resources/webkit_strings_sk.xtb index 1cb430682c8..27a2ad132b0 100644 --- a/chromium/webkit/glue/resources/webkit_strings_sk.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_sk.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Iné...</translation> <translation id="2426432199384958866">vrátiť sa k prehrávaniu v reálnom čase</translation> <translation id="248395913932153421">Deň</translation> +<translation id="1729654308190250600">Zadajte e-mailovú adresu, ktorá nie je prázdna hodnota.</translation> <translation id="6015796118275082299">Rok</translation> <translation id="9186171386827445984">Prebieha načítavanie dokumentu: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> stránok...</translation> <translation id="1235745349614807883">Vyčistiť posledné vyhľadávania</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">ukazovateľ v zozname</translation> <translation id="4202807286478387388">skok</translation> <translation id="4611115858363067980"><ph name="FILENAME"/> <ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Zadajte časť pred znakom <ph name="ATSIGN"/>. Adresa <ph name="INVALIDADDRESS"/> je neúplná.</translation> +<translation id="2746543609216772311">Hodnota musí byť <ph name="MINIMUM_DATE_OR_TIME"/> alebo neskôr.</translation> <translation id="2572483411312390101">prehrať</translation> <translation id="8785498733064193001">začať prehrávanie</translation> <translation id="7057186640035488495">čas filmu</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">rýchlo pretáčať dozadu</translation> <translation id="7789962463072032349">pozastaviť</translation> <translation id="6853785296079745596">skryť skryté titulky</translation> +<translation id="4360991593054037559">Zadajte platnú hodnotu. Najbližšie platné hodnoty sú <ph name="VALID_VALUE_LOW"/> a <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Iné...</translation> <translation id="8141602879876242471">Tento index sa dá prehľadávať. Zadajte kľúčové slová na vyhľadanie:</translation> <translation id="1930711995431081526">stav</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">rýchlo pretáčať dopredu</translation> <translation id="4812940957355064477">Zadajte číslo.</translation> <translation id="2548326553472216322">Žiadne posledné vyhľadávania</translation> +<translation id="1938124657309484470">Hodnota musí byť <ph name="MAXIMUM_DATE_OR_TIME"/> alebo skôr.</translation> <translation id="7263440858009898357">Vyberte položku zo zoznamu.</translation> <translation id="901493112792887934">aktuálny čas v sekundách</translation> <translation id="5164977714490026579">Hodnota musí byť väčšia alebo rovná hodnote <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Tento týždeň</translation> <translation id="5966707198760109579">Týždeň</translation> <translation id="2901282870647571346">aktuálny stav filmu</translation> +<translation id="2060505056492490888">Znak <ph name="DOT"/> je v doméne <ph name="INVALIDDOMAIN"/> použitý na nesprávnej pozícii.</translation> <translation id="2674318244760992338">päta</translation> <translation id="8987927404178983737">Mesiac</translation> <translation id="8115662671911883373">zobrazovať skryté titulky</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">označiť</translation> <translation id="2846343701378493991">1024 (stredný stupeň)</translation> <translation id="1637811476055996098">Vybrať súbory</translation> +<translation id="49969490063480558">Zadajte časť za znakom <ph name="ATSIGN"/>. Adresa <ph name="INVALIDADDRESS"/> je neúplná.</translation> <translation id="5476505524087279545">zrušiť označenie</translation> <translation id="2148716181193084225">Dnes</translation> <translation id="2507943997699731163">Vyplňte toto pole.</translation> <translation id="3785482301506746191">posúvač času filmu</translation> <translation id="739024184232394898">Iné...</translation> +<translation id="383465348367842624">Časť pred znakom <ph name="ATSIGN"/> by nemala obsahovať symbol <ph name="INVALIDCHARACTER"/>.</translation> <translation id="5468998798572797635">ukončiť režim celej obrazovky</translation> <translation id="5919473608089529604">Doplnok sa nepodarilo načítať.</translation> <translation id="5546461542133609677">obnoviť zvuk</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Zadajte zoznam e-mailových adries oddelených čiarkou.</translation> <translation id="5939518447894949180">Vynulovať</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Zadajte platnú hodnotu. Najbližšia platná hodnota je <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Neplatná hodnota.</translation> <translation id="1842960171412779397">vybrať</translation> <translation id="7673697353781729403">Hodiny</translation> +<translation id="4664250907885839816">Časť za znakom <ph name="ATSIGN"/> by nemala obsahovať symbol <ph name="INVALIDCHARACTER"/>.</translation> <translation id="3450233048674729344">Hodnota musí byť menšia alebo rovná hodnote <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">pretočiť dozadu o 30 sekúnd</translation> <translation id="668171684555832681">Iný...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">aktivovať</translation> <translation id="8444882422881193423">Počet súborov: <ph name="NUMBER_OF_FILES"/></translation> <translation id="6643016212128521049">Vymazať</translation> +<translation id="7888071071722539607">Uveďte v e-mailovej adrese znak <ph name="ATSIGN"/>. V adrese <ph name="INVALIDADDRESS"/> znak <ph name="ATSIGN"/> chýba.</translation> <translation id="4851297395436456855">pretočiť dopredu</translation> <translation id="1088086359088493902">Sekundy</translation> <translation id="3934680773876859118">Načítanie dokumentu PDF zlyhalo</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_sl.xtb b/chromium/webkit/glue/resources/webkit_strings_sl.xtb index 0ebd8458c33..c803967cc0a 100644 --- a/chromium/webkit/glue/resources/webkit_strings_sl.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_sl.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Drugo ...</translation> <translation id="2426432199384958866">vrnitev predvajanja filma iz pretakanja nazaj na dejanski čas</translation> <translation id="248395913932153421">Dan</translation> +<translation id="1729654308190250600">Vnesite e-poštni naslov (polje ne sme biti prazno).</translation> <translation id="6015796118275082299">Leto</translation> <translation id="9186171386827445984">Nalaganje dokumenta: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> strani ...</translation> <translation id="1235745349614807883">Počisti zadnja iskanja</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">označevalnik seznama</translation> <translation id="4202807286478387388">skoči</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Vnesite nekaj in nato <ph name="ATSIGN"/>. Naslov »<ph name="INVALIDADDRESS"/>« je nepopoln.</translation> +<translation id="2746543609216772311">Vrednost mora biti <ph name="MINIMUM_DATE_OR_TIME"/> ali pozneje.</translation> <translation id="2572483411312390101">predvajanje</translation> <translation id="8785498733064193001">začetek predvajanja</translation> <translation id="7057186640035488495">čas filma</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">hitro iskanje nazaj</translation> <translation id="7789962463072032349">premor</translation> <translation id="6853785296079745596">skrivanje podnapisov</translation> +<translation id="4360991593054037559">Vnesite veljavno vrednost. Najbližji veljavni vrednosti sta <ph name="VALID_VALUE_LOW"/> in <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Drugo ...</translation> <translation id="8141602879876242471">To je kazalo, ki omogoča iskanje. Vnesite ključne besede za iskanje:</translation> <translation id="1930711995431081526">stanje</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">hitro iskanje naprej</translation> <translation id="4812940957355064477">Vnesite številko.</translation> <translation id="2548326553472216322">Ni zadnjih iskanj</translation> +<translation id="1938124657309484470">Vrednost mora biti <ph name="MAXIMUM_DATE_OR_TIME"/> ali prej.</translation> <translation id="7263440858009898357">Izberite element s seznama.</translation> <translation id="901493112792887934">trenutni čas v sekundah</translation> <translation id="5164977714490026579">Vrednost mora biti večja od <ph name="MINIMUM"/> ali enaka.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Ta teden</translation> <translation id="5966707198760109579">Teden</translation> <translation id="2901282870647571346">trenutno stanje filma</translation> +<translation id="2060505056492490888">»<ph name="DOT"/>« je na napačnem mestu v »<ph name="INVALIDDOMAIN"/>«.</translation> <translation id="2674318244760992338">noga</translation> <translation id="8987927404178983737">Mesec</translation> <translation id="8115662671911883373">začetek predvajanja podnapisov</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">potrdi</translation> <translation id="2846343701378493991">1024 (srednja stopnja)</translation> <translation id="1637811476055996098">Izberi datoteke</translation> +<translation id="49969490063480558">Vnesite nekaj po znaku »<ph name="ATSIGN"/>«. Naslov »<ph name="INVALIDADDRESS"/>« je nepopoln.</translation> <translation id="5476505524087279545">počisti izbor</translation> <translation id="2148716181193084225">Danes</translation> <translation id="2507943997699731163">Izpolnite to polje</translation> <translation id="3785482301506746191">časovni krmilnik za predvajanje filma</translation> <translation id="739024184232394898">Drugo ...</translation> +<translation id="383465348367842624">Del pred »<ph name="ATSIGN"/>« ne sme vsebovati znaka »<ph name="INVALIDCHARACTER"/>«.</translation> <translation id="5468998798572797635">izhod iz celozaslonskega načina</translation> <translation id="5919473608089529604">Vtičnika ni bilo mogoče naložiti.</translation> <translation id="5546461542133609677">vklop zvoka</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Vnesite seznam e-poštnih naslovov, ločenih z vejicami</translation> <translation id="5939518447894949180">Ponastavi</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Vnesite veljavno vrednost. Najbližja veljavna vrednost je <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Neveljavna vrednost.</translation> <translation id="1842960171412779397">izberi</translation> <translation id="7673697353781729403">Ure</translation> +<translation id="4664250907885839816">Del po »<ph name="ATSIGN"/>« ne sme vsebovati znaka »<ph name="INVALIDCHARACTER"/>«.</translation> <translation id="3450233048674729344">Vrednost mora biti manjša od <ph name="MAXIMUM"/> ali enaka.</translation> <translation id="3471999216963526757">30 sekund nazaj</translation> <translation id="668171684555832681">Drugo ...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">aktiviraj</translation> <translation id="8444882422881193423">Število datotek: <ph name="NUMBER_OF_FILES"/></translation> <translation id="6643016212128521049">Počisti</translation> +<translation id="7888071071722539607">V e-poštnem naslovu mora biti znak »<ph name="ATSIGN"/>«. V naslovu »<ph name="INVALIDADDRESS"/>« manjka »<ph name="ATSIGN"/>«.</translation> <translation id="4851297395436456855">previjanje naprej</translation> <translation id="1088086359088493902">Sekunde</translation> <translation id="3934680773876859118">Dokumenta PDF ni bilo mogoče naložiti</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_sr.xtb b/chromium/webkit/glue/resources/webkit_strings_sr.xtb index 6dfe359d3bc..02420a9089b 100644 --- a/chromium/webkit/glue/resources/webkit_strings_sr.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_sr.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Друго...</translation> <translation id="2426432199384958866">вратите филм који се стримује у реално време</translation> <translation id="248395913932153421">Дан</translation> +<translation id="1729654308190250600">Унесите адресу е-поште која није празна.</translation> <translation id="6015796118275082299">Година</translation> <translation id="9186171386827445984">Учитавање документа: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> странице(а)...</translation> <translation id="1235745349614807883">Обриши недавне претраге</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">означивач листе</translation> <translation id="4202807286478387388">прескочи</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Унесите неки део пре „<ph name="ATSIGN"/>“. Адреса „<ph name="INVALIDADDRESS"/>“ је непотпуна.</translation> +<translation id="2746543609216772311">Вредност мора да буде <ph name="MINIMUM_DATE_OR_TIME"/> или новија.</translation> <translation id="2572483411312390101">пустите</translation> <translation id="8785498733064193001">започните репродукцију</translation> <translation id="7057186640035488495">трајање филма</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">брзо премотајте уназад</translation> <translation id="7789962463072032349">паузирај</translation> <translation id="6853785296079745596">сакријте затворене натписе</translation> +<translation id="4360991593054037559">Унесите важећу вредност. Две најближе важеће вредности су <ph name="VALID_VALUE_LOW"/> и <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Друго...</translation> <translation id="8141602879876242471">Ово је индекс који може да се претражује. Унесите кључне речи за претрагу:</translation> <translation id="1930711995431081526">статус</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">брзо премотајте унапред</translation> <translation id="4812940957355064477">Унесите број.</translation> <translation id="2548326553472216322">Нема недавних претрага</translation> +<translation id="1938124657309484470">Вредност мора да буде <ph name="MAXIMUM_DATE_OR_TIME"/> или старија.</translation> <translation id="7263440858009898357">Изаберите ставку са листе.</translation> <translation id="901493112792887934">актуелно време у секундама</translation> <translation id="5164977714490026579">Вредност сме да буде најмање <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Ова недеља</translation> <translation id="5966707198760109579">Недеља</translation> <translation id="2901282870647571346">актуелни статус филма</translation> +<translation id="2060505056492490888">„<ph name="DOT"/>“ је стављено на погрешно место у „<ph name="INVALIDDOMAIN"/>“.</translation> <translation id="2674318244760992338">подножје</translation> <translation id="8987927404178983737">Месец</translation> <translation id="8115662671911883373">започните приказивање затворених натписа</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">изабери</translation> <translation id="2846343701378493991">1024 (средњи степен)</translation> <translation id="1637811476055996098">Избор датотека</translation> +<translation id="49969490063480558">Унесите неки део после „<ph name="ATSIGN"/>“. Адреса „<ph name="INVALIDADDRESS"/>“ је непотпуна.</translation> <translation id="5476505524087279545">опозови избор</translation> <translation id="2148716181193084225">Данас</translation> <translation id="2507943997699731163">Попуните ово поље.</translation> <translation id="3785482301506746191">клизач за трајање филма</translation> <translation id="739024184232394898">Друго...</translation> +<translation id="383465348367842624">Део пре „<ph name="ATSIGN"/>“ не треба да садржи симбол „<ph name="INVALIDCHARACTER"/>“.</translation> <translation id="5468998798572797635">изађите из режима целог екрана</translation> <translation id="5919473608089529604">Није могуће учитати додатну компоненту.</translation> <translation id="5546461542133609677">укључите звук</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Унесите листу адреса е-поште раздвојених зарезима.</translation> <translation id="5939518447894949180">Ресетуј</translation> <translation id="1921819250265091946">дд</translation> +<translation id="2613802280814924224">Унесите важећу вредност. Најближа важећа вредност је <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Неважећа вредност.</translation> <translation id="1842960171412779397">изабери</translation> <translation id="7673697353781729403">Сати</translation> +<translation id="4664250907885839816">Део после „<ph name="ATSIGN"/>“ не треба да садржи симбол „<ph name="INVALIDCHARACTER"/>“.</translation> <translation id="3450233048674729344">Вредност сме да буде највише <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">уназад 30 секунди</translation> <translation id="668171684555832681">Друго...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">активирај</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> датотеке(а)</translation> <translation id="6643016212128521049">Обриши</translation> +<translation id="7888071071722539607">Уврстите „<ph name="ATSIGN"/>“ у адресу е-поште. У адреси е-поште „<ph name="INVALIDADDRESS"/>“ недостаје „<ph name="ATSIGN"/>“.</translation> <translation id="4851297395436456855">премотајте унапред</translation> <translation id="1088086359088493902">Секунде</translation> <translation id="3934680773876859118">Учитавање PDF документа није успело</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_sv.xtb b/chromium/webkit/glue/resources/webkit_strings_sv.xtb index e2e0b30d5e3..2255450e152 100644 --- a/chromium/webkit/glue/resources/webkit_strings_sv.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_sv.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Annat ...</translation> <translation id="2426432199384958866">återställ direktuppspelad film till realtid</translation> <translation id="248395913932153421">Dag</translation> +<translation id="1729654308190250600">Ange en e-postadress som inte är tom.</translation> <translation id="6015796118275082299">År</translation> <translation id="9186171386827445984">Läser in dokument: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> sidor...</translation> <translation id="1235745349614807883">Rensa senaste sökningar</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">listmarkör</translation> <translation id="4202807286478387388">fortsätta</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Ange en del följt av <ph name="ATSIGN"/>. <ph name="INVALIDADDRESS"/> är ofullständig.</translation> +<translation id="2746543609216772311">Värdet måste vara <ph name="MINIMUM_DATE_OR_TIME"/> eller senare.</translation> <translation id="2572483411312390101">spela upp</translation> <translation id="8785498733064193001">starta uppspelning</translation> <translation id="7057186640035488495">filmtid</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">söka snabbt bakåt</translation> <translation id="7789962463072032349">paus</translation> <translation id="6853785296079745596">dölj textning</translation> +<translation id="4360991593054037559">Ange ett giltigt värde. De två närmaste giltiga värdena är <ph name="VALID_VALUE_LOW"/> och <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Annat ...</translation> <translation id="8141602879876242471">Det här är ett sökbart index. Skriv sökord:</translation> <translation id="1930711995431081526">status</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">söka snabbt framåt</translation> <translation id="4812940957355064477">Ange ett nummer.</translation> <translation id="2548326553472216322">Inga nya sökningar</translation> +<translation id="1938124657309484470">Värdet måste vara <ph name="MAXIMUM_DATE_OR_TIME"/> eller tidigare.</translation> <translation id="7263440858009898357">Välj ett alternativ i listan.</translation> <translation id="901493112792887934">aktuell tid i sekunder</translation> <translation id="5164977714490026579">Värdet måste vara större än eller lika med <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Den här veckan</translation> <translation id="5966707198760109579">Vecka</translation> <translation id="2901282870647571346">aktuell filmstatus</translation> +<translation id="2060505056492490888"><ph name="DOT"/> används på fel plats i <ph name="INVALIDDOMAIN"/>.</translation> <translation id="2674318244760992338">sidfot</translation> <translation id="8987927404178983737">Månad</translation> <translation id="8115662671911883373">börja visa textning</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">kryssa för</translation> <translation id="2846343701378493991">1024 (medel)</translation> <translation id="1637811476055996098">Välj filer</translation> +<translation id="49969490063480558">Ange en del följt av <ph name="ATSIGN"/>. <ph name="INVALIDADDRESS"/> är ofullständig.</translation> <translation id="5476505524087279545">kryssa av</translation> <translation id="2148716181193084225">Idag</translation> <translation id="2507943997699731163">Fyll i det här fältet.</translation> <translation id="3785482301506746191">filmtidsreglage</translation> <translation id="739024184232394898">Annat ...</translation> +<translation id="383465348367842624">En del följt av <ph name="ATSIGN"/> får inte innehålla symbolen <ph name="INVALIDCHARACTER"/>.</translation> <translation id="5468998798572797635">avsluta helskärmsläge</translation> <translation id="5919473608089529604">Det gick inte att läsa in plugin-programmet.</translation> <translation id="5546461542133609677">visa</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Ange en kommaavgränsad lista med e-postadresser.</translation> <translation id="5939518447894949180">Återställ</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Ange ett giltigt värde. Det närmast giltiga värdet är <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Ogiltigt värde.</translation> <translation id="1842960171412779397">välj</translation> <translation id="7673697353781729403">Timmar</translation> +<translation id="4664250907885839816">En del efter <ph name="ATSIGN"/> får inte innehålla symbolen <ph name="INVALIDCHARACTER"/>.</translation> <translation id="3450233048674729344">Värdet måste vara mindre än eller lika med <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">30 sekunder bakåt</translation> <translation id="668171684555832681">Annan...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">aktivera</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> filer</translation> <translation id="6643016212128521049">Rensa</translation> +<translation id="7888071071722539607">Inkludera ett <ph name="ATSIGN"/> i e-postadressen. <ph name="INVALIDADDRESS"/> saknar ett <ph name="ATSIGN"/>.</translation> <translation id="4851297395436456855">snabbspola framåt</translation> <translation id="1088086359088493902">Sekunder</translation> <translation id="3934680773876859118">Det gick inte att läsa in PDF-dokumentet</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_sw.xtb b/chromium/webkit/glue/resources/webkit_strings_sw.xtb index 55ddb064fdd..c098a342ff7 100644 --- a/chromium/webkit/glue/resources/webkit_strings_sw.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_sw.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Nyingine...</translation> <translation id="2426432199384958866">rejesha utiririshaji wa filamu inavyofanyika</translation> <translation id="248395913932153421">Siku</translation> +<translation id="1729654308190250600">Tafadhali ingiza anwani ya barua pepe ambayo sio tupu.</translation> <translation id="6015796118275082299">Mwaka</translation> <translation id="9186171386827445984">Inapakia hati: Kurasa <ph name="PAGE_NUMBER"/> / <ph name="NUMBER_OF_PAGES"/>...</translation> <translation id="1235745349614807883">Futa Utafutaji wa Hivi Karibuni</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">kialamishi orodha</translation> <translation id="4202807286478387388">ruka</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Tafadhali ingiza sehemu ikifuatiwa na '<ph name="ATSIGN"/>'. '<ph name="INVALIDADDRESS"/>' haijakamilika.</translation> +<translation id="2746543609216772311">Thamani lazima iwe <ph name="MINIMUM_DATE_OR_TIME"/> au baadaye.</translation> <translation id="2572483411312390101">cheza</translation> <translation id="8785498733064193001">anza kucheza</translation> <translation id="7057186640035488495">muda wa filamu</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">omba kurejea haraka</translation> <translation id="7789962463072032349">pumzisha</translation> <translation id="6853785296079745596">ficha manukuu yanayoweza kuonyeshwa</translation> +<translation id="4360991593054037559">Tafadhali ingiza thamani halali. Thamani mbili halali za karibu ni <ph name="VALID_VALUE_LOW"/> na <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Nyingine...</translation> <translation id="8141602879876242471">Hii ni fahirisi inayoweza kutafutwa. Weka maneno muhimu ya utafutaji.</translation> <translation id="1930711995431081526">hali</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">omba upelekaji mbele wa haraka</translation> <translation id="4812940957355064477">Tafadhali ingiza nambari.</translation> <translation id="2548326553472216322">Hakuna utafutaji wa hivi karibuni</translation> +<translation id="1938124657309484470">Thamani lazima iwe <ph name="MAXIMUM_DATE_OR_TIME"/> au mapema.</translation> <translation id="7263440858009898357">Tafadhali chagua kipengee katika orodha.</translation> <translation id="901493112792887934">muda wa sasa kwa sekunde</translation> <translation id="5164977714490026579">Lazima thamani iwe kubwa kuliko au sawa na <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Wiki hii</translation> <translation id="5966707198760109579">Juma</translation> <translation id="2901282870647571346">hali ya sasa ya filamu</translation> +<translation id="2060505056492490888">' <ph name="DOT"/> 'imetumika kwenye nafasi isiyostahili katika '<ph name="INVALIDDOMAIN"/>'.</translation> <translation id="2674318244760992338">kijachini</translation> <translation id="8987927404178983737">Mwezi</translation> <translation id="8115662671911883373">anza kuonyesha manukuu yaliyofungwa</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">chunguza</translation> <translation id="2846343701378493991">1024 (Gredi Wastani)</translation> <translation id="1637811476055996098">Chagua Faili</translation> +<translation id="49969490063480558">Tafadhali ingiza sehemu inayofuatia '<ph name="ATSIGN"/>'. '<ph name="INVALIDADDRESS"/>' haijakamilika.</translation> <translation id="5476505524087279545">toa tiki</translation> <translation id="2148716181193084225">Leo</translation> -<translation id="2507943997699731163">Tafadhali jaza uga huu.</translation> +<translation id="2507943997699731163">Tafadhali jaza sehemu hii.</translation> <translation id="3785482301506746191">kitelezi cha muda cha filamu</translation> <translation id="739024184232394898">Nyingine...</translation> +<translation id="383465348367842624">Sehemu inayofuatwa na '<ph name="ATSIGN"/>' haipaswi kuwa na alama ya '<ph name="INVALIDCHARACTER"/>'.</translation> <translation id="5468998798572797635">Ondoka kwenye Skrini nzima</translation> <translation id="5919473608089529604">Isingeweza kupakia programu jalizi.</translation> <translation id="5546461542133609677">rejesha sauti</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Tafadhali ingiza orodha iliyotenganishwa kwa koma ya anwani za barua pepe.</translation> <translation id="5939518447894949180">Weka upya</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Tafadhali ingiza thamani halali.Thamani halali ya karibu ni <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Thamani batili.</translation> <translation id="1842960171412779397">chagua</translation> <translation id="7673697353781729403">Saa</translation> +<translation id="4664250907885839816">Sehemu inayofuata '<ph name="ATSIGN"/>' haipaswi kuwa na alama ya '<ph name="INVALIDCHARACTER"/>'.</translation> <translation id="3450233048674729344">Lazima thamani iwe chache kuliko au sawa na <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">rejea baada ya sekunde 30</translation> <translation id="668171684555832681">Mengine...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">wezesha</translation> <translation id="8444882422881193423">faili <ph name="NUMBER_OF_FILES"/></translation> <translation id="6643016212128521049">Futa</translation> +<translation id="7888071071722539607">Tafadhali jumuisha '<ph name="ATSIGN"/>' katika anwani ya barua pepe. '<ph name="INVALIDADDRESS"/>' inakosa '<ph name="ATSIGN"/>'.</translation> <translation id="4851297395436456855">peleka mbele haraka</translation> <translation id="1088086359088493902">Sekunde</translation> <translation id="3934680773876859118">Imeshindwa kupakia hati ya PDF</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_ta.xtb b/chromium/webkit/glue/resources/webkit_strings_ta.xtb index 6abf383e90f..234b6f7cfe8 100644 --- a/chromium/webkit/glue/resources/webkit_strings_ta.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_ta.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">மற்றவை…</translation> <translation id="2426432199384958866">ஸ்ட்ரீமிங் மூவியை நிகழ்நேரத்திற்கு மீட்டமை</translation> <translation id="248395913932153421">நாள்</translation> +<translation id="1729654308190250600">காலி அல்லாத மின்னஞ்சல் முகவரியை உள்ளிடவும்.</translation> <translation id="6015796118275082299">ஆண்டு</translation> <translation id="9186171386827445984">ஆவணத்தை ஏற்றுகிறது: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> பக்கங்கள்...</translation> <translation id="1235745349614807883">சமீபத்திய தேடல்களை சுத்தமாக்கு</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">பட்டியல் குறிப்பான்</translation> <translation id="4202807286478387388">தாவு</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">'<ph name="ATSIGN"/>' ஐத் தொடர்ந்து ஒரு பகுதியை உள்ளிடவும். '<ph name="INVALIDADDRESS"/>' முழுமைப் பெறாமல் உள்ளது.</translation> +<translation id="2746543609216772311">மதிப்பானது <ph name="MINIMUM_DATE_OR_TIME"/> அல்லது அதற்குப் பின்பு இருக்க வேண்டும்.</translation> <translation id="2572483411312390101">இயக்கு</translation> <translation id="8785498733064193001">மறுஇயக்கத்தைத் தொடங்கு</translation> <translation id="7057186640035488495">மூவி நேரம்</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">விரைவாகப் பின்செல்</translation> <translation id="7789962463072032349">இடைநிறுத்து</translation> <translation id="6853785296079745596">மூடப்பட்ட தலைப்புகளை மறை</translation> +<translation id="4360991593054037559">சரியான மதிப்பை உள்ளிடவும். <ph name="VALID_VALUE_LOW"/> மற்றும் <ph name="VALID_VALUE_HIGHER"/> ஆகியவை மிக நெருக்கமான சரியான இரண்டு மதிப்புகளாகும்.</translation> <translation id="1758486001363313524">மற்றவை…</translation> <translation id="8141602879876242471">இது தேடக்கூடிய பொருளடக்கம். தேடல் சொற்களை உள்ளிடுக:</translation> <translation id="1930711995431081526">நிலை</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">விரைவாக முன்செல்</translation> <translation id="4812940957355064477">எண்ணை உள்ளிடுக.</translation> <translation id="2548326553472216322">சமீபத்திய தேடல்கள் எதுவுமில்லை</translation> +<translation id="1938124657309484470">மதிப்பு <ph name="MAXIMUM_DATE_OR_TIME"/> அல்லது அதற்கு முன்பு இருக்க வேண்டும்.</translation> <translation id="7263440858009898357">பட்டியலிலிருந்து ஒரு உருப்படியைத் தேர்ந்தெடுங்கள்.</translation> <translation id="901493112792887934">நடப்பு நேரம் வினாடிகளில்</translation> <translation id="5164977714490026579">மதிப்பானது, கண்டிப்பாக <ph name="MINIMUM"/> ஐ விட அதிகமாக அல்லது அதற்குச் சமமாக இருக்க வேண்டும்.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">இந்த வாரம்</translation> <translation id="5966707198760109579">வாரம்</translation> <translation id="2901282870647571346">மூவியின் நடப்பு நிலை</translation> +<translation id="2060505056492490888"><ph name="INVALIDDOMAIN"/> இல் தவறான இடத்தில் '<ph name="DOT"/>' பயன்படுத்தபட்டுள்ளது.</translation> <translation id="2674318244760992338">அடிக்குறிப்பு</translation> <translation id="8987927404178983737">மாதம்</translation> <translation id="8115662671911883373">மூடப்பட்ட தலைப்புகளைக் காட்டுவதைத் தொடங்கு</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">சரிபார்</translation> <translation id="2846343701378493991">1024 (இடைநிலைத் தரம்)</translation> <translation id="1637811476055996098">கோப்புகளைத் தேர்வுசெய்க</translation> +<translation id="49969490063480558">'<ph name="ATSIGN"/>' ஐத் தொடர்ந்து ஒரு பகுதியை உள்ளிடவும். '<ph name="INVALIDADDRESS"/>' முழுமைப்பெறாமல் உள்ளது.</translation> <translation id="5476505524087279545">தேர்வு நீக்கு</translation> <translation id="2148716181193084225">இன்று</translation> <translation id="2507943997699731163">இந்தப் புலத்தை நிரப்புக.</translation> <translation id="3785482301506746191">மூவி நேர ஸ்க்ரப்பர்</translation> <translation id="739024184232394898">மற்றவை…</translation> +<translation id="383465348367842624">'<ph name="ATSIGN"/>' ஐத் தொடர்ந்து வரும் பகுதியில் '<ph name="INVALIDCHARACTER"/>' சின்னம் இருக்கக்கூடாது.</translation> <translation id="5468998798572797635">முழுத்திரையிலிருந்து வெளியேறு</translation> <translation id="5919473608089529604">செருகுநிரல் ஏற்றப்படவில்லை.</translation> <translation id="5546461542133609677">ஒலி இயக்கு</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">காற்புள்ளியால் பிரிக்கப்பட்ட மின்னஞ்சல் முகவரிகளின் பட்டியலை உள்ளிடுக.</translation> <translation id="5939518447894949180">மீட்டமை</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">சரியான மதிப்பை உள்ளிடவும். <ph name="VALID_VALUE"/> என்பது நெருக்கமாக உள்ள சரியான மதிப்பாகும்.</translation> <translation id="835897206747267392">செல்லாத மதிப்பு.</translation> <translation id="1842960171412779397">தேர்ந்தெடு</translation> <translation id="7673697353781729403">மணிநேரம்</translation> +<translation id="4664250907885839816">'<ph name="ATSIGN"/>' ஐத் தொடரும் பகுதியில், '<ph name="INVALIDCHARACTER"/>' சின்னம் இருக்கக்கூடாது.</translation> <translation id="3450233048674729344">மதிப்பானது கண்டிப்பாக <ph name="MAXIMUM"/> ஐ விடக்குறைவாக அல்லது அதற்குச் சமமாக இருக்க வேண்டும்.</translation> <translation id="3471999216963526757">30 வினாடிகள் பின்செல்</translation> <translation id="668171684555832681">மற்றவை…</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">செயல்படுத்து</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> கோப்புகள்</translation> <translation id="6643016212128521049">அழி</translation> +<translation id="7888071071722539607">மின்னஞ்சல் முகவரியில் '<ph name="ATSIGN"/>' ஐச் சேர்க்கவும். '<ph name="ATSIGN"/>' இல் '<ph name="INVALIDADDRESS"/>' இல்லை.</translation> <translation id="4851297395436456855">வேகமாக முன்செல்</translation> <translation id="1088086359088493902">வினாடிகள்</translation> <translation id="3934680773876859118">PDF ஆவணத்தை ஏற்றுவது தோல்வியடைந்தது</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_te.xtb b/chromium/webkit/glue/resources/webkit_strings_te.xtb index 3abf1afd176..c0471dd17ef 100644 --- a/chromium/webkit/glue/resources/webkit_strings_te.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_te.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">ఇతర...</translation> <translation id="2426432199384958866">చలనచిత్రాన్ని నిజ సమయంలో ప్రసారం చేయడానికి తిరిగి వెళ్లు</translation> <translation id="248395913932153421">రోజు</translation> +<translation id="1729654308190250600">దయచేసి ఖాళీ-కాని ఇమెయిల్ చిరునామాని నమోదు చేయండి.</translation> <translation id="6015796118275082299">సంవత్సరం</translation> <translation id="9186171386827445984">పత్రాన్ని లోడ్ చేస్తోంది: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> పేజీలు...</translation> <translation id="1235745349614807883">ఇటీవల శోధనలను క్లియర్ చెయ్యి</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">జాబితా మార్కర్</translation> <translation id="4202807286478387388">వెళ్ళు</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">దయచేసి '<ph name="ATSIGN"/>'కి ముందు ఉన్న భాగాన్ని నమోదు చేయండి. '<ph name="INVALIDADDRESS"/>' అసంపూర్ణంగా ఉంది.</translation> +<translation id="2746543609216772311">విలువ తప్పనిసరిగా <ph name="MINIMUM_DATE_OR_TIME"/> లేదా అంతకంటే తదుపరిది అయి ఉండాలి.</translation> <translation id="2572483411312390101">ప్లే చేయి</translation> <translation id="8785498733064193001">ప్లేబ్యాక్ను ప్రారంభించు</translation> <translation id="7057186640035488495">చలనచిత్ర నిడివి</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">త్వరగా వెనుకకు వెళ్లు</translation> <translation id="7789962463072032349">నిలిపివేయి</translation> <translation id="6853785296079745596">సంవృత శీర్షికలను దాచు</translation> +<translation id="4360991593054037559">దయచేసి చెల్లుబాటు అయ్యే విలువను నమోదు చేయండి. <ph name="VALID_VALUE_LOW"/> మరియు <ph name="VALID_VALUE_HIGHER"/> అనేవి రెండు సమీప చెల్లుబాటు విలువలు.</translation> <translation id="1758486001363313524">ఇతర...</translation> <translation id="8141602879876242471">ఇది ఒక శోధించగల సూచిక. శోధన కీవర్డ్లను ఎంటర్ చెయ్యండి:</translation> <translation id="1930711995431081526">స్థితి</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">త్వరగా ముందుకు వెళ్లు</translation> <translation id="4812940957355064477">దయచేసి సంఖ్యను నమోదు చేయండి.</translation> <translation id="2548326553472216322">ఇటీవల శోధనలు లేవు</translation> +<translation id="1938124657309484470">విలువ తప్పనిసరిగా <ph name="MAXIMUM_DATE_OR_TIME"/> లేదా అంతకంటే మునుపటిది అయి ఉండాలి.</translation> <translation id="7263440858009898357">దయచేసి జాబితాలోని ఒక అంశాన్ని ఎంచుకోండి.</translation> <translation id="901493112792887934">సెకన్లలో ప్రస్తుత సమయం</translation> <translation id="5164977714490026579">విలువ ఖచ్చితంగా <ph name="MINIMUM"/> కంటే ఎక్కువగా లేదా సమానంగా ఉండాలి.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">ఈ వారం</translation> <translation id="5966707198760109579">వారం</translation> <translation id="2901282870647571346">ప్రస్తుతం చలనచిత్ర స్థితి</translation> +<translation id="2060505056492490888">'<ph name="INVALIDDOMAIN"/>'లో '<ph name="DOT"/>' తప్పు స్థానంలో ఉపయోగించబడింది.</translation> <translation id="2674318244760992338">ఫుటర్</translation> <translation id="8987927404178983737">నెల</translation> <translation id="8115662671911883373">సంవృత శీర్షికలను ప్రదర్శించడం ప్రారంభించు</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">తనిఖీ చెయ్యి</translation> <translation id="2846343701378493991">1024 (మధ్యస్థ గ్రేడ్)</translation> <translation id="1637811476055996098">ఫైల్లను ఎంచుకోండి</translation> +<translation id="49969490063480558">దయచేసి '<ph name="ATSIGN"/>'కి తర్వాత ఉన్న భాగాన్ని నమోదు చేయండి. '<ph name="INVALIDADDRESS"/>' అసంపూర్ణంగా ఉంది.</translation> <translation id="5476505524087279545">ఎంపిక చెయ్యబడలేదు</translation> <translation id="2148716181193084225">ఈ రోజు</translation> <translation id="2507943997699731163">దయచేసి ఈ ఫీల్డ్ని పూర్తి చెయ్యండి.</translation> <translation id="3785482301506746191">చలనచిత్ర సమయ స్క్రబ్బర్</translation> <translation id="739024184232394898">ఇతర...</translation> +<translation id="383465348367842624">'<ph name="ATSIGN"/>'కి ముందు ఉన్న భాగంలో '<ph name="INVALIDCHARACTER"/>' చిహ్నం ఉండకూడదు.</translation> <translation id="5468998798572797635">పూర్తి స్క్రీన్ నుండి నిష్క్రమించు</translation> <translation id="5919473608089529604">ప్లగిన్ని లోడ్ చేయడం సాధ్యం కాలేదు.</translation> <translation id="5546461542133609677">అన్మ్యూట్ చేయి</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">దయచేసి కామాతో వేరు చేసిన ఇమెయిల్ చిరునామాల జాబితాను ఎంటర్ చెయ్యండి.</translation> <translation id="5939518447894949180">తిరిగి అమర్చండి</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">దయచేసి చెల్లుబాటు అయ్యే విలువను నమోదు చేయండి. <ph name="VALID_VALUE"/> అనేది సమీప చెల్లుబాటు విలువ.</translation> <translation id="835897206747267392">చెల్లని విలువ.</translation> <translation id="1842960171412779397">ఎంచుకోండి</translation> <translation id="7673697353781729403">గంటలు</translation> +<translation id="4664250907885839816">'<ph name="ATSIGN"/>'కి తర్వాత ఉన్న భాగంలో '<ph name="INVALIDCHARACTER"/>' చిహ్నం ఉండకూడదు.</translation> <translation id="3450233048674729344">విలువ ఖచ్చితంగా <ph name="MAXIMUM"/> కంటే తగ్గువగా లేదా సమానంగా ఉండాలి.</translation> <translation id="3471999216963526757">30 సెకన్లు వెనుకకు</translation> <translation id="668171684555832681">ఇతర...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">ఆక్టివేట్ చెయ్యి</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> ఫైళ్ళు</translation> <translation id="6643016212128521049">క్లియర్ చేయి</translation> +<translation id="7888071071722539607">దయచేసి ఇమెయిల్ చిరునామాలో '<ph name="ATSIGN"/>'ని చేర్చండి. '<ph name="INVALIDADDRESS"/>'లో '<ph name="ATSIGN"/>' లేదు.</translation> <translation id="4851297395436456855">వేగంగా ముందుకు వెళ్లు</translation> <translation id="1088086359088493902">సెకన్లు</translation> <translation id="3934680773876859118">PDF పత్రాన్ని లోడ్ చెయ్యడానికి విఫలమైంది</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_th.xtb b/chromium/webkit/glue/resources/webkit_strings_th.xtb index 000eac11bc0..2b6651fdab1 100644 --- a/chromium/webkit/glue/resources/webkit_strings_th.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_th.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">อื่นๆ...</translation> <translation id="2426432199384958866">เปลี่ยนภาพยนตร์แบบสตรีมมิงกลับไปเป็นแบบเรียลไทม์</translation> <translation id="248395913932153421">วัน</translation> +<translation id="1729654308190250600">โปรดป้อนที่อยู่อีเมลที่ไม่ว่างเปล่า</translation> <translation id="6015796118275082299">ปี</translation> <translation id="9186171386827445984">กำลังโหลดเอกสาร: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> หน้า...</translation> <translation id="1235745349614807883">ลบการค้นหาล่าสุด</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">ผู้สร้างรายการ</translation> <translation id="4202807286478387388">ข้าม</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">โปรดป้อนส่วนหนึ่งโดยตามด้วย "<ph name="ATSIGN"/>" "<ph name="INVALIDADDRESS"/>" นั้นไม่สมบูรณ์</translation> +<translation id="2746543609216772311">ค่าต้องเป็น <ph name="MINIMUM_DATE_OR_TIME"/> หรือหลังจากนั้น</translation> <translation id="2572483411312390101">เล่น</translation> <translation id="8785498733064193001">เริ่มเล่น</translation> <translation id="7057186640035488495">เวลาของภาพยนตร์</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">ย้อนกลับอย่างรวดเร็ว</translation> <translation id="7789962463072032349">หยุดชั่วคราว</translation> <translation id="6853785296079745596">ซ่อนคำอธิบายภาพ</translation> +<translation id="4360991593054037559">โปรดป้อนค่าที่ถูกต้อง ค่าใกล้เคียงที่สุดที่ถูกต้องสองรายการคือ <ph name="VALID_VALUE_LOW"/> และ <ph name="VALID_VALUE_HIGHER"/></translation> <translation id="1758486001363313524">อื่นๆ...</translation> <translation id="8141602879876242471">นี่คือดัชนีที่สามารถค้นหาได้ ป้อนคำหลักในการค้นหา:</translation> <translation id="1930711995431081526">สถานะ</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">ไปข้างหน้าอย่างรวดเร็ว</translation> <translation id="4812940957355064477">โปรดป้อนตัวเลข</translation> <translation id="2548326553472216322">ไม่พบการค้นหาล่าสุด</translation> +<translation id="1938124657309484470">ค่าต้องเป็น <ph name="MAXIMUM_DATE_OR_TIME"/> หรือก่อนหน้านั้น</translation> <translation id="7263440858009898357">โปรดเลือกรายการจากหน้ารายการ</translation> <translation id="901493112792887934">เวลาปัจจุบันเป็นวินาที</translation> <translation id="5164977714490026579">ค่าต้องมากกว่าหรือเท่ากับ <ph name="MINIMUM"/></translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">สัปดาห์นี้</translation> <translation id="5966707198760109579">สัปดาห์</translation> <translation id="2901282870647571346">สถานะปัจจุบันของภาพยนตร์</translation> +<translation id="2060505056492490888">"<ph name="DOT"/>" ถูกใช้งานในตำแหน่งที่ไม่ถูกต้องใน "<ph name="INVALIDDOMAIN"/>"</translation> <translation id="2674318244760992338">ส่วนท้าย</translation> <translation id="8987927404178983737">เดือน</translation> <translation id="8115662671911883373">เริ่มแสดงคำอธิบายภาพ</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">ทำเครื่องหมาย</translation> <translation id="2846343701378493991">1024 (เกรดปานกลาง)</translation> <translation id="1637811476055996098">เลือกไฟล์</translation> +<translation id="49969490063480558">โปรดป้อนส่วนที่ต่อท้าย "<ph name="ATSIGN"/>" "<ph name="INVALIDADDRESS"/>" นั้นไม่สมบูรณ์</translation> <translation id="5476505524087279545">ยกเลิกการทำเครื่องหมาย</translation> <translation id="2148716181193084225">วันนี้</translation> <translation id="2507943997699731163">โปรดกรอกฟิลด์นี้</translation> <translation id="3785482301506746191">ตัวควบคุมเวลาของภาพยนตร์</translation> <translation id="739024184232394898">อื่นๆ...</translation> +<translation id="383465348367842624">ส่วนที่ตามด้วย "<ph name="ATSIGN"/>" ต้องไม่มีสัญลักษณ์ "<ph name="INVALIDCHARACTER"/>"</translation> <translation id="5468998798572797635">ออกจากการแสดงแบบเต็มหน้าจอ</translation> <translation id="5919473608089529604">ไม่สามารถโหลดปลั๊กอิน</translation> <translation id="5546461542133609677">เปิดเสียง</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">โปรดป้อนรายการที่อยู่อีเมลโดยคั่นด้วยเครื่องหมายจุลภาค</translation> <translation id="5939518447894949180">ตั้งค่าใหม่</translation> <translation id="1921819250265091946">วว</translation> +<translation id="2613802280814924224">โปรดป้อนค่าที่ถูกต้อง ค่าใกล้เคียงที่สุดที่ถูกต้องคือ <ph name="VALID_VALUE"/></translation> <translation id="835897206747267392">ค่าไม่ถูกต้อง</translation> <translation id="1842960171412779397">เลือก</translation> <translation id="7673697353781729403">ชั่วโมง</translation> +<translation id="4664250907885839816">ส่วนที่ต่อท้าย "<ph name="ATSIGN"/>" ต้องไม่มีสัญลักษณ์ "<ph name="INVALIDCHARACTER"/>"</translation> <translation id="3450233048674729344">ค่าต้องน้อยกว่าหรือเท่ากับ <ph name="MAXIMUM"/></translation> <translation id="3471999216963526757">ย้อนกลับ 30 วินาที</translation> <translation id="668171684555832681">อื่นๆ...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">เปิดใช้งาน</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> ไฟล์</translation> <translation id="6643016212128521049">ล้าง</translation> +<translation id="7888071071722539607">โปรดใส่ "<ph name="ATSIGN"/>" ในที่อยู่อีเมล "<ph name="INVALIDADDRESS"/>" ขาด "<ph name="ATSIGN"/>"</translation> <translation id="4851297395436456855">ไปข้างหน้าอย่างรวดเร็ว</translation> <translation id="1088086359088493902">วินาที</translation> <translation id="3934680773876859118">โหลดเอกสาร PDF ล้มเหลว</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_tr.xtb b/chromium/webkit/glue/resources/webkit_strings_tr.xtb index 9bea850a265..9a9e44f96fd 100644 --- a/chromium/webkit/glue/resources/webkit_strings_tr.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_tr.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Diğer...</translation> <translation id="2426432199384958866">akışı yapılan filmi gerçek zamanlı hale döndür</translation> <translation id="248395913932153421">Gün</translation> +<translation id="1729654308190250600">Lütfen e-posta adresini boş bırakmayın.</translation> <translation id="6015796118275082299">Yıl</translation> <translation id="9186171386827445984">Belge yükleniyor: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> sayfa...</translation> <translation id="1235745349614807883">Son Aramaları Temizle</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">liste işaretçisi</translation> <translation id="4202807286478387388">git</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Lütfen başına "<ph name="ATSIGN"/>" ekleyin. "<ph name="INVALIDADDRESS"/>" adresi eksik.</translation> +<translation id="2746543609216772311">Değer <ph name="MINIMUM_DATE_OR_TIME"/> veya daha ileri olmalıdır.</translation> <translation id="2572483411312390101">oynat</translation> <translation id="8785498733064193001">oynatmayı başlat</translation> <translation id="7057186640035488495">filmin süresi</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">hızlı şekilde geriye doğru git</translation> <translation id="7789962463072032349">duraklat</translation> <translation id="6853785296079745596">alt yazıları gizle</translation> +<translation id="4360991593054037559">Lütfen geçerli bir değer girin. En yakın iki geçerli değer şunlardır: <ph name="VALID_VALUE_LOW"/> ve <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Diğer...</translation> <translation id="8141602879876242471">Bu dizinde arama yapılabilir. Arama anahtar kelimeleri girin:</translation> <translation id="1930711995431081526">durum</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">hızlı şekilde ileriye doğru git</translation> <translation id="4812940957355064477">Lütfen bir sayı girin.</translation> <translation id="2548326553472216322">Yeni arama yok</translation> +<translation id="1938124657309484470">Değer <ph name="MAXIMUM_DATE_OR_TIME"/> veya daha geri olmalıdır.</translation> <translation id="7263440858009898357">Lütfen listeden bir öğe seçin.</translation> <translation id="901493112792887934">saniye olarak geçerli süre</translation> <translation id="5164977714490026579">Değer <ph name="MINIMUM"/> veya daha büyük olmalıdır.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Bu hafta</translation> <translation id="5966707198760109579">Hafta</translation> <translation id="2901282870647571346">filmin geçerli durumu</translation> +<translation id="2060505056492490888">"<ph name="DOT"/>", "<ph name="INVALIDDOMAIN"/>" adı içinde yanlış bir konumda kullanılmış.</translation> <translation id="2674318244760992338">altbilgi</translation> <translation id="8987927404178983737">Ay</translation> <translation id="8115662671911883373">altyazıları görüntülemeye başla</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">işaretle</translation> <translation id="2846343701378493991">1024 (Orta Düzey)</translation> <translation id="1637811476055996098">Dosyaları Seç</translation> +<translation id="49969490063480558">Lütfen başına "<ph name="ATSIGN"/>" ekleyin. "<ph name="INVALIDADDRESS"/>" eksik.</translation> <translation id="5476505524087279545">işareti kaldır</translation> <translation id="2148716181193084225">Bugün</translation> <translation id="2507943997699731163">Lütfen bu alanı doldurun.</translation> <translation id="3785482301506746191">film süresi göstergesi</translation> <translation id="739024184232394898">Diğer...</translation> +<translation id="383465348367842624">Başında "<ph name="ATSIGN"/>" bulunan kısımda "<ph name="INVALIDCHARACTER"/>" simgesi bulunmamalıdır.</translation> <translation id="5468998798572797635">tam ekrandan çık</translation> <translation id="5919473608089529604">Eklenti yüklenemedi.</translation> <translation id="5546461542133609677">sesi aç</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Lütfen e-posta adreslerinin virgülle ayrılmış listesini girin.</translation> <translation id="5939518447894949180">Sıfırla</translation> <translation id="1921819250265091946">gg</translation> +<translation id="2613802280814924224">Lütfen geçerli bir değer girin. En yakın geçerli değer şudur: <ph name="VALID_VALUE"/></translation> <translation id="835897206747267392">Geçersiz değer.</translation> <translation id="1842960171412779397">seç</translation> <translation id="7673697353781729403">Saat</translation> +<translation id="4664250907885839816">Başında "<ph name="ATSIGN"/>" bulunan kısımda "<ph name="INVALIDCHARACTER"/>" simgesi bulunmamalıdır.</translation> <translation id="3450233048674729344">Değer <ph name="MAXIMUM"/> veya daha küçük olmalıdır.</translation> <translation id="3471999216963526757">30 saniye geri git</translation> <translation id="668171684555832681">Diğer...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">etkinleştir</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> dosya</translation> <translation id="6643016212128521049">Temizle</translation> +<translation id="7888071071722539607">Lütfen e-posta adresine bir "<ph name="ATSIGN"/>" işareti ekleyin. "<ph name="INVALIDADDRESS"/>" adresinde "<ph name="ATSIGN"/>" eksik.</translation> <translation id="4851297395436456855">ileri sar</translation> <translation id="1088086359088493902">Saniye</translation> <translation id="3934680773876859118">PDF dokümanı yüklenemedi</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_uk.xtb b/chromium/webkit/glue/resources/webkit_strings_uk.xtb index 1d03afb4e6e..84a819a9df9 100644 --- a/chromium/webkit/glue/resources/webkit_strings_uk.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_uk.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Інші...</translation> <translation id="2426432199384958866">повернути трансляцію фільму в режим реального часу</translation> <translation id="248395913932153421">День</translation> +<translation id="1729654308190250600">Введіть електронну адресу.</translation> <translation id="6015796118275082299">Рік</translation> <translation id="9186171386827445984">Завантаження документа – сторінки: <ph name="PAGE_NUMBER"/> із <ph name="NUMBER_OF_PAGES"/>...</translation> <translation id="1235745349614807883">Очистити останні пошуки</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">маркер списку</translation> <translation id="4202807286478387388">перейти</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Введіть частину електронної адреси до знака "<ph name="ATSIGN"/>". Електронна адреса "<ph name="INVALIDADDRESS"/>" неповна.</translation> +<translation id="2746543609216772311">Має бути <ph name="MINIMUM_DATE_OR_TIME"/> або пізніша дата.</translation> <translation id="2572483411312390101">відтворити</translation> <translation id="8785498733064193001">розпочати відтворення</translation> <translation id="7057186640035488495">тривалість фільму</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">швидко перемотати назад</translation> <translation id="7789962463072032349">призупинити</translation> <translation id="6853785296079745596">сховати приховані субтирти</translation> +<translation id="4360991593054037559">Введіть дійсне значення. Два найближчі дійсні значення: <ph name="VALID_VALUE_LOW"/> і <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Інші...</translation> <translation id="8141602879876242471">Цей доступний для пошуку індекс. Введіть ключові слова пошуку:</translation> <translation id="1930711995431081526">статус</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">швидко перемотати вперед</translation> <translation id="4812940957355064477">Введіть число.</translation> <translation id="2548326553472216322">Немає останніх пошуків</translation> +<translation id="1938124657309484470">Має бути <ph name="MAXIMUM_DATE_OR_TIME"/> або раніша дата.</translation> <translation id="7263440858009898357">Виберіть елемент зі списку.</translation> <translation id="901493112792887934">поточний час у секундах</translation> <translation id="5164977714490026579">Значення має бути більшим або дорівнювати <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Цей тиждень</translation> <translation id="5966707198760109579">Тиждень</translation> <translation id="2901282870647571346">поточний статус фільму</translation> +<translation id="2060505056492490888">Символ "<ph name="DOT"/>" у "<ph name="INVALIDDOMAIN"/>" використано неправильно.</translation> <translation id="2674318244760992338">нижній колонтитул</translation> <translation id="8987927404178983737">Місяць</translation> <translation id="8115662671911883373">показати приховані субтитри</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">установити прапорець</translation> <translation id="2846343701378493991">1024 (Середній рівень)</translation> <translation id="1637811476055996098">Вибрати файли</translation> +<translation id="49969490063480558">Введіть частину електронної адреси після знака "<ph name="ATSIGN"/>". Електронна адреса "<ph name="INVALIDADDRESS"/>" неповна.</translation> <translation id="5476505524087279545">зняти прапорець</translation> <translation id="2148716181193084225">Сьогодні</translation> <translation id="2507943997699731163">Заповніть це поле.</translation> <translation id="3785482301506746191">повзунок перебігу фільму</translation> <translation id="739024184232394898">Інші...</translation> +<translation id="383465348367842624">Частина перед знаком "<ph name="ATSIGN"/>" не може містити символ "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="5468998798572797635">вийти з повноекранного режиму</translation> <translation id="5919473608089529604">Не вдалося завантажити плагін.</translation> <translation id="5546461542133609677">увімкнути звук</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Введіть список електронних адрес, розділених комою.</translation> <translation id="5939518447894949180">Скинути</translation> <translation id="1921819250265091946">дд</translation> +<translation id="2613802280814924224">Введіть дійсне значення. Найближче дійсне значення: <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Недійсне значення</translation> <translation id="1842960171412779397">вибрати</translation> <translation id="7673697353781729403">Години</translation> +<translation id="4664250907885839816">Частина після знака "<ph name="ATSIGN"/>" не може містити символ "<ph name="INVALIDCHARACTER"/>".</translation> <translation id="3450233048674729344">Значення має бути меншим або дорівнювати <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">назад на 30 секунд</translation> <translation id="668171684555832681">Інший...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">активувати</translation> <translation id="8444882422881193423">файлів: <ph name="NUMBER_OF_FILES"/></translation> <translation id="6643016212128521049">Очистити</translation> +<translation id="7888071071722539607">Електронна адреса має містити знак "<ph name="ATSIGN"/>". В електронній адресі "<ph name="INVALIDADDRESS"/>" знака "<ph name="ATSIGN"/>" немає.</translation> <translation id="4851297395436456855">перемотати вперед</translation> <translation id="1088086359088493902">Секунди</translation> <translation id="3934680773876859118">Не вдалося завантажити документ PDF</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_vi.xtb b/chromium/webkit/glue/resources/webkit_strings_vi.xtb index 79fb4e5d304..2f0c01ffe2e 100644 --- a/chromium/webkit/glue/resources/webkit_strings_vi.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_vi.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">Khác...</translation> <translation id="2426432199384958866">đưa phim phát trực tuyến trở về thời gian thực</translation> <translation id="248395913932153421">Ngày</translation> +<translation id="1729654308190250600">Vui lòng nhập địa chỉ email không trống.</translation> <translation id="6015796118275082299">Năm</translation> <translation id="9186171386827445984">Đang tải tài liệu: <ph name="PAGE_NUMBER"/>/<ph name="NUMBER_OF_PAGES"/> trang...</translation> <translation id="1235745349614807883">Xóa Tìm kiếm Gần đây</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">đánh dấu danh sách</translation> <translation id="4202807286478387388">chuyển</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">Vui lòng nhập phần đứng trước '<ph name="ATSIGN"/>'. '<ph name="INVALIDADDRESS"/>' không hoàn chỉnh.</translation> +<translation id="2746543609216772311">Giá trị phải là <ph name="MINIMUM_DATE_OR_TIME"/> hoặc muộn hơn.</translation> <translation id="2572483411312390101">phát</translation> <translation id="8785498733064193001">bắt đầu phát lại</translation> <translation id="7057186640035488495">thời gian phim</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">tìm kiếm tua về nhanh</translation> <translation id="7789962463072032349">tạm dừng</translation> <translation id="6853785296079745596">ẩn phụ đề chi tiết</translation> +<translation id="4360991593054037559">Vui lòng nhập giá trị hợp lệ. Hai giá trị hợp lệ gần nhất là <ph name="VALID_VALUE_LOW"/> và <ph name="VALID_VALUE_HIGHER"/>.</translation> <translation id="1758486001363313524">Khác...</translation> <translation id="8141602879876242471">Đây là chỉ mục có thể tìm kiếm. Nhập từ khóa tìm kiếm vào:</translation> <translation id="1930711995431081526">trạng thái</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">tìm kiếm tua đi nhanh</translation> <translation id="4812940957355064477">Vui lòng nhập một số.</translation> <translation id="2548326553472216322">Không có tìm kiếm nào gần đây</translation> +<translation id="1938124657309484470">Giá trị phải là <ph name="MAXIMUM_DATE_OR_TIME"/> hoặc sớm hơn.</translation> <translation id="7263440858009898357">Vui lòng chọn một mục trong danh sách.</translation> <translation id="901493112792887934">thời gian hiện tại bằng giây</translation> <translation id="5164977714490026579">Giá trị phải lớn hơn hoặc bằng <ph name="MINIMUM"/>.</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">Tuần này</translation> <translation id="5966707198760109579">Tuần</translation> <translation id="2901282870647571346">trạng thái phim hiện tại</translation> +<translation id="2060505056492490888">'<ph name="DOT"/>' bị sử dụng sai vị trí trong '<ph name="INVALIDDOMAIN"/>'.</translation> <translation id="2674318244760992338">chân trang</translation> <translation id="8987927404178983737">Tháng</translation> <translation id="8115662671911883373">bắt đầu hiển thị phụ đề chi tiết</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">chọn</translation> <translation id="2846343701378493991">1024 (Loại Trung bình)</translation> <translation id="1637811476055996098">Chọn tệp</translation> +<translation id="49969490063480558">Vui lòng nhập phần đứng sau '<ph name="ATSIGN"/>'. '<ph name="INVALIDADDRESS"/>' không hoàn chỉnh.</translation> <translation id="5476505524087279545">bỏ chọn</translation> <translation id="2148716181193084225">Hôm nay</translation> <translation id="2507943997699731163">Vui lòng điền vào trường này.</translation> <translation id="3785482301506746191">trình kiểm soát thời gian phim</translation> <translation id="739024184232394898">Khác...</translation> +<translation id="383465348367842624">Phần đứng trước '<ph name="ATSIGN"/>' không được chứa biểu tượng '<ph name="INVALIDCHARACTER"/>'.</translation> <translation id="5468998798572797635">thoát khỏi chế độ toàn màn hình</translation> <translation id="5919473608089529604">Không thể tải trình cắm.</translation> <translation id="5546461542133609677">bật tiếng</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">Vui lòng nhập danh sách địa chỉ email được phân cách bằng dấu phẩy.</translation> <translation id="5939518447894949180">Đặt lại</translation> <translation id="1921819250265091946">dd</translation> +<translation id="2613802280814924224">Vui lòng nhập giá trị hợp lệ. Giá trị hợp lệ gần nhất là <ph name="VALID_VALUE"/>.</translation> <translation id="835897206747267392">Giá trị không hợp lệ.</translation> <translation id="1842960171412779397">chọn</translation> <translation id="7673697353781729403">Giờ</translation> +<translation id="4664250907885839816">Phần đứng sau '<ph name="ATSIGN"/>' không được chứa biểu tượng '<ph name="INVALIDCHARACTER"/>'.</translation> <translation id="3450233048674729344">Giá trị phải nhỏ hơn hoặc bằng <ph name="MAXIMUM"/>.</translation> <translation id="3471999216963526757">quay lại 30 giây</translation> <translation id="668171684555832681">Khác...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">kích hoạt</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> tệp</translation> <translation id="6643016212128521049">Xóa</translation> +<translation id="7888071071722539607">Vui lòng bao gồm '<ph name="ATSIGN"/>' trong địa chỉ email. '<ph name="INVALIDADDRESS"/>' bị thiếu '<ph name="ATSIGN"/>'.</translation> <translation id="4851297395436456855">tua đi nhanh</translation> <translation id="1088086359088493902">Giây</translation> <translation id="3934680773876859118">Không thể tải tài liệu PDF</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_zh-CN.xtb b/chromium/webkit/glue/resources/webkit_strings_zh-CN.xtb index 2d997b60de7..b971e7bf108 100644 --- a/chromium/webkit/glue/resources/webkit_strings_zh-CN.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_zh-CN.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">其他...</translation> <translation id="2426432199384958866">将流式传输电影恢复为实时</translation> <translation id="248395913932153421">日</translation> +<translation id="1729654308190250600">请输入有效的电子邮件地址。</translation> <translation id="6015796118275082299">年</translation> <translation id="9186171386827445984">正在加载文档:已加载 <ph name="PAGE_NUMBER"/> 页,共 <ph name="NUMBER_OF_PAGES"/> 页...</translation> <translation id="1235745349614807883">清除最近的搜索</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">列表标记</translation> <translation id="4202807286478387388">略过</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">请在“<ph name="ATSIGN"/>”前面输入内容。“<ph name="INVALIDADDRESS"/>”不完整。</translation> +<translation id="2746543609216772311">指定的值不得早于<ph name="MINIMUM_DATE_OR_TIME"/>。</translation> <translation id="2572483411312390101">播放</translation> <translation id="8785498733064193001">开始播放</translation> <translation id="7057186640035488495">电影时间</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">快速回退</translation> <translation id="7789962463072032349">暂停</translation> <translation id="6853785296079745596">隐藏可选字幕</translation> +<translation id="4360991593054037559">请输入有效值。两个最接近的有效值分别为<ph name="VALID_VALUE_LOW"/>和<ph name="VALID_VALUE_HIGHER"/>。</translation> <translation id="1758486001363313524">其他...</translation> <translation id="8141602879876242471">这是一个可搜索的索引。请输入搜索关键字:</translation> <translation id="1930711995431081526">状态</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">快速前进</translation> <translation id="4812940957355064477">请输入一个数字。</translation> <translation id="2548326553472216322">最近未执行搜索</translation> +<translation id="1938124657309484470">指定的值不得晚于<ph name="MAXIMUM_DATE_OR_TIME"/>。</translation> <translation id="7263440858009898357">请在列表中选择一项。</translation> <translation id="901493112792887934">目前时间(以秒为单位)</translation> <translation id="5164977714490026579">值必须大于或等于 <ph name="MINIMUM"/>。</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">本周</translation> <translation id="5966707198760109579">周</translation> <translation id="2901282870647571346">当前电影状态</translation> +<translation id="2060505056492490888">“<ph name="INVALIDDOMAIN"/>”中“<ph name="DOT"/>”的位置不正确。</translation> <translation id="2674318244760992338">页脚</translation> <translation id="8987927404178983737">月</translation> <translation id="8115662671911883373">开始显示可选字幕</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">选中</translation> <translation id="2846343701378493991">1024(中等强度)</translation> <translation id="1637811476055996098">选择文件</translation> +<translation id="49969490063480558">请在“<ph name="ATSIGN"/>”后面输入内容。“<ph name="INVALIDADDRESS"/>”不完整。</translation> <translation id="5476505524087279545">取消选中</translation> <translation id="2148716181193084225">今天</translation> <translation id="2507943997699731163">请填写此字段。</translation> <translation id="3785482301506746191">电影时间进度条</translation> <translation id="739024184232394898">其他...</translation> +<translation id="383465348367842624">“<ph name="ATSIGN"/>”前面的内容不应包含符号“<ph name="INVALIDCHARACTER"/>”。</translation> <translation id="5468998798572797635">退出全屏模式</translation> <translation id="5919473608089529604">无法加载插件。</translation> <translation id="5546461542133609677">取消静音</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">请输入用逗号分隔的电子邮件地址的列表。</translation> <translation id="5939518447894949180">重置</translation> <translation id="1921819250265091946">日</translation> +<translation id="2613802280814924224">请输入有效值。最接近的有效值为<ph name="VALID_VALUE"/>。</translation> <translation id="835897206747267392">值无效。</translation> <translation id="1842960171412779397">选中</translation> <translation id="7673697353781729403">小时</translation> +<translation id="4664250907885839816">“<ph name="ATSIGN"/>”后面的内容不应包含符号“<ph name="INVALIDCHARACTER"/>”。</translation> <translation id="3450233048674729344">值必须小于或等于 <ph name="MAXIMUM"/>。</translation> <translation id="3471999216963526757">后退 30 秒</translation> <translation id="668171684555832681">其他...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">激活</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> 个文件</translation> <translation id="6643016212128521049">清除</translation> +<translation id="7888071071722539607">请在电子邮件地址中包括“<ph name="ATSIGN"/>”。“<ph name="INVALIDADDRESS"/>”中缺少“<ph name="ATSIGN"/>”。</translation> <translation id="4851297395436456855">快进</translation> <translation id="1088086359088493902">秒</translation> <translation id="3934680773876859118">无法加载 PDF 文档</translation> diff --git a/chromium/webkit/glue/resources/webkit_strings_zh-TW.xtb b/chromium/webkit/glue/resources/webkit_strings_zh-TW.xtb index 31dc271d2c7..ab37fe041cd 100644 --- a/chromium/webkit/glue/resources/webkit_strings_zh-TW.xtb +++ b/chromium/webkit/glue/resources/webkit_strings_zh-TW.xtb @@ -5,6 +5,7 @@ <translation id="5843503607508392247">其他...</translation> <translation id="2426432199384958866">將串流影片恢復為即時播放</translation> <translation id="248395913932153421">日</translation> +<translation id="1729654308190250600">請輸入電子郵件地址。</translation> <translation id="6015796118275082299">年</translation> <translation id="9186171386827445984">正在載入文件:第 <ph name="PAGE_NUMBER"/> 頁,共 <ph name="NUMBER_OF_PAGES"/> 頁...</translation> <translation id="1235745349614807883">清除最近的搜尋紀錄</translation> @@ -14,6 +15,8 @@ <translation id="5048533449481078685">清單標記</translation> <translation id="4202807286478387388">跳至另一頁</translation> <translation id="4611115858363067980"><ph name="FILENAME"/><ph name="WIDTH"/>×<ph name="HEIGHT"/></translation> +<translation id="5307600278924710095">請輸入「<ph name="ATSIGN"/>」後面的部分。「<ph name="INVALIDADDRESS"/>」不是完整值。</translation> +<translation id="2746543609216772311">必須輸入 <ph name="MINIMUM_DATE_OR_TIME"/> 或之後的值。</translation> <translation id="2572483411312390101">播放</translation> <translation id="8785498733064193001">開始播放</translation> <translation id="7057186640035488495">電影時間</translation> @@ -22,6 +25,7 @@ <translation id="1320012872283894746">影片倒轉</translation> <translation id="7789962463072032349">暫停</translation> <translation id="6853785296079745596">不顯示隱藏式輔助字幕</translation> +<translation id="4360991593054037559">請輸入有效值。最接近的兩個有效值分別是 <ph name="VALID_VALUE_LOW"/> 和 <ph name="VALID_VALUE_HIGHER"/>。</translation> <translation id="1758486001363313524">其他...</translation> <translation id="8141602879876242471">這是可搜尋的索引,輸入搜尋關鍵字:</translation> <translation id="1930711995431081526">狀態</translation> @@ -35,6 +39,7 @@ <translation id="9039488204461337220">影片快轉</translation> <translation id="4812940957355064477">請輸入一個數字。</translation> <translation id="2548326553472216322">沒有近期的搜尋</translation> +<translation id="1938124657309484470">必須輸入 <ph name="MAXIMUM_DATE_OR_TIME"/> 或之前的值。</translation> <translation id="7263440858009898357">請選取一個清單中的項目。</translation> <translation id="901493112792887934">目前時間 (以秒為單位)</translation> <translation id="5164977714490026579">值必須大於或等於 <ph name="MINIMUM"/>。</translation> @@ -51,6 +56,7 @@ <translation id="8117451130807776954">本週</translation> <translation id="5966707198760109579">週</translation> <translation id="2901282870647571346">目前電影狀態</translation> +<translation id="2060505056492490888">「<ph name="DOT"/>」未放在「<ph name="INVALIDDOMAIN"/>」的正確位置。</translation> <translation id="2674318244760992338">頁尾</translation> <translation id="8987927404178983737">月</translation> <translation id="8115662671911883373">開始顯示隱藏式輔助字幕</translation> @@ -63,11 +69,13 @@ <translation id="838869780401515933">選取</translation> <translation id="2846343701378493991">1024 (中等)</translation> <translation id="1637811476055996098">選擇檔案</translation> +<translation id="49969490063480558">請輸入「<ph name="ATSIGN"/>」後面的部分。「<ph name="INVALIDADDRESS"/>」不是完整值。</translation> <translation id="5476505524087279545">取消選取</translation> <translation id="2148716181193084225">今天</translation> <translation id="2507943997699731163">請填寫這個欄位。</translation> <translation id="3785482301506746191">影片時間拖曳工具</translation> <translation id="739024184232394898">其他...</translation> +<translation id="383465348367842624">「<ph name="ATSIGN"/>」後面的部分不應包含「<ph name="INVALIDCHARACTER"/>」符號。</translation> <translation id="5468998798572797635">退出全螢幕</translation> <translation id="5919473608089529604">無法載入外掛程式。</translation> <translation id="5546461542133609677">取消靜音</translation> @@ -87,9 +95,11 @@ <translation id="2908441821576996758">請輸入以逗號分隔的電子郵件地址清單。</translation> <translation id="5939518447894949180">重設</translation> <translation id="1921819250265091946">日</translation> +<translation id="2613802280814924224">請輸入有效值。最接近的有效值是 <ph name="VALID_VALUE"/>。</translation> <translation id="835897206747267392">無效的值。</translation> <translation id="1842960171412779397">選取</translation> <translation id="7673697353781729403">小時</translation> +<translation id="4664250907885839816">「<ph name="ATSIGN"/>」後面的部分不應包含「<ph name="INVALIDCHARACTER"/>」符號。</translation> <translation id="3450233048674729344">值必須小於或等於 <ph name="MAXIMUM"/>。</translation> <translation id="3471999216963526757">倒轉 30 秒</translation> <translation id="668171684555832681">其他...</translation> @@ -99,6 +109,7 @@ <translation id="6119846243427417423">啟動</translation> <translation id="8444882422881193423"><ph name="NUMBER_OF_FILES"/> 個檔案</translation> <translation id="6643016212128521049">清除</translation> +<translation id="7888071071722539607">請在電子郵件地址中包含「<ph name="ATSIGN"/>」。「<ph name="INVALIDADDRESS"/>」未包含「<ph name="ATSIGN"/>」。</translation> <translation id="4851297395436456855">向前快轉</translation> <translation id="1088086359088493902">秒</translation> <translation id="3934680773876859118">無法載入 PDF 文件</translation> diff --git a/chromium/webkit/glue/simple_webmimeregistry_impl.cc b/chromium/webkit/glue/simple_webmimeregistry_impl.cc index 8340458df38..48364efbeeb 100644 --- a/chromium/webkit/glue/simple_webmimeregistry_impl.cc +++ b/chromium/webkit/glue/simple_webmimeregistry_impl.cc @@ -94,12 +94,4 @@ WebString SimpleWebMimeRegistryImpl::mimeTypeFromFile( return WebString::fromUTF8(mime_type); } -WebString SimpleWebMimeRegistryImpl::preferredExtensionForMIMEType( - const WebString& mime_type) { - base::FilePath::StringType file_extension; - net::GetPreferredExtensionForMimeType(ToASCIIOrEmpty(mime_type), - &file_extension); - return base::FilePath(file_extension).AsUTF16Unsafe(); -} - } // namespace webkit_glue diff --git a/chromium/webkit/glue/simple_webmimeregistry_impl.h b/chromium/webkit/glue/simple_webmimeregistry_impl.h index 39972ebe516..1055dfe18ab 100644 --- a/chromium/webkit/glue/simple_webmimeregistry_impl.h +++ b/chromium/webkit/glue/simple_webmimeregistry_impl.h @@ -45,8 +45,6 @@ class WEBKIT_GLUE_EXPORT SimpleWebMimeRegistryImpl : virtual WebKit::WebString wellKnownMimeTypeForExtension( const WebKit::WebString&); virtual WebKit::WebString mimeTypeFromFile(const WebKit::WebString&); - virtual WebKit::WebString preferredExtensionForMIMEType( - const WebKit::WebString&); }; } // namespace webkit_glue diff --git a/chromium/webkit/glue/webkit_glue.gypi b/chromium/webkit/glue/webkit_glue.gypi index adbd54d00ed..c2c3fed5535 100644 --- a/chromium/webkit/glue/webkit_glue.gypi +++ b/chromium/webkit/glue/webkit_glue.gypi @@ -9,6 +9,9 @@ 'cflags+': ['-Wno-narrowing'], 'cflags_cc+': ['-Wno-narrowing'], }, + 'variables': { + 'chromium_code': 1, + }, 'targets': [ { 'target_name': 'glue_child', diff --git a/chromium/webkit/glue/webkit_glue_unittest.cc b/chromium/webkit/glue/webkit_glue_unittest.cc index 50b57abf101..678d9169e8d 100644 --- a/chromium/webkit/glue/webkit_glue_unittest.cc +++ b/chromium/webkit/glue/webkit_glue_unittest.cc @@ -6,7 +6,7 @@ #include <string> -#include "base/message_loop/message_loop.h" +#include "base/run_loop.h" #include "base/time/time.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/child/webkitplatformsupport_impl.h" @@ -67,6 +67,7 @@ class TestWebKitPlatformSupport TEST(WebkitGlueTest, SuspendResumeSharedTimer) { base::MessageLoop message_loop; + TestWebKitPlatformSupport platform_support; // Set a timer to fire as soon as possible. @@ -75,7 +76,7 @@ TEST(WebkitGlueTest, SuspendResumeSharedTimer) { platform_support.SuspendSharedTimer(); // The above timer would have posted a task which can be processed out of the // message loop. - message_loop.RunUntilIdle(); + base::RunLoop().RunUntilIdle(); // Set a mock time after 1 second to simulate timers suspended for 1 second. double new_time = base::Time::Now().ToDoubleT() + 1; platform_support.set_mock_monotonically_increasing_time(new_time); diff --git a/chromium/webkit/glue/webkit_strings.grd b/chromium/webkit/glue/webkit_strings.grd index ddc27e95ef2..6f6d14cc9a9 100644 --- a/chromium/webkit/glue/webkit_strings.grd +++ b/chromium/webkit/glue/webkit_strings.grd @@ -579,17 +579,41 @@ below: <message name="IDS_FORM_VALIDATION_TYPE_MISMATCH" desc="Heading or short sentence shown when a form control in a webpage requires specific type such as email address or URL, but the specified value does not comform to the type."> Invalid value. </message> + <message name="IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_EMPTY" desc="Heading or short sentence shown when there is an email field in a form and a user specified an empty value."> + Please enter a non-empty email address. + </message> + <message name="IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_EMPTY_DOMAIN" desc="Heading or short sentence shown when there is an email field in a form and a user specified an invalid value like 'user@'."> + Please enter a part following '<ph name="ATSIGN">$1<ex>@</ex></ph>'. '<ph name="INVALIDADDRESS">$2<ex>user@</ex></ph>' is incomplete. + </message> + <message name="IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_EMPTY_LOCAL" desc="Heading or short sentence shown when there is an email field in a form and a user specified an invalid value like '@example.com'."> + Please enter a part followed by '<ph name="ATSIGN">$1<ex>@</ex></ph>'. '<ph name="INVALIDADDRESS">$2<ex>@example.com</ex></ph>' is incomplete. + </message> + <message name="IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_INVALID_DOMAIN" desc="Heading or short sentence shown when there is an email field in a form and a user specified an invalid value like 'user@example,com'."> + A part following '<ph name="ATSIGN">$1<ex>@</ex></ph>' should not contain the symbol '<ph name="INVALIDCHARACTER">$2<ex>,</ex></ph>'. + </message> + <message name="IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_INVALID_DOTS" desc="Heading or short sentence shown when there is an email field in a form and a user specified an invalid value with wrong dots like 'user@example..com'."> + '<ph name="DOT">$1<ex>.</ex></ph>' is used at a wrong position in '<ph name="INVALIDDOMAIN">$2<ex>example..com</ex></ph>'. + </message> + <message name="IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_INVALID_LOCAL" desc="Heading or short sentence shown when there is an email field in a form and a user specified an invalid value like 'us,er@example.com'."> + A part followed by '<ph name="ATSIGN">$1<ex>@</ex></ph>' should not contain the symbol '<ph name="INVALIDCHARACTER">$2<ex>,</ex></ph>'. + </message> + <message name="IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_NO_AT_SIGN" desc="Heading or short sentence shown when there is an email field in a form and a user specified an invalid value liek 'user'."> + Please include an '<ph name="ATSIGN">$1<ex>@</ex></ph>' in the email address. '<ph name="INVALIDADDRESS">$2<ex>user</ex></ph>' is missing an '<ph name="ATSIGN">$1<ex>@</ex></ph>'. + </message> <message name="IDS_FORM_VALIDATION_TYPE_MISMATCH_MULTIPLE_EMAIL" desc="Heading or short sentence shown there is a field which accepts multiple e-mail addresses and a user specified a value which is not a comma-separated e-mail addresses."> Please enter a comma separated list of email addresses. </message> <message name="IDS_FORM_VALIDATION_RANGE_UNDERFLOW" desc="Heading or short sentence shown when a form control value in a webpage needs to be larger than or equal to a minimum value specified by the page author, but a user specified a too small value."> Value must be greater than or equal to <ph name="MINIMUM">$1<ex>0</ex></ph>. </message> + <message name="IDS_FORM_VALIDATION_RANGE_UNDERFLOW_DATETIME" desc="Heading or short sentence shown when a form control value in a webpage needs to be later or equal to a minimum date/time value specified by the page author, but a user specified an earlier date/time."> + Value must be <ph name="MINIMUM_DATE_OR_TIME">$1<ex>01/04/2013</ex></ph> or later. + </message> <message name="IDS_FORM_VALIDATION_RANGE_OVERFLOW" desc="Heading or short sentence shown when a form control value in a webpage needs to be smaller than or equal to a maximum value specified by the page author, but a user specified a too large value."> Value must be less than or equal to <ph name="MAXIMUM">$1<ex>100</ex></ph>. </message> - <message name="IDS_FORM_VALIDATION_STEP_MISMATCH" desc="Heading or short sentence shown when a form control value in a webpage should be aligned to a step value specified by the page author, but a user speficified non-aligned value. e.g. A number type field, minimum value is 0, and step value is 4. If A user-specified value is not a multiple of 4, this warning message is shown."> - Invalid value. + <message name="IDS_FORM_VALIDATION_RANGE_OVERFLOW_DATETIME" desc="Heading or short sentence shown when a form control value in a webpage needs to be earlier than or equal to a maximum date/time value specified by the page author, but a user specified a later date/time."> + Value must be <ph name="MAXIMUM_DATE_OR_TIME">$1<ex>12/31/2013</ex></ph> or earlier. </message> <message name="IDS_FORM_VALIDATION_BAD_INPUT_DATETIME" desc="Heading or short sentence shown when a user specified an incomplete value or an invalid date (such as 02/31/2012) to a date/time form control in a webpage."> Please enter a valid value. The field is incomplete or has an invalid date. @@ -662,6 +686,12 @@ below: <message name="IDS_FORM_VALIDATION_PATTERN_MISMATCH" desc="Heading or short sentence shown when a form control value needs to satisfy a pattern specified by the page author, but a user specified unmatched value."> Please match the requested format. </message> + <message name="IDS_FORM_VALIDATION_STEP_MISMATCH" desc="Heading or short sentence shown when a form control value in a webpage should be aligned to a step value specified by the page author, but a user speficified non-aligned value. e.g. A number type field, minimum value is 0, and step value is 4. If A user-specified value is not a multiple of 4, this warning message is shown."> + Please enter a valid value. The two nearest valid values are <ph name="VALID_VALUE_LOW">$1<ex>4</ex></ph> and <ph name="VALID_VALUE_HIGHER">$2<ex>8</ex></ph>. + </message> + <message name="IDS_FORM_VALIDATION_STEP_MISMATCH_CLOSE_TO_LIMIT" desc="Heading or short sentence shown when a form control value in a webpage should be aligned to a step value specified by the page author, but a user speficified non-aligned value. e.g. A number type field, minimum value is 0, and step value is 4. If A user-specified value is not a multiple of 4, this warning message is shown."> + Please enter a valid value. The nearest valid value is <ph name="VALID_VALUE">$1<ex>0</ex></ph>. + </message> <message name="IDS_FORM_VALIDATION_TOO_LONG" desc="Heading or short sentence shown when a form control in a webpage needs to be shorter than a length specified by the page author, but a user specified long value."> Please shorten this text to <ph name="MAX_CHARACTERS">$2<ex>100</ex></ph> characters or less (you are currently using <ph name="CURRENT_LENGTH">$1<ex>101</ex></ph> characters). </message> diff --git a/chromium/webkit/renderer/compositor_bindings/compositor_bindings.gyp b/chromium/webkit/renderer/compositor_bindings/compositor_bindings.gyp index 9cc2b4afaaa..abd2db15214 100644 --- a/chromium/webkit/renderer/compositor_bindings/compositor_bindings.gyp +++ b/chromium/webkit/renderer/compositor_bindings/compositor_bindings.gyp @@ -64,6 +64,8 @@ 'web_layer_impl.h', 'web_layer_impl_fixed_bounds.cc', 'web_layer_impl_fixed_bounds.h', + 'web_nine_patch_layer_impl.cc', + 'web_nine_patch_layer_impl.h', 'web_scrollbar_layer_impl.cc', 'web_scrollbar_layer_impl.h', 'web_solid_color_layer_impl.cc', diff --git a/chromium/webkit/renderer/compositor_bindings/scrollbar_impl.cc b/chromium/webkit/renderer/compositor_bindings/scrollbar_impl.cc index 4f1c4bfad53..332cf7ef7a0 100644 --- a/chromium/webkit/renderer/compositor_bindings/scrollbar_impl.cc +++ b/chromium/webkit/renderer/compositor_bindings/scrollbar_impl.cc @@ -28,6 +28,10 @@ cc::ScrollbarOrientation ScrollbarImpl::Orientation() const { return cc::VERTICAL; } +bool ScrollbarImpl::IsLeftSideVerticalScrollbar() const { + return scrollbar_->isLeftSideVerticalScrollbar(); +} + bool ScrollbarImpl::HasThumb() const { return geometry_->hasThumb(scrollbar_.get()); } diff --git a/chromium/webkit/renderer/compositor_bindings/scrollbar_impl.h b/chromium/webkit/renderer/compositor_bindings/scrollbar_impl.h index 0b6671d20ca..284be63b617 100644 --- a/chromium/webkit/renderer/compositor_bindings/scrollbar_impl.h +++ b/chromium/webkit/renderer/compositor_bindings/scrollbar_impl.h @@ -26,6 +26,7 @@ class ScrollbarImpl : public cc::Scrollbar { // cc::Scrollbar implementation. virtual cc::ScrollbarOrientation Orientation() const OVERRIDE; + virtual bool IsLeftSideVerticalScrollbar() const OVERRIDE; virtual bool HasThumb() const OVERRIDE; virtual bool IsOverlay() const OVERRIDE; virtual gfx::Point Location() const OVERRIDE; diff --git a/chromium/webkit/renderer/compositor_bindings/web_compositing_reasons.cc b/chromium/webkit/renderer/compositor_bindings/web_compositing_reasons.cc index bd7396d7c72..793c40f0de8 100644 --- a/chromium/webkit/renderer/compositor_bindings/web_compositing_reasons.cc +++ b/chromium/webkit/renderer/compositor_bindings/web_compositing_reasons.cc @@ -59,10 +59,6 @@ COMPILE_ASSERT_MATCHING_UINT64( WebKit::CompositingReasonOverflowScrollingTouch); COMPILE_ASSERT_MATCHING_UINT64( - cc::kCompositingReasonBlending, - WebKit::CompositingReasonBlending); - -COMPILE_ASSERT_MATCHING_UINT64( cc::kCompositingReasonAssumedOverlap, WebKit::CompositingReasonAssumedOverlap); @@ -141,3 +137,11 @@ COMPILE_ASSERT_MATCHING_UINT64( COMPILE_ASSERT_MATCHING_UINT64( cc::kCompositingReasonLayerForMask, WebKit::CompositingReasonLayerForMask); + +COMPILE_ASSERT_MATCHING_UINT64( + cc::kCompositingReasonOverflowScrollingParent, + WebKit::CompositingReasonOverflowScrollingParent); + +COMPILE_ASSERT_MATCHING_UINT64( + cc::kCompositingReasonOutOfFlowClipping, + WebKit::CompositingReasonOutOfFlowClipping); diff --git a/chromium/webkit/renderer/compositor_bindings/web_compositor_support_impl.cc b/chromium/webkit/renderer/compositor_bindings/web_compositor_support_impl.cc index 108ff7ae28d..4805dc616da 100644 --- a/chromium/webkit/renderer/compositor_bindings/web_compositor_support_impl.cc +++ b/chromium/webkit/renderer/compositor_bindings/web_compositor_support_impl.cc @@ -17,6 +17,7 @@ #include "webkit/renderer/compositor_bindings/web_float_animation_curve_impl.h" #include "webkit/renderer/compositor_bindings/web_image_layer_impl.h" #include "webkit/renderer/compositor_bindings/web_layer_impl.h" +#include "webkit/renderer/compositor_bindings/web_nine_patch_layer_impl.h" #include "webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.h" #include "webkit/renderer/compositor_bindings/web_solid_color_layer_impl.h" #include "webkit/renderer/compositor_bindings/web_transform_animation_curve_impl.h" @@ -31,6 +32,7 @@ using WebKit::WebExternalTextureLayerClient; using WebKit::WebFilterOperations; using WebKit::WebFloatAnimationCurve; using WebKit::WebImageLayer; +using WebKit::WebNinePatchLayer; using WebKit::WebLayer; using WebKit::WebScrollbar; using WebKit::WebScrollbarLayer; @@ -64,6 +66,10 @@ WebKit::WebImageLayer* WebCompositorSupportImpl::createImageLayer() { return new WebImageLayerImpl(); } +WebKit::WebNinePatchLayer* WebCompositorSupportImpl::createNinePatchLayer() { + return new WebNinePatchLayerImpl(); +} + WebSolidColorLayer* WebCompositorSupportImpl::createSolidColorLayer() { return new WebSolidColorLayerImpl(); } @@ -75,6 +81,20 @@ WebScrollbarLayer* WebCompositorSupportImpl::createScrollbarLayer( return new WebScrollbarLayerImpl(scrollbar, painter, geometry); } +WebScrollbarLayer* WebCompositorSupportImpl::createSolidColorScrollbarLayer( + WebScrollbar::Orientation orientation, int thumb_thickness) { + // TODO(tony): Remove this after the caller in blink is migrated to + // the version which includes |should_place_vertical_scrollbar_on_left|. + return new WebScrollbarLayerImpl(orientation, thumb_thickness, false); +} + +WebScrollbarLayer* WebCompositorSupportImpl::createSolidColorScrollbarLayer( + WebScrollbar::Orientation orientation, int thumb_thickness, + bool is_left_side_vertical_scrollbar) { + return new WebScrollbarLayerImpl(orientation, thumb_thickness, + is_left_side_vertical_scrollbar); +} + WebAnimation* WebCompositorSupportImpl::createAnimation( const WebKit::WebAnimationCurve& curve, WebKit::WebAnimation::TargetProperty target, diff --git a/chromium/webkit/renderer/compositor_bindings/web_compositor_support_impl.h b/chromium/webkit/renderer/compositor_bindings/web_compositor_support_impl.h index 7900465b0f5..f2c25052fd3 100644 --- a/chromium/webkit/renderer/compositor_bindings/web_compositor_support_impl.h +++ b/chromium/webkit/renderer/compositor_bindings/web_compositor_support_impl.h @@ -28,11 +28,17 @@ class WebCompositorSupportImpl : public WebKit::WebCompositorSupport { virtual WebKit::WebExternalTextureLayer* createExternalTextureLayer( WebKit::WebExternalTextureLayerClient* client); virtual WebKit::WebImageLayer* createImageLayer(); + virtual WebKit::WebNinePatchLayer* createNinePatchLayer(); virtual WebKit::WebSolidColorLayer* createSolidColorLayer(); virtual WebKit::WebScrollbarLayer* createScrollbarLayer( WebKit::WebScrollbar* scrollbar, WebKit::WebScrollbarThemePainter painter, WebKit::WebScrollbarThemeGeometry*); + virtual WebKit::WebScrollbarLayer* createSolidColorScrollbarLayer( + WebKit::WebScrollbar::Orientation orientation, int thumb_thickness); + virtual WebKit::WebScrollbarLayer* createSolidColorScrollbarLayer( + WebKit::WebScrollbar::Orientation orientation, int thumb_thickness, + bool is_left_side_vertical_scrollbar); virtual WebKit::WebAnimation* createAnimation( const WebKit::WebAnimationCurve& curve, WebKit::WebAnimation::TargetProperty target, diff --git a/chromium/webkit/renderer/compositor_bindings/web_external_texture_layer_impl.cc b/chromium/webkit/renderer/compositor_bindings/web_external_texture_layer_impl.cc index 36b4994ef62..8e4db549136 100644 --- a/chromium/webkit/renderer/compositor_bindings/web_external_texture_layer_impl.cc +++ b/chromium/webkit/renderer/compositor_bindings/web_external_texture_layer_impl.cc @@ -6,6 +6,8 @@ #include "cc/layers/texture_layer.h" #include "cc/resources/resource_update_queue.h" +#include "cc/resources/single_release_callback.h" +#include "cc/resources/texture_mailbox.h" #include "third_party/WebKit/public/platform/WebExternalTextureLayerClient.h" #include "third_party/WebKit/public/platform/WebExternalTextureMailbox.h" #include "third_party/WebKit/public/platform/WebFloatRect.h" @@ -36,7 +38,8 @@ WebKit::WebLayer* WebExternalTextureLayerImpl::layer() { return layer_.get(); } void WebExternalTextureLayerImpl::clearTexture() { TextureLayer *layer = static_cast<TextureLayer*>(layer_->layer()); layer->WillModifyTexture(); - layer->SetTextureMailbox(cc::TextureMailbox()); + layer->SetTextureMailbox(cc::TextureMailbox(), + scoped_ptr<cc::SingleReleaseCallback>()); } void WebExternalTextureLayerImpl::setOpaque(bool opaque) { @@ -69,6 +72,7 @@ WebKit::WebGraphicsContext3D* WebExternalTextureLayerImpl::Context3d() { bool WebExternalTextureLayerImpl::PrepareTextureMailbox( cc::TextureMailbox* mailbox, + scoped_ptr<cc::SingleReleaseCallback>* release_callback, bool use_shared_memory) { WebKit::WebExternalTextureMailbox client_mailbox; WebExternalBitmapImpl* bitmap = NULL; @@ -82,17 +86,19 @@ bool WebExternalTextureLayerImpl::PrepareTextureMailbox( } gpu::Mailbox name; name.SetName(client_mailbox.name); - cc::TextureMailbox::ReleaseCallback callback = - base::Bind(&WebExternalTextureLayerImpl::DidReleaseMailbox, - this->AsWeakPtr(), - client_mailbox, - bitmap); - if (bitmap) { - *mailbox = - cc::TextureMailbox(bitmap->shared_memory(), bitmap->size(), callback); - } else { - *mailbox = cc::TextureMailbox(name, callback, client_mailbox.syncPoint); + if (bitmap) + *mailbox = cc::TextureMailbox(bitmap->shared_memory(), bitmap->size()); + else + *mailbox = cc::TextureMailbox(name, client_mailbox.syncPoint); + + if (mailbox->IsValid()) { + *release_callback = cc::SingleReleaseCallback::Create(base::Bind( + &WebExternalTextureLayerImpl::DidReleaseMailbox, + this->AsWeakPtr(), + client_mailbox, + bitmap)); } + return true; } diff --git a/chromium/webkit/renderer/compositor_bindings/web_external_texture_layer_impl.h b/chromium/webkit/renderer/compositor_bindings/web_external_texture_layer_impl.h index 3fb798a7716..5992d1a631b 100644 --- a/chromium/webkit/renderer/compositor_bindings/web_external_texture_layer_impl.h +++ b/chromium/webkit/renderer/compositor_bindings/web_external_texture_layer_impl.h @@ -9,10 +9,14 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "cc/layers/texture_layer_client.h" -#include "cc/resources/texture_mailbox.h" #include "third_party/WebKit/public/platform/WebExternalTextureLayer.h" #include "webkit/renderer/compositor_bindings/webkit_compositor_bindings_export.h" +namespace cc { +class SingleReleaseCallback; +class TextureMailbox; +} + namespace WebKit { struct WebFloatRect; struct WebExternalTextureMailbox; @@ -43,8 +47,10 @@ class WebExternalTextureLayerImpl // TextureLayerClient implementation. virtual unsigned PrepareTexture() OVERRIDE; virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; - virtual bool PrepareTextureMailbox(cc::TextureMailbox* mailbox, - bool use_shared_memory) OVERRIDE; + virtual bool PrepareTextureMailbox( + cc::TextureMailbox* mailbox, + scoped_ptr<cc::SingleReleaseCallback>* release_callback, + bool use_shared_memory) OVERRIDE; private: static void DidReleaseMailbox( diff --git a/chromium/webkit/renderer/compositor_bindings/web_layer_impl.cc b/chromium/webkit/renderer/compositor_bindings/web_layer_impl.cc index 0545b3a7de2..f2a3cdea2b6 100644 --- a/chromium/webkit/renderer/compositor_bindings/web_layer_impl.cc +++ b/chromium/webkit/renderer/compositor_bindings/web_layer_impl.cc @@ -13,6 +13,7 @@ #include "third_party/WebKit/public/platform/WebCompositingReasons.h" #include "third_party/WebKit/public/platform/WebFloatPoint.h" #include "third_party/WebKit/public/platform/WebFloatRect.h" +#include "third_party/WebKit/public/platform/WebLayerClient.h" #include "third_party/WebKit/public/platform/WebLayerPositionConstraint.h" #include "third_party/WebKit/public/platform/WebLayerScrollClient.h" #include "third_party/WebKit/public/platform/WebSize.h" @@ -33,13 +34,20 @@ using WebKit::WebFilterOperations; namespace webkit { -WebLayerImpl::WebLayerImpl() : layer_(Layer::Create()) {} +WebLayerImpl::WebLayerImpl() : layer_(Layer::Create()) { + web_layer_client_ = NULL; + layer_->SetLayerClient(this); +} -WebLayerImpl::WebLayerImpl(scoped_refptr<Layer> layer) : layer_(layer) {} +WebLayerImpl::WebLayerImpl(scoped_refptr<Layer> layer) : layer_(layer) { + web_layer_client_ = NULL; + layer_->SetLayerClient(this); +} WebLayerImpl::~WebLayerImpl() { layer_->ClearRenderSurface(); layer_->set_layer_animation_delegate(NULL); + web_layer_client_ = NULL; } int WebLayerImpl::id() const { return layer_->id(); } @@ -174,10 +182,6 @@ void WebLayerImpl::setFilter(SkImageFilter* filter) { layer_->SetFilter(skia::SharePtr(filter)); } -void WebLayerImpl::setDebugName(WebKit::WebString name) { - layer_->SetDebugName(UTF16ToASCII(name)); -} - void WebLayerImpl::setCompositingReasons( WebKit::WebCompositingReasons reasons) { layer_->SetCompositingReasons(reasons); @@ -366,6 +370,29 @@ void WebLayerImpl::setWebLayerClient(WebKit::WebLayerClient* client) { web_layer_client_ = client; } +std::string WebLayerImpl::DebugName() { + if (!web_layer_client_) + return std::string(); + + std::string name = web_layer_client_->debugName(this).utf8(); + DCHECK(IsStringASCII(name)); + return name; +} + +void WebLayerImpl::setScrollParent(WebKit::WebLayer* parent) { + cc::Layer* scroll_parent = NULL; + if (parent) + scroll_parent = static_cast<WebLayerImpl*>(parent)->layer(); + layer_->SetScrollParent(scroll_parent); +} + +void WebLayerImpl::setClipParent(WebKit::WebLayer* parent) { + cc::Layer* clip_parent = NULL; + if (parent) + clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); + layer_->SetClipParent(clip_parent); +} + Layer* WebLayerImpl::layer() const { return layer_.get(); } } // namespace webkit diff --git a/chromium/webkit/renderer/compositor_bindings/web_layer_impl.h b/chromium/webkit/renderer/compositor_bindings/web_layer_impl.h index ee5997d22a6..169b818fb72 100644 --- a/chromium/webkit/renderer/compositor_bindings/web_layer_impl.h +++ b/chromium/webkit/renderer/compositor_bindings/web_layer_impl.h @@ -5,9 +5,13 @@ #ifndef WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_LAYER_IMPL_H_ #define WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_LAYER_IMPL_H_ +#include <string> + #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" +#include "cc/layers/layer_client.h" #include "third_party/WebKit/public/platform/WebAnimation.h" +#include "third_party/WebKit/public/platform/WebCString.h" #include "third_party/WebKit/public/platform/WebColor.h" #include "third_party/WebKit/public/platform/WebCompositingReasons.h" #include "third_party/WebKit/public/platform/WebFloatPoint.h" @@ -35,7 +39,7 @@ namespace webkit { class WebToCCAnimationDelegateAdapter; -class WebLayerImpl : public WebKit::WebLayer { +class WebLayerImpl : public WebKit::WebLayer, public cc::LayerClient { public: WEBKIT_COMPOSITOR_BINDINGS_EXPORT WebLayerImpl(); WEBKIT_COMPOSITOR_BINDINGS_EXPORT explicit WebLayerImpl( @@ -83,7 +87,6 @@ class WebLayerImpl : public WebKit::WebLayer { virtual void setFilter(SkImageFilter* filter); virtual void setFilters(const WebKit::WebFilterOperations& filters); virtual void setBackgroundFilters(const WebKit::WebFilterOperations& filters); - virtual void setDebugName(WebKit::WebString name); virtual void setCompositingReasons(WebKit::WebCompositingReasons); virtual void setAnimationDelegate(WebKit::WebAnimationDelegate* delegate); virtual bool addAnimation(WebKit::WebAnimation* animation); @@ -120,6 +123,12 @@ class WebLayerImpl : public WebKit::WebLayer { virtual bool isOrphan() const; virtual void setWebLayerClient(WebKit::WebLayerClient* client); + // LayerClient implementation. + virtual std::string DebugName() OVERRIDE; + + virtual void setScrollParent(WebKit::WebLayer* parent); + virtual void setClipParent(WebKit::WebLayer* parent); + protected: scoped_refptr<cc::Layer> layer_; WebKit::WebLayerClient* web_layer_client_; diff --git a/chromium/webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds_unittest.cc b/chromium/webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds_unittest.cc index 65f1b52a124..02a2ac37325 100644 --- a/chromium/webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds_unittest.cc +++ b/chromium/webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds_unittest.cc @@ -33,7 +33,7 @@ TEST(WebLayerImplFixedBoundsTest, IdentityBounds) { gfx::Point3F TransformPoint(const gfx::Transform& transform, const gfx::Point3F& point) { gfx::Point3F result = point; - transform.TransformPoint(result); + transform.TransformPoint(&result); return result; } diff --git a/chromium/webkit/renderer/compositor_bindings/web_nine_patch_layer_impl.cc b/chromium/webkit/renderer/compositor_bindings/web_nine_patch_layer_impl.cc new file mode 100644 index 00000000000..0c64a062fec --- /dev/null +++ b/chromium/webkit/renderer/compositor_bindings/web_nine_patch_layer_impl.cc @@ -0,0 +1,30 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "webkit/renderer/compositor_bindings/web_nine_patch_layer_impl.h" + +#include "base/command_line.h" +#include "cc/base/switches.h" +#include "cc/layers/nine_patch_layer.h" +#include "cc/layers/picture_image_layer.h" +#include "webkit/renderer/compositor_bindings/web_layer_impl.h" +#include "webkit/renderer/compositor_bindings/web_layer_impl_fixed_bounds.h" + +namespace webkit { + +WebNinePatchLayerImpl::WebNinePatchLayerImpl() { + layer_.reset(new WebLayerImpl(cc::NinePatchLayer::Create())); +} + +WebNinePatchLayerImpl::~WebNinePatchLayerImpl() {} + +WebKit::WebLayer* WebNinePatchLayerImpl::layer() { return layer_.get(); } + +void WebNinePatchLayerImpl::setBitmap(SkBitmap bitmap, + const WebKit::WebRect& aperture) { + static_cast<cc::NinePatchLayer*>(layer_->layer())->SetBitmap( + bitmap, gfx::Rect(aperture)); +} + +} // namespace webkit diff --git a/chromium/webkit/renderer/compositor_bindings/web_nine_patch_layer_impl.h b/chromium/webkit/renderer/compositor_bindings/web_nine_patch_layer_impl.h new file mode 100644 index 00000000000..34c8effc9cc --- /dev/null +++ b/chromium/webkit/renderer/compositor_bindings/web_nine_patch_layer_impl.h @@ -0,0 +1,34 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_NINE_PATCH_LAYER_IMPL_H_ +#define WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_NINE_PATCH_LAYER_IMPL_H_ + +#include "base/memory/scoped_ptr.h" +#include "third_party/WebKit/public/platform/WebNinePatchLayer.h" +#include "third_party/skia/include/core/SkBitmap.h" +#include "webkit/renderer/compositor_bindings/webkit_compositor_bindings_export.h" + +namespace webkit { + +class WebLayerImpl; + +class WebNinePatchLayerImpl : public WebKit::WebNinePatchLayer { + public: + WEBKIT_COMPOSITOR_BINDINGS_EXPORT WebNinePatchLayerImpl(); + virtual ~WebNinePatchLayerImpl(); + + // WebKit::WebNinePatchLayer implementation. + virtual WebKit::WebLayer* layer(); + virtual void setBitmap(SkBitmap, const WebKit::WebRect& aperture); + + private: + scoped_ptr<WebLayerImpl> layer_; + + DISALLOW_COPY_AND_ASSIGN(WebNinePatchLayerImpl); +}; + +} // namespace webkit + +#endif // WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_NINE_PATCH_LAYER_IMPL_H_ diff --git a/chromium/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc b/chromium/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc index a8080212beb..68a35d333c8 100644 --- a/chromium/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc +++ b/chromium/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc @@ -4,12 +4,24 @@ #include "webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.h" -#include "cc/layers/scrollbar_layer.h" -#include "third_party/WebKit/public/platform/WebScrollbar.h" +#include "cc/layers/painted_scrollbar_layer.h" +#include "cc/layers/scrollbar_layer_interface.h" +#include "cc/layers/solid_color_scrollbar_layer.h" #include "webkit/renderer/compositor_bindings/scrollbar_impl.h" #include "webkit/renderer/compositor_bindings/web_layer_impl.h" -using cc::ScrollbarLayer; +using cc::PaintedScrollbarLayer; +using cc::SolidColorScrollbarLayer; + +namespace { + +cc::ScrollbarOrientation ConvertOrientation( + WebKit::WebScrollbar::Orientation orientation) { + return orientation == WebKit::WebScrollbar::Horizontal ? cc::HORIZONTAL + : cc::VERTICAL; +} + +} // namespace namespace webkit { @@ -17,19 +29,30 @@ WebScrollbarLayerImpl::WebScrollbarLayerImpl( WebKit::WebScrollbar* scrollbar, WebKit::WebScrollbarThemePainter painter, WebKit::WebScrollbarThemeGeometry* geometry) - : layer_(new WebLayerImpl(ScrollbarLayer::Create( + : layer_(new WebLayerImpl(PaintedScrollbarLayer::Create( scoped_ptr<cc::Scrollbar>(new ScrollbarImpl( make_scoped_ptr(scrollbar), painter, make_scoped_ptr(geometry))).Pass(), 0))) {} +WebScrollbarLayerImpl::WebScrollbarLayerImpl( + WebKit::WebScrollbar::Orientation orientation, + int thumb_thickness, + bool is_left_side_vertical_scrollbar) + : layer_(new WebLayerImpl( + SolidColorScrollbarLayer::Create( + ConvertOrientation(orientation), + thumb_thickness, + is_left_side_vertical_scrollbar, + 0))) {} + WebScrollbarLayerImpl::~WebScrollbarLayerImpl() {} WebKit::WebLayer* WebScrollbarLayerImpl::layer() { return layer_.get(); } void WebScrollbarLayerImpl::setScrollLayer(WebKit::WebLayer* layer) { int id = layer ? static_cast<WebLayerImpl*>(layer)->layer()->id() : 0; - static_cast<ScrollbarLayer*>(layer_->layer())->SetScrollLayerId(id); + static_cast<PaintedScrollbarLayer*>(layer_->layer())->SetScrollLayerId(id); } } // namespace webkit diff --git a/chromium/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.h b/chromium/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.h index de7bbfda024..a96ca9894ed 100644 --- a/chromium/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.h +++ b/chromium/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.h @@ -6,11 +6,11 @@ #define WEBKIT_RENDERER_COMPOSITOR_BINDINGS_WEB_SCROLLBAR_LAYER_IMPL_H_ #include "base/memory/scoped_ptr.h" +#include "third_party/WebKit/public/platform/WebScrollbar.h" #include "third_party/WebKit/public/platform/WebScrollbarLayer.h" #include "webkit/renderer/compositor_bindings/webkit_compositor_bindings_export.h" namespace WebKit { -class WebScrollbar; class WebScrollbarThemeGeometry; class WebScrollbarThemePainter; } @@ -25,6 +25,10 @@ class WebScrollbarLayerImpl : public WebKit::WebScrollbarLayer { WebKit::WebScrollbar* scrollbar, WebKit::WebScrollbarThemePainter painter, WebKit::WebScrollbarThemeGeometry* geometry); + WEBKIT_COMPOSITOR_BINDINGS_EXPORT WebScrollbarLayerImpl( + WebKit::WebScrollbar::Orientation orientation, + int thumb_thickness, + bool is_left_side_vertical_scrollbar); virtual ~WebScrollbarLayerImpl(); // WebKit::WebScrollbarLayer implementation. diff --git a/chromium/webkit/renderer/fileapi/OWNERS b/chromium/webkit/renderer/fileapi/OWNERS deleted file mode 100644 index 13c32887350..00000000000 --- a/chromium/webkit/renderer/fileapi/OWNERS +++ /dev/null @@ -1 +0,0 @@ -ericu@chromium.org diff --git a/chromium/webkit/renderer/fileapi/webfilewriter_base.cc b/chromium/webkit/renderer/fileapi/webfilewriter_base.cc deleted file mode 100644 index 92c7ae1db20..00000000000 --- a/chromium/webkit/renderer/fileapi/webfilewriter_base.cc +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/renderer/fileapi/webfilewriter_base.h" - -#include "base/logging.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/web/WebFileError.h" -#include "third_party/WebKit/public/web/WebFileWriterClient.h" -#include "webkit/common/fileapi/file_system_util.h" - -namespace fileapi { - -WebFileWriterBase::WebFileWriterBase( - const GURL& path, WebKit::WebFileWriterClient* client) - : path_(path), - client_(client), - operation_(kOperationNone), - cancel_state_(kCancelNotInProgress) { -} - -WebFileWriterBase::~WebFileWriterBase() { -} - -void WebFileWriterBase::truncate(long long length) { - DCHECK(kOperationNone == operation_); - DCHECK(kCancelNotInProgress == cancel_state_); - operation_ = kOperationTruncate; - DoTruncate(path_, length); -} - -void WebFileWriterBase::write( - long long position, - const WebKit::WebURL& blob_url) { - DCHECK(kOperationNone == operation_); - DCHECK(kCancelNotInProgress == cancel_state_); - operation_ = kOperationWrite; - DoWrite(path_, blob_url, position); -} - -// When we cancel a write/truncate, we always get back the result of the write -// before the result of the cancel, no matter what happens. -// So we'll get back either -// success [of the write/truncate, in a DidWrite(XXX, true)/DidSucceed() call] -// followed by failure [of the cancel]; or -// failure [of the write, either from cancel or other reasons] followed by -// the result of the cancel. -// In the write case, there could also be queued up non-terminal DidWrite calls -// before any of that comes back, but there will always be a terminal write -// response [success or failure] after them, followed by the cancel result, so -// we can ignore non-terminal write responses, take the terminal write success -// or the first failure as the last write response, then know that the next -// thing to come back is the cancel response. We only notify the -// AsyncFileWriterClient when it's all over. -void WebFileWriterBase::cancel() { - // Check for the cancel passing the previous operation's return in-flight. - if (kOperationWrite != operation_ && kOperationTruncate != operation_) - return; - if (kCancelNotInProgress != cancel_state_) - return; - cancel_state_ = kCancelSent; - DoCancel(); -} - -void WebFileWriterBase::DidFinish(base::PlatformFileError error_code) { - if (error_code == base::PLATFORM_FILE_OK) - DidSucceed(); - else - DidFail(error_code); -} - -void WebFileWriterBase::DidWrite(int64 bytes, bool complete) { - DCHECK(kOperationWrite == operation_); - switch (cancel_state_) { - case kCancelNotInProgress: - if (complete) - operation_ = kOperationNone; - client_->didWrite(bytes, complete); - break; - case kCancelSent: - // This is the success call of the write, which we'll eat, even though - // it succeeded before the cancel got there. We accepted the cancel call, - // so the write will eventually return an error. - if (complete) - cancel_state_ = kCancelReceivedWriteResponse; - break; - case kCancelReceivedWriteResponse: - default: - NOTREACHED(); - } -} - -void WebFileWriterBase::DidSucceed() { - // Write never gets a DidSucceed call, so this is either a cancel or truncate - // response. - switch (cancel_state_) { - case kCancelNotInProgress: - // A truncate succeeded, with no complications. - DCHECK(kOperationTruncate == operation_); - operation_ = kOperationNone; - client_->didTruncate(); - break; - case kCancelSent: - DCHECK(kOperationTruncate == operation_); - // This is the success call of the truncate, which we'll eat, even though - // it succeeded before the cancel got there. We accepted the cancel call, - // so the truncate will eventually return an error. - cancel_state_ = kCancelReceivedWriteResponse; - break; - case kCancelReceivedWriteResponse: - // This is the success of the cancel operation. - FinishCancel(); - break; - default: - NOTREACHED(); - } -} - -void WebFileWriterBase::DidFail(base::PlatformFileError error_code) { - DCHECK(kOperationNone != operation_); - switch (cancel_state_) { - case kCancelNotInProgress: - // A write or truncate failed. - operation_ = kOperationNone; - client_->didFail( - PlatformFileErrorToWebFileError(error_code)); - break; - case kCancelSent: - // This is the failure of a write or truncate; the next message should be - // the result of the cancel. We don't assume that it'll be a success, as - // the write/truncate could have failed for other reasons. - cancel_state_ = kCancelReceivedWriteResponse; - break; - case kCancelReceivedWriteResponse: - // The cancel reported failure, meaning that the write or truncate - // finished before the cancel got there. But we suppressed the - // write/truncate's response, and will now report that it was cancelled. - FinishCancel(); - break; - default: - NOTREACHED(); - } -} - -void WebFileWriterBase::FinishCancel() { - DCHECK(kCancelReceivedWriteResponse == cancel_state_); - DCHECK(kOperationNone != operation_); - cancel_state_ = kCancelNotInProgress; - operation_ = kOperationNone; - client_->didFail(WebKit::WebFileErrorAbort); -} - -} // namespace fileapi diff --git a/chromium/webkit/renderer/fileapi/webfilewriter_base.h b/chromium/webkit/renderer/fileapi/webfilewriter_base.h deleted file mode 100644 index dc1d730163d..00000000000 --- a/chromium/webkit/renderer/fileapi/webfilewriter_base.h +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_RENDERER_FILEAPI_WEBFILEWRITER_BASE_H_ -#define WEBKIT_RENDERER_FILEAPI_WEBFILEWRITER_BASE_H_ - -#include "base/platform_file.h" -#include "third_party/WebKit/public/web/WebFileWriter.h" -#include "url/gurl.h" -#include "webkit/renderer/webkit_storage_renderer_export.h" - -namespace WebKit { -class WebFileWriterClient; -class WebURL; -} - -namespace fileapi { - -class WEBKIT_STORAGE_RENDERER_EXPORT WebFileWriterBase - : public NON_EXPORTED_BASE(WebKit::WebFileWriter) { - public: - WebFileWriterBase( - const GURL& path, WebKit::WebFileWriterClient* client); - virtual ~WebFileWriterBase(); - - // WebFileWriter implementation - virtual void truncate(long long length); - virtual void write(long long position, const WebKit::WebURL& blobURL); - virtual void cancel(); - - protected: - // This calls DidSucceed() or DidFail() based on the value of |error_code|. - void DidFinish(base::PlatformFileError error_code); - - void DidWrite(int64 bytes, bool complete); - void DidSucceed(); - void DidFail(base::PlatformFileError error_code); - - // Derived classes must provide these methods to asynchronously perform - // the requested operation, and they must call the appropiate DidSomething - // method upon completion and as progress is made in the Write case. - virtual void DoTruncate(const GURL& path, int64 offset) = 0; - virtual void DoWrite(const GURL& path, const GURL& blob_url, - int64 offset) = 0; - virtual void DoCancel() = 0; - - private: - enum OperationType { - kOperationNone, - kOperationWrite, - kOperationTruncate - }; - - enum CancelState { - kCancelNotInProgress, - kCancelSent, - kCancelReceivedWriteResponse, - }; - - void FinishCancel(); - - GURL path_; - WebKit::WebFileWriterClient* client_; - OperationType operation_; - CancelState cancel_state_; -}; - -} // namespace fileapi - -#endif // WEBKIT_RENDERER_FILEAPI_WEBFILEWRITER_BASE_H_ diff --git a/chromium/webkit/renderer/fileapi/webfilewriter_base_unittest.cc b/chromium/webkit/renderer/fileapi/webfilewriter_base_unittest.cc deleted file mode 100644 index d7067380b95..00000000000 --- a/chromium/webkit/renderer/fileapi/webfilewriter_base_unittest.cc +++ /dev/null @@ -1,411 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/renderer/fileapi/webfilewriter_base.h" - -#include "base/logging.h" -#include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop.h" -#include "base/strings/utf_string_conversions.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/web/WebFileError.h" -#include "third_party/WebKit/public/web/WebFileWriterClient.h" -#include "url/gurl.h" - -namespace fileapi { - -namespace { - -// We use particular offsets to trigger particular behaviors -// in the TestableFileWriter. -const int kNoOffset = -1; -const int kBasicFileTruncate_Offset = 1; -const int kErrorFileTruncate_Offset = 2; -const int kCancelFileTruncate_Offset = 3; -const int kCancelFailedTruncate_Offset = 4; -const int kBasicFileWrite_Offset = 1; -const int kErrorFileWrite_Offset = 2; -const int kMultiFileWrite_Offset = 3; -const int kCancelFileWriteBeforeCompletion_Offset = 4; -const int kCancelFileWriteAfterCompletion_Offset = 5; - -GURL mock_path_as_gurl() { - return GURL("MockPath"); -} - -} // namespace - -class TestableFileWriter : public WebFileWriterBase { - public: - explicit TestableFileWriter(WebKit::WebFileWriterClient* client) - : WebFileWriterBase(mock_path_as_gurl(), client) { - reset(); - } - - void reset() { - received_truncate_ = false; - received_truncate_path_ = GURL(); - received_truncate_offset_ = kNoOffset; - received_write_ = false; - received_write_path_ = GURL(); - received_write_offset_ = kNoOffset; - received_write_blob_url_ = GURL(); - received_cancel_ = false; - } - - bool received_truncate_; - GURL received_truncate_path_; - int64 received_truncate_offset_; - bool received_write_; - GURL received_write_path_; - GURL received_write_blob_url_; - int64 received_write_offset_; - bool received_cancel_; - - protected: - virtual void DoTruncate(const GURL& path, int64 offset) OVERRIDE { - received_truncate_ = true; - received_truncate_path_ = path; - received_truncate_offset_ = offset; - - if (offset == kBasicFileTruncate_Offset) { - DidSucceed(); - } else if (offset == kErrorFileTruncate_Offset) { - DidFail(base::PLATFORM_FILE_ERROR_NOT_FOUND); - } else if (offset == kCancelFileTruncate_Offset) { - cancel(); - DidSucceed(); // truncate completion - DidSucceed(); // cancel completion - } else if (offset == kCancelFailedTruncate_Offset) { - cancel(); - DidFail(base::PLATFORM_FILE_ERROR_NOT_FOUND); // truncate completion - DidSucceed(); // cancel completion - } else { - FAIL(); - } - } - - virtual void DoWrite(const GURL& path, const GURL& blob_url, - int64 offset) OVERRIDE { - received_write_ = true; - received_write_path_ = path; - received_write_offset_ = offset; - received_write_blob_url_ = blob_url; - - if (offset == kBasicFileWrite_Offset) { - DidWrite(1, true); - } else if (offset == kErrorFileWrite_Offset) { - DidFail(base::PLATFORM_FILE_ERROR_NOT_FOUND); - } else if (offset == kMultiFileWrite_Offset) { - DidWrite(1, false); - DidWrite(1, false); - DidWrite(1, true); - } else if (offset == kCancelFileWriteBeforeCompletion_Offset) { - DidWrite(1, false); - cancel(); - DidWrite(1, false); - DidWrite(1, false); - DidFail(base::PLATFORM_FILE_ERROR_FAILED); // write completion - DidSucceed(); // cancel completion - } else if (offset == kCancelFileWriteAfterCompletion_Offset) { - DidWrite(1, false); - cancel(); - DidWrite(1, false); - DidWrite(1, false); - DidWrite(1, true); // write completion - DidFail(base::PLATFORM_FILE_ERROR_FAILED); // cancel completion - } else { - FAIL(); - } - } - - virtual void DoCancel() OVERRIDE { - received_cancel_ = true; - } -}; - -class FileWriterTest : public testing::Test, - public WebKit::WebFileWriterClient { - public: - FileWriterTest() { - reset(); - } - - WebKit::WebFileWriter* writer() { - return testable_writer_.get(); - } - - // WebFileWriterClient overrides - virtual void didWrite(long long bytes, bool complete) { - EXPECT_FALSE(received_did_write_complete_); - ++received_did_write_count_; - received_did_write_bytes_total_ += bytes; - if (complete) - received_did_write_complete_ = true; - - if (delete_in_client_callback_) - testable_writer_.reset(NULL); - } - - virtual void didTruncate() { - EXPECT_FALSE(received_did_truncate_); - received_did_truncate_ = true; - if (delete_in_client_callback_) - testable_writer_.reset(NULL); - } - - virtual void didFail(WebKit::WebFileError error) { - EXPECT_FALSE(received_did_fail_); - received_did_fail_ = true; - fail_error_received_ = error; - if (delete_in_client_callback_) - testable_writer_.reset(NULL); - } - - protected: - void reset() { - testable_writer_.reset(new TestableFileWriter(this)); - delete_in_client_callback_ = false; - received_did_write_count_ = 0; - received_did_write_bytes_total_ = 0; - received_did_write_complete_ = false; - received_did_truncate_ = false; - received_did_fail_ = false; - fail_error_received_ = static_cast<WebKit::WebFileError>(0); - } - - scoped_ptr<TestableFileWriter> testable_writer_; - bool delete_in_client_callback_; - - // Observed WebFileWriterClient artifacts. - int received_did_write_count_; - long long received_did_write_bytes_total_; - bool received_did_write_complete_; - bool received_did_truncate_; - bool received_did_fail_; - WebKit::WebFileError fail_error_received_; - - DISALLOW_COPY_AND_ASSIGN(FileWriterTest); -}; - -TEST_F(FileWriterTest, BasicFileWrite) { - // Call the webkit facing api. - const GURL kBlobUrl("blob://bloburl/"); - writer()->write(kBasicFileWrite_Offset, kBlobUrl); - - // Check that the derived class gets called correctly. - EXPECT_TRUE(testable_writer_->received_write_); - EXPECT_EQ(testable_writer_->received_write_path_, - mock_path_as_gurl()); - EXPECT_EQ(kBasicFileWrite_Offset, - testable_writer_->received_write_offset_); - EXPECT_EQ(kBlobUrl, testable_writer_->received_write_blob_url_); - EXPECT_FALSE(testable_writer_->received_truncate_); - EXPECT_FALSE(testable_writer_->received_cancel_); - - // Check that the client gets called correctly. - EXPECT_EQ(1, received_did_write_count_); - EXPECT_TRUE(received_did_write_complete_); - EXPECT_EQ(1, received_did_write_bytes_total_); - EXPECT_FALSE(received_did_truncate_); - EXPECT_FALSE(received_did_fail_); -} - -TEST_F(FileWriterTest, BasicFileTruncate) { - // Call the webkit facing api. - writer()->truncate(kBasicFileTruncate_Offset); - - // Check that the derived class gets called correctly. - EXPECT_TRUE(testable_writer_->received_truncate_); - EXPECT_EQ(mock_path_as_gurl(), - testable_writer_->received_truncate_path_); - EXPECT_EQ(kBasicFileTruncate_Offset, - testable_writer_->received_truncate_offset_); - EXPECT_FALSE(testable_writer_->received_write_); - EXPECT_FALSE(testable_writer_->received_cancel_); - - // Check that the client gets called correctly. - EXPECT_TRUE(received_did_truncate_); - EXPECT_EQ(0, received_did_write_count_); - EXPECT_FALSE(received_did_fail_); -} - -TEST_F(FileWriterTest, ErrorFileWrite) { - // Call the webkit facing api. - const GURL kBlobUrl("blob://bloburl/"); - writer()->write(kErrorFileWrite_Offset, kBlobUrl); - - // Check that the derived class gets called correctly. - EXPECT_TRUE(testable_writer_->received_write_); - EXPECT_EQ(testable_writer_->received_write_path_, - mock_path_as_gurl()); - EXPECT_EQ(kErrorFileWrite_Offset, - testable_writer_->received_write_offset_); - EXPECT_EQ(kBlobUrl, testable_writer_->received_write_blob_url_); - EXPECT_FALSE(testable_writer_->received_truncate_); - EXPECT_FALSE(testable_writer_->received_cancel_); - - // Check that the client gets called correctly. - EXPECT_TRUE(received_did_fail_); - EXPECT_EQ(WebKit::WebFileErrorNotFound, fail_error_received_); - EXPECT_EQ(0, received_did_write_count_); - EXPECT_FALSE(received_did_truncate_); -} - -TEST_F(FileWriterTest, ErrorFileTruncate) { - // Call the webkit facing api. - writer()->truncate(kErrorFileTruncate_Offset); - - // Check that the derived class gets called correctly. - EXPECT_TRUE(testable_writer_->received_truncate_); - EXPECT_EQ(mock_path_as_gurl(), - testable_writer_->received_truncate_path_); - EXPECT_EQ(kErrorFileTruncate_Offset, - testable_writer_->received_truncate_offset_); - EXPECT_FALSE(testable_writer_->received_write_); - EXPECT_FALSE(testable_writer_->received_cancel_); - - // Check that the client gets called correctly. - EXPECT_TRUE(received_did_fail_); - EXPECT_EQ(WebKit::WebFileErrorNotFound, fail_error_received_); - EXPECT_FALSE(received_did_truncate_); - EXPECT_EQ(0, received_did_write_count_); -} - -TEST_F(FileWriterTest, MultiFileWrite) { - // Call the webkit facing api. - const GURL kBlobUrl("blob://bloburl/"); - writer()->write(kMultiFileWrite_Offset, kBlobUrl); - - // Check that the derived class gets called correctly. - EXPECT_TRUE(testable_writer_->received_write_); - EXPECT_EQ(testable_writer_->received_write_path_, - mock_path_as_gurl()); - EXPECT_EQ(kMultiFileWrite_Offset, - testable_writer_->received_write_offset_); - EXPECT_EQ(kBlobUrl, testable_writer_->received_write_blob_url_); - EXPECT_FALSE(testable_writer_->received_truncate_); - EXPECT_FALSE(testable_writer_->received_cancel_); - - // Check that the client gets called correctly. - EXPECT_EQ(3, received_did_write_count_); - EXPECT_TRUE(received_did_write_complete_); - EXPECT_EQ(3, received_did_write_bytes_total_); - EXPECT_FALSE(received_did_truncate_); - EXPECT_FALSE(received_did_fail_); -} - -TEST_F(FileWriterTest, CancelFileWriteBeforeCompletion) { - // Call the webkit facing api. - const GURL kBlobUrl("blob://bloburl/"); - writer()->write(kCancelFileWriteBeforeCompletion_Offset, kBlobUrl); - - // Check that the derived class gets called correctly. - EXPECT_TRUE(testable_writer_->received_write_); - EXPECT_EQ(testable_writer_->received_write_path_, - mock_path_as_gurl()); - EXPECT_EQ(kCancelFileWriteBeforeCompletion_Offset, - testable_writer_->received_write_offset_); - EXPECT_EQ(kBlobUrl, testable_writer_->received_write_blob_url_); - EXPECT_TRUE(testable_writer_->received_cancel_); - EXPECT_FALSE(testable_writer_->received_truncate_); - - // Check that the client gets called correctly. - EXPECT_TRUE(received_did_fail_); - EXPECT_EQ(WebKit::WebFileErrorAbort, fail_error_received_); - EXPECT_EQ(1, received_did_write_count_); - EXPECT_FALSE(received_did_write_complete_); - EXPECT_EQ(1, received_did_write_bytes_total_); - EXPECT_FALSE(received_did_truncate_); -} - -TEST_F(FileWriterTest, CancelFileWriteAfterCompletion) { - // Call the webkit facing api. - const GURL kBlobUrl("blob://bloburl/"); - writer()->write(kCancelFileWriteAfterCompletion_Offset, kBlobUrl); - - // Check that the derived class gets called correctly. - EXPECT_TRUE(testable_writer_->received_write_); - EXPECT_EQ(testable_writer_->received_write_path_, - mock_path_as_gurl()); - EXPECT_EQ(kCancelFileWriteAfterCompletion_Offset, - testable_writer_->received_write_offset_); - EXPECT_EQ(kBlobUrl, testable_writer_->received_write_blob_url_); - EXPECT_TRUE(testable_writer_->received_cancel_); - EXPECT_FALSE(testable_writer_->received_truncate_); - - // Check that the client gets called correctly. - EXPECT_TRUE(received_did_fail_); - EXPECT_EQ(WebKit::WebFileErrorAbort, fail_error_received_); - EXPECT_EQ(1, received_did_write_count_); - EXPECT_FALSE(received_did_write_complete_); - EXPECT_EQ(1, received_did_write_bytes_total_); - EXPECT_FALSE(received_did_truncate_); -} - -TEST_F(FileWriterTest, CancelFileTruncate) { - // Call the webkit facing api. - writer()->truncate(kCancelFileTruncate_Offset); - - // Check that the derived class gets called correctly. - EXPECT_TRUE(testable_writer_->received_truncate_); - EXPECT_EQ(mock_path_as_gurl(), - testable_writer_->received_truncate_path_); - EXPECT_EQ(kCancelFileTruncate_Offset, - testable_writer_->received_truncate_offset_); - EXPECT_TRUE(testable_writer_->received_cancel_); - EXPECT_FALSE(testable_writer_->received_write_); - - // Check that the client gets called correctly. - EXPECT_TRUE(received_did_fail_); - EXPECT_EQ(WebKit::WebFileErrorAbort, fail_error_received_); - EXPECT_FALSE(received_did_truncate_); - EXPECT_EQ(0, received_did_write_count_); -} - -TEST_F(FileWriterTest, CancelFailedTruncate) { - // Call the webkit facing api. - writer()->truncate(kCancelFailedTruncate_Offset); - - // Check that the derived class gets called correctly. - EXPECT_TRUE(testable_writer_->received_truncate_); - EXPECT_EQ(mock_path_as_gurl(), - testable_writer_->received_truncate_path_); - EXPECT_EQ(kCancelFailedTruncate_Offset, - testable_writer_->received_truncate_offset_); - EXPECT_TRUE(testable_writer_->received_cancel_); - EXPECT_FALSE(testable_writer_->received_write_); - - // Check that the client gets called correctly. - EXPECT_TRUE(received_did_fail_); - EXPECT_EQ(WebKit::WebFileErrorAbort, fail_error_received_); - EXPECT_FALSE(received_did_truncate_); - EXPECT_EQ(0, received_did_write_count_); -} - -TEST_F(FileWriterTest, DeleteInCompletionCallbacks) { - delete_in_client_callback_ = true; - writer()->write(kBasicFileWrite_Offset, GURL("blob://bloburl/")); - EXPECT_FALSE(testable_writer_.get()); - - reset(); - delete_in_client_callback_ = true; - writer()->truncate(kBasicFileTruncate_Offset); - EXPECT_FALSE(testable_writer_.get()); - - reset(); - delete_in_client_callback_ = true; - writer()->write(kErrorFileWrite_Offset, GURL("blob://bloburl/")); - EXPECT_FALSE(testable_writer_.get()); - - reset(); - delete_in_client_callback_ = true; - writer()->truncate(kErrorFileTruncate_Offset); - EXPECT_FALSE(testable_writer_.get()); - - // Not crashing counts as passing. -} - -} // namespace fileapi diff --git a/chromium/webkit/renderer/webkit_renderer.gyp b/chromium/webkit/renderer/webkit_renderer.gyp index f698d8c1f0e..2e85bf969f9 100644 --- a/chromium/webkit/renderer/webkit_renderer.gyp +++ b/chromium/webkit/renderer/webkit_renderer.gyp @@ -30,8 +30,6 @@ 'clipboard_utils.cc', 'clipboard_utils.h', 'webkit_renderer_export.h', - 'webpreferences_renderer.cc', - 'webpreferences_renderer.h', ], }, ], diff --git a/chromium/webkit/renderer/webkit_storage_renderer_export.h b/chromium/webkit/renderer/webkit_storage_renderer_export.h deleted file mode 100644 index 4225bc683e9..00000000000 --- a/chromium/webkit/renderer/webkit_storage_renderer_export.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_RENDERER_WEBKIT_STORAGE_RENDERER_EXPORT_H_ -#define WEBKIT_RENDERER_WEBKIT_STORAGE_RENDERER_EXPORT_H_ - -#if defined(COMPONENT_BUILD) -#if defined(WIN32) - -#if defined(WEBKIT_STORAGE_RENDERER_IMPLEMENTATION) -#define WEBKIT_STORAGE_RENDERER_EXPORT __declspec(dllexport) -#else -#define WEBKIT_STORAGE_RENDERER_EXPORT __declspec(dllimport) -#endif // defined(WEBKIT_STORAGE_RENDERER_IMPLEMENTATION) - -#else // defined(WIN32) -#if defined(WEBKIT_STORAGE_RENDERER_IMPLEMENTATION) -#define WEBKIT_STORAGE_RENDERER_EXPORT __attribute__((visibility("default"))) -#else -#define WEBKIT_STORAGE_RENDERER_EXPORT -#endif -#endif - -#else // defined(COMPONENT_BUILD) -#define WEBKIT_STORAGE_RENDERER_EXPORT -#endif - -#endif // WEBKIT_RENDERER_WEBKIT_STORAGE_RENDERER_EXPORT_H_ diff --git a/chromium/webkit/renderer/webpreferences_renderer.cc b/chromium/webkit/renderer/webpreferences_renderer.cc deleted file mode 100644 index 5952110c88e..00000000000 --- a/chromium/webkit/renderer/webpreferences_renderer.cc +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/renderer/webpreferences_renderer.h" - -#include "base/strings/utf_string_conversions.h" -#include "third_party/WebKit/public/web/WebKit.h" -#include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" -#include "third_party/WebKit/public/web/WebRuntimeFeatures.h" -#include "third_party/WebKit/public/web/WebSettings.h" -#include "third_party/WebKit/public/web/WebView.h" -#include "third_party/WebKit/public/platform/WebString.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/icu/source/common/unicode/uchar.h" -#include "third_party/icu/source/common/unicode/uscript.h" -#include "webkit/common/webpreferences.h" - -using WebKit::WebNetworkStateNotifier; -using WebKit::WebRuntimeFeatures; -using WebKit::WebSettings; -using WebKit::WebString; -using WebKit::WebURL; -using WebKit::WebView; - -namespace { - -typedef void (*SetFontFamilyWrapper)( - WebKit::WebSettings*, const base::string16&, UScriptCode); - -void setStandardFontFamilyWrapper(WebSettings* settings, - const base::string16& font, - UScriptCode script) { - settings->setStandardFontFamily(font, script); -} - -void setFixedFontFamilyWrapper(WebSettings* settings, - const base::string16& font, - UScriptCode script) { - settings->setFixedFontFamily(font, script); -} - -void setSerifFontFamilyWrapper(WebSettings* settings, - const base::string16& font, - UScriptCode script) { - settings->setSerifFontFamily(font, script); -} - -void setSansSerifFontFamilyWrapper(WebSettings* settings, - const base::string16& font, - UScriptCode script) { - settings->setSansSerifFontFamily(font, script); -} - -void setCursiveFontFamilyWrapper(WebSettings* settings, - const base::string16& font, - UScriptCode script) { - settings->setCursiveFontFamily(font, script); -} - -void setFantasyFontFamilyWrapper(WebSettings* settings, - const base::string16& font, - UScriptCode script) { - settings->setFantasyFontFamily(font, script); -} - -void setPictographFontFamilyWrapper(WebSettings* settings, - const base::string16& font, - UScriptCode script) { - settings->setPictographFontFamily(font, script); -} - -// If |scriptCode| is a member of a family of "similar" script codes, returns -// the script code in that family that is used by WebKit for font selection -// purposes. For example, USCRIPT_KATAKANA_OR_HIRAGANA and USCRIPT_JAPANESE are -// considered equivalent for the purposes of font selection. WebKit uses the -// script code USCRIPT_KATAKANA_OR_HIRAGANA. So, if |scriptCode| is -// USCRIPT_JAPANESE, the function returns USCRIPT_KATAKANA_OR_HIRAGANA. WebKit -// uses different scripts than the ones in Chrome pref names because the version -// of ICU included on certain ports does not have some of the newer scripts. If -// |scriptCode| is not a member of such a family, returns |scriptCode|. -UScriptCode GetScriptForWebSettings(UScriptCode scriptCode) { - switch (scriptCode) { - case USCRIPT_HIRAGANA: - case USCRIPT_KATAKANA: - case USCRIPT_JAPANESE: - return USCRIPT_KATAKANA_OR_HIRAGANA; - case USCRIPT_KOREAN: - return USCRIPT_HANGUL; - default: - return scriptCode; - } -} - -void ApplyFontsFromMap(const webkit_glue::ScriptFontFamilyMap& map, - SetFontFamilyWrapper setter, - WebSettings* settings) { - for (webkit_glue::ScriptFontFamilyMap::const_iterator it = map.begin(); - it != map.end(); ++it) { - int32 script = u_getPropertyValueEnum(UCHAR_SCRIPT, (it->first).c_str()); - if (script >= 0 && script < USCRIPT_CODE_LIMIT) { - UScriptCode code = static_cast<UScriptCode>(script); - (*setter)(settings, it->second, GetScriptForWebSettings(code)); - } - } -} - -} // namespace - -namespace webkit_glue { - -void ApplyWebPreferences(const WebPreferences& prefs, WebView* web_view) { - WebSettings* settings = web_view->settings(); - ApplyFontsFromMap(prefs.standard_font_family_map, - setStandardFontFamilyWrapper, settings); - ApplyFontsFromMap(prefs.fixed_font_family_map, - setFixedFontFamilyWrapper, settings); - ApplyFontsFromMap(prefs.serif_font_family_map, - setSerifFontFamilyWrapper, settings); - ApplyFontsFromMap(prefs.sans_serif_font_family_map, - setSansSerifFontFamilyWrapper, settings); - ApplyFontsFromMap(prefs.cursive_font_family_map, - setCursiveFontFamilyWrapper, settings); - ApplyFontsFromMap(prefs.fantasy_font_family_map, - setFantasyFontFamilyWrapper, settings); - ApplyFontsFromMap(prefs.pictograph_font_family_map, - setPictographFontFamilyWrapper, settings); - settings->setDefaultFontSize(prefs.default_font_size); - settings->setDefaultFixedFontSize(prefs.default_fixed_font_size); - settings->setMinimumFontSize(prefs.minimum_font_size); - settings->setMinimumLogicalFontSize(prefs.minimum_logical_font_size); - settings->setDefaultTextEncodingName(ASCIIToUTF16(prefs.default_encoding)); - settings->setJavaScriptEnabled(prefs.javascript_enabled); - settings->setWebSecurityEnabled(prefs.web_security_enabled); - settings->setJavaScriptCanOpenWindowsAutomatically( - prefs.javascript_can_open_windows_automatically); - settings->setLoadsImagesAutomatically(prefs.loads_images_automatically); - settings->setImagesEnabled(prefs.images_enabled); - settings->setPluginsEnabled(prefs.plugins_enabled); - settings->setDOMPasteAllowed(prefs.dom_paste_enabled); - settings->setNeedsSiteSpecificQuirks(prefs.site_specific_quirks_enabled); - settings->setShrinksStandaloneImagesToFit( - prefs.shrinks_standalone_images_to_fit); - settings->setUsesEncodingDetector(prefs.uses_universal_detector); - settings->setTextAreasAreResizable(prefs.text_areas_are_resizable); - settings->setAllowScriptsToCloseWindows(prefs.allow_scripts_to_close_windows); - if (prefs.user_style_sheet_enabled) - settings->setUserStyleSheetLocation(prefs.user_style_sheet_location); - else - settings->setUserStyleSheetLocation(WebURL()); - settings->setAuthorAndUserStylesEnabled(prefs.author_and_user_styles_enabled); - settings->setDownloadableBinaryFontsEnabled(prefs.remote_fonts_enabled); - settings->setJavaScriptCanAccessClipboard( - prefs.javascript_can_access_clipboard); - settings->setXSSAuditorEnabled(prefs.xss_auditor_enabled); - settings->setDNSPrefetchingEnabled(prefs.dns_prefetching_enabled); - settings->setLocalStorageEnabled(prefs.local_storage_enabled); - settings->setSyncXHRInDocumentsEnabled(prefs.sync_xhr_in_documents_enabled); - WebRuntimeFeatures::enableDatabase(prefs.databases_enabled); - settings->setOfflineWebApplicationCacheEnabled( - prefs.application_cache_enabled); - settings->setCaretBrowsingEnabled(prefs.caret_browsing_enabled); - settings->setHyperlinkAuditingEnabled(prefs.hyperlink_auditing_enabled); - settings->setCookieEnabled(prefs.cookie_enabled); - - // This setting affects the behavior of links in an editable region: - // clicking the link should select it rather than navigate to it. - // Safari uses the same default. It is unlikley an embedder would want to - // change this, since it would break existing rich text editors. - settings->setEditableLinkBehaviorNeverLive(); - - settings->setJavaEnabled(prefs.java_enabled); - - // By default, allow_universal_access_from_file_urls is set to false and thus - // we mitigate attacks from local HTML files by not granting file:// URLs - // universal access. Only test shell will enable this. - settings->setAllowUniversalAccessFromFileURLs( - prefs.allow_universal_access_from_file_urls); - settings->setAllowFileAccessFromFileURLs( - prefs.allow_file_access_from_file_urls); - - // Enable the web audio API if requested on the command line. - settings->setWebAudioEnabled(prefs.webaudio_enabled); - - // Enable experimental WebGL support if requested on command line - // and support is compiled in. - settings->setExperimentalWebGLEnabled(prefs.experimental_webgl_enabled); - - // Disable GL multisampling if requested on command line. - settings->setOpenGLMultisamplingEnabled(prefs.gl_multisampling_enabled); - - // Enable privileged WebGL extensions for Chrome extensions or if requested - // on command line. - settings->setPrivilegedWebGLExtensionsEnabled( - prefs.privileged_webgl_extensions_enabled); - - // Enable WebGL errors to the JS console if requested. - settings->setWebGLErrorsToConsoleEnabled( - prefs.webgl_errors_to_console_enabled); - - // Enables accelerated compositing for overflow scroll. - settings->setAcceleratedCompositingForOverflowScrollEnabled( - prefs.accelerated_compositing_for_overflow_scroll_enabled); - - // Enables accelerated compositing for scrollable frames if requested on - // command line. - settings->setAcceleratedCompositingForScrollableFramesEnabled( - prefs.accelerated_compositing_for_scrollable_frames_enabled); - - // Enables composited scrolling for frames if requested on command line. - settings->setCompositedScrollingForFramesEnabled( - prefs.composited_scrolling_for_frames_enabled); - - // Uses the mock theme engine for scrollbars. - settings->setMockScrollbarsEnabled(prefs.mock_scrollbars_enabled); - - settings->setThreadedHTMLParser(prefs.threaded_html_parser); - - // Display visualization of what has changed on the screen using an - // overlay of rects, if requested on the command line. - settings->setShowPaintRects(prefs.show_paint_rects); - - // Enable gpu-accelerated compositing if requested on the command line. - settings->setAcceleratedCompositingEnabled( - prefs.accelerated_compositing_enabled); - - // Enable gpu-accelerated 2d canvas if requested on the command line. - settings->setAccelerated2dCanvasEnabled(prefs.accelerated_2d_canvas_enabled); - - settings->setMinimumAccelerated2dCanvasSize( - prefs.minimum_accelerated_2d_canvas_size); - - // Disable antialiasing for 2d canvas if requested on the command line. - settings->setAntialiased2dCanvasEnabled( - !prefs.antialiased_2d_canvas_disabled); - - // Enable gpu-accelerated filters if requested on the command line. - settings->setAcceleratedFiltersEnabled(prefs.accelerated_filters_enabled); - - // Enable gesture tap highlight if requested on the command line. - settings->setGestureTapHighlightEnabled(prefs.gesture_tap_highlight_enabled); - - // Enabling accelerated layers from the command line enabled accelerated - // 3D CSS, Video, and Animations. - settings->setAcceleratedCompositingFor3DTransformsEnabled( - prefs.accelerated_compositing_for_3d_transforms_enabled); - settings->setAcceleratedCompositingForVideoEnabled( - prefs.accelerated_compositing_for_video_enabled); - settings->setAcceleratedCompositingForAnimationEnabled( - prefs.accelerated_compositing_for_animation_enabled); - - // Enabling accelerated plugins if specified from the command line. - settings->setAcceleratedCompositingForPluginsEnabled( - prefs.accelerated_compositing_for_plugins_enabled); - - // WebGL and accelerated 2D canvas are always gpu composited. - settings->setAcceleratedCompositingForCanvasEnabled( - prefs.experimental_webgl_enabled || prefs.accelerated_2d_canvas_enabled); - - // Enable memory info reporting to page if requested on the command line. - settings->setMemoryInfoEnabled(prefs.memory_info_enabled); - - settings->setAsynchronousSpellCheckingEnabled( - prefs.asynchronous_spell_checking_enabled); - settings->setUnifiedTextCheckerEnabled(prefs.unified_textchecker_enabled); - - for (webkit_glue::WebInspectorPreferences::const_iterator it = - prefs.inspector_settings.begin(); - it != prefs.inspector_settings.end(); ++it) - web_view->setInspectorSetting(WebString::fromUTF8(it->first), - WebString::fromUTF8(it->second)); - - // Tabs to link is not part of the settings. WebCore calls - // ChromeClient::tabsToLinks which is part of the glue code. - web_view->setTabsToLinks(prefs.tabs_to_links); - - settings->setFullScreenEnabled(prefs.fullscreen_enabled); - settings->setAllowDisplayOfInsecureContent( - prefs.allow_displaying_insecure_content); - settings->setAllowRunningOfInsecureContent( - prefs.allow_running_insecure_content); - settings->setPasswordEchoEnabled(prefs.password_echo_enabled); - settings->setShouldPrintBackgrounds(prefs.should_print_backgrounds); - settings->setEnableScrollAnimator(prefs.enable_scroll_animator); - settings->setVisualWordMovementEnabled(prefs.visual_word_movement_enabled); - - settings->setCSSStickyPositionEnabled(prefs.css_sticky_position_enabled); - settings->setExperimentalCSSCustomFilterEnabled(prefs.css_shaders_enabled); - settings->setRegionBasedColumnsEnabled(prefs.region_based_columns_enabled); - - WebRuntimeFeatures::enableLazyLayout(prefs.lazy_layout_enabled); - WebRuntimeFeatures::enableTouch(prefs.touch_enabled); - settings->setDeviceSupportsTouch(prefs.device_supports_touch); - settings->setDeviceSupportsMouse(prefs.device_supports_mouse); - settings->setEnableTouchAdjustment(prefs.touch_adjustment_enabled); - - settings->setFixedPositionCreatesStackingContext( - prefs.fixed_position_creates_stacking_context); - - settings->setDeferredImageDecodingEnabled( - prefs.deferred_image_decoding_enabled); - settings->setShouldRespectImageOrientation( - prefs.should_respect_image_orientation); - - settings->setUnsafePluginPastingEnabled(false); - settings->setEditingBehavior( - static_cast<WebSettings::EditingBehavior>(prefs.editing_behavior)); - - settings->setSupportsMultipleWindows(prefs.supports_multiple_windows); - - settings->setViewportEnabled(prefs.viewport_enabled); - settings->setInitializeAtMinimumPageScale( - prefs.initialize_at_minimum_page_scale); - - settings->setSmartInsertDeleteEnabled(prefs.smart_insert_delete_enabled); - - settings->setSpatialNavigationEnabled(prefs.spatial_navigation_enabled); - - settings->setSelectionIncludesAltImageText(true); - -#if defined(OS_ANDROID) - settings->setAllowCustomScrollbarInMainFrame(false); - settings->setTextAutosizingEnabled(prefs.text_autosizing_enabled); - settings->setTextAutosizingFontScaleFactor(prefs.font_scale_factor); - web_view->setIgnoreViewportTagScaleLimits(prefs.force_enable_zoom); - settings->setAutoZoomFocusedNodeToLegibleScale(true); - settings->setDoubleTapToZoomEnabled(prefs.double_tap_to_zoom_enabled); - settings->setMediaPlaybackRequiresUserGesture( - prefs.user_gesture_required_for_media_playback); - settings->setDefaultVideoPosterURL( - ASCIIToUTF16(prefs.default_video_poster_url.spec())); - settings->setSupportDeprecatedTargetDensityDPI( - prefs.support_deprecated_target_density_dpi); - settings->setUseLegacyBackgroundSizeShorthandBehavior( - prefs.use_legacy_background_size_shorthand_behavior); - settings->setWideViewportQuirkEnabled(prefs.wide_viewport_quirk); - settings->setUseWideViewport(prefs.use_wide_viewport); - settings->setViewportMetaLayoutSizeQuirk( - prefs.viewport_meta_layout_size_quirk); - settings->setViewportMetaZeroValuesQuirk( - prefs.viewport_meta_zero_values_quirk); -#endif - - WebNetworkStateNotifier::setOnLine(prefs.is_online); - settings->setExperimentalWebSocketEnabled( - prefs.experimental_websocket_enabled); - settings->setPinchVirtualViewportEnabled( - prefs.pinch_virtual_viewport_enabled); - - settings->setPinchOverlayScrollbarThickness( - prefs.pinch_overlay_scrollbar_thickness); -} - - -} // namespace webkit_glue diff --git a/chromium/webkit/renderer/webpreferences_renderer.h b/chromium/webkit/renderer/webpreferences_renderer.h deleted file mode 100644 index ad7305a1fac..00000000000 --- a/chromium/webkit/renderer/webpreferences_renderer.h +++ /dev/null @@ -1,24 +0,0 @@ -// // Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_RENDERER_WEBPREFERENCES_RENDERER_H_ -#define WEBKIT_RENDERER_WEBPREFERENCES_RENDERER_H_ - -#include "webkit/renderer/webkit_renderer_export.h" - -namespace WebKit { -class WebView; -} - -struct WebPreferences; - -namespace webkit_glue { - -WEBKIT_RENDERER_EXPORT void ApplyWebPreferences( - const WebPreferences& prefs, - WebKit::WebView* web_view); - -} // namespace webkit_glue - -#endif // WEBKIT_RENDERER_WEBPREFERENCES_RENDERER_H_ diff --git a/chromium/webkit/storage_browser.gyp b/chromium/webkit/storage_browser.gyp index 04e609ae6fc..a1a2bcc46c1 100644 --- a/chromium/webkit/storage_browser.gyp +++ b/chromium/webkit/storage_browser.gyp @@ -68,8 +68,6 @@ 'browser/blob/blob_data_handle.h', 'browser/blob/blob_storage_context.cc', 'browser/blob/blob_storage_context.h', - 'browser/blob/blob_storage_controller.cc', - 'browser/blob/blob_storage_controller.h', 'browser/blob/blob_storage_host.cc', 'browser/blob/blob_storage_host.h', 'browser/blob/blob_url_request_job.cc', @@ -96,6 +94,8 @@ 'browser/fileapi/copy_or_move_file_validator.h', 'browser/fileapi/copy_or_move_operation_delegate.cc', 'browser/fileapi/copy_or_move_operation_delegate.h', + 'browser/fileapi/dragged_file_util.cc', + 'browser/fileapi/dragged_file_util.h', 'browser/fileapi/external_mount_points.cc', 'browser/fileapi/external_mount_points.h', 'browser/fileapi/file_observers.h', @@ -137,8 +137,6 @@ 'browser/fileapi/isolated_context.h', 'browser/fileapi/isolated_file_system_backend.cc', 'browser/fileapi/isolated_file_system_backend.h', - 'browser/fileapi/isolated_file_util.cc', - 'browser/fileapi/isolated_file_util.h', 'browser/fileapi/local_file_stream_writer.cc', 'browser/fileapi/local_file_stream_writer.h', 'browser/fileapi/local_file_util.cc', @@ -154,14 +152,14 @@ 'browser/fileapi/recursive_operation_delegate.h', 'browser/fileapi/remove_operation_delegate.cc', 'browser/fileapi/remove_operation_delegate.h', - 'browser/fileapi/sandbox_context.cc', - 'browser/fileapi/sandbox_context.h', 'browser/fileapi/sandbox_directory_database.cc', 'browser/fileapi/sandbox_directory_database.h', 'browser/fileapi/sandbox_file_stream_writer.cc', 'browser/fileapi/sandbox_file_stream_writer.h', 'browser/fileapi/sandbox_file_system_backend.cc', 'browser/fileapi/sandbox_file_system_backend.h', + 'browser/fileapi/sandbox_file_system_backend_delegate.cc', + 'browser/fileapi/sandbox_file_system_backend_delegate.h', 'browser/fileapi/sandbox_isolated_origin_database.cc', 'browser/fileapi/sandbox_isolated_origin_database.h', 'browser/fileapi/sandbox_origin_database.cc', @@ -203,6 +201,12 @@ '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink', ], }], + ['OS=="android"', { + 'defines': ['APPCACHE_USE_SIMPLE_CACHE'], + 'direct_dependent_settings': { + 'defines': ['APPCACHE_USE_SIMPLE_CACHE'], + }, + }], ], }, { diff --git a/chromium/webkit/storage_common.gyp b/chromium/webkit/storage_common.gyp index 01e8f23eee0..a77d4c575ad 100644 --- a/chromium/webkit/storage_common.gyp +++ b/chromium/webkit/storage_common.gyp @@ -32,6 +32,8 @@ 'common/database/database_identifier.cc', 'common/fileapi/directory_entry.cc', 'common/fileapi/directory_entry.h', + 'common/fileapi/file_system_info.cc', + 'common/fileapi/file_system_info.h', 'common/fileapi/file_system_types.h', 'common/fileapi/file_system_util.cc', 'common/fileapi/file_system_util.h', diff --git a/chromium/webkit/storage_renderer.gyp b/chromium/webkit/storage_renderer.gyp deleted file mode 100644 index dc406e202dd..00000000000 --- a/chromium/webkit/storage_renderer.gyp +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2013 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -{ - 'targets': [ - { - 'target_name': 'webkit_storage_renderer', - 'type': '<(component)', - 'variables': { 'enable_wexit_time_destructors': 1, }, - 'dependencies': [ - '<(DEPTH)/base/base.gyp:base', - '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', - '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink', - '<(DEPTH)/url/url.gyp:url_lib', - '<(DEPTH)/webkit/common/webkit_common.gyp:webkit_common', - '<(DEPTH)/webkit/storage_common.gyp:webkit_storage_common', - ], - 'defines': ['WEBKIT_STORAGE_RENDERER_IMPLEMENTATION'], - 'sources': [ - 'renderer/webkit_storage_renderer_export.h', - 'renderer/fileapi/webfilewriter_base.cc', - 'renderer/fileapi/webfilewriter_base.h', - ], - # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. - 'msvs_disabled_warnings': [ 4267, ], - }, - ], -} diff --git a/chromium/webkit/support/drt_application_mac.h b/chromium/webkit/support/drt_application_mac.h deleted file mode 100644 index 969894f9500..00000000000 --- a/chromium/webkit/support/drt_application_mac.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_SUPPORT_DRT_APPLICATION_MAC_H -#define WEBKIT_SUPPORT_DRT_APPLICATION_MAC_H - -#include "base/mac/scoped_sending_event.h" -#include "base/message_loop/message_pump_mac.h" - -@interface CrDrtApplication : NSApplication<CrAppProtocol, - CrAppControlProtocol> { - @private - BOOL handlingSendEvent_; -} -// CrAppProtocol -- (BOOL)isHandlingSendEvent; - -// CrAppControlProtocol -- (void)setHandlingSendEvent:(BOOL)handlingSendEvent; -@end - -#endif // WEBKIT_SUPPORT_DRT_APPLICATION_MAC_H diff --git a/chromium/webkit/support/drt_application_mac.mm b/chromium/webkit/support/drt_application_mac.mm deleted file mode 100644 index 0c2f900039c..00000000000 --- a/chromium/webkit/support/drt_application_mac.mm +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/support/drt_application_mac.h" - -#include "base/auto_reset.h" - -@implementation CrDrtApplication - -- (BOOL)isHandlingSendEvent { - return handlingSendEvent_; -} - -- (void)sendEvent:(NSEvent*)event { - base::AutoReset<BOOL> scoper(&handlingSendEvent_, YES); - [super sendEvent:event]; -} - -- (void)setHandlingSendEvent:(BOOL)handlingSendEvent { - handlingSendEvent_ = handlingSendEvent; -} - -@end diff --git a/chromium/webkit/support/mac/DumpRenderTreePasteboard.h b/chromium/webkit/support/mac/DumpRenderTreePasteboard.h deleted file mode 100644 index 41796ea3779..00000000000 --- a/chromium/webkit/support/mac/DumpRenderTreePasteboard.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007 Apple, Inc. All rights reserved. - * (C) 2007 Graham Dennis (graham.dennis@gmail.com) - * (C) 2007 Eric Seidel <eric@webkit.org> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -// -// This file comes from WebKit: -// WebKit/Tools/DumpRenderTree/mac/DumpRenderTreePasteboard.m -// It is copied here since that location is the best for pulling into Chromium -// and has a few includes commented out. darin@chromium.org suggests in the -// future we see if there is a better place for it to live so it could be -// shared. -// - -#import <AppKit/AppKit.h> -// #import <WebKit/WebTypesInternal.h> - -@interface DumpRenderTreePasteboard : NSPasteboard -- (NSInteger)declareType:(NSString *)type owner:(id)newOwner; -+ (void)releaseLocalPasteboards; -@end diff --git a/chromium/webkit/support/mac/DumpRenderTreePasteboard.m b/chromium/webkit/support/mac/DumpRenderTreePasteboard.m deleted file mode 100644 index 3e3cf1c47d3..00000000000 --- a/chromium/webkit/support/mac/DumpRenderTreePasteboard.m +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007 Apple, Inc. All rights reserved. - * (C) 2007 Graham Dennis (graham.dennis@gmail.com) - * (C) 2007 Eric Seidel <eric@webkit.org> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -// -// This file comes from WebKit: -// WebKit/Tools/DumpRenderTree/mac/DumpRenderTreePasteboard.m -// It is copied here since that location is the best for pulling into Chromium -// and has a few includes commented out. darin@chromium.org suggests in the -// future we see if there is a better place for it to live so it could be -// shared. -// - -// #import "DumpRenderTreeMac.h" -#import "DumpRenderTreePasteboard.h" - -// #import <WebKit/WebTypesInternal.h> - -@interface LocalPasteboard : NSPasteboard -{ - NSMutableArray *typesArray; - NSMutableSet *typesSet; - NSMutableDictionary *dataByType; - NSInteger changeCount; -} -@end - -static NSMutableDictionary *localPasteboards; - -@implementation DumpRenderTreePasteboard - -// Return a local pasteboard so we don't disturb the real pasteboards when running tests. -+ (NSPasteboard *)_pasteboardWithName:(NSString *)name -{ - static int number = 0; - if (!name) - name = [NSString stringWithFormat:@"LocalPasteboard%d", ++number]; - if (!localPasteboards) - localPasteboards = [[NSMutableDictionary alloc] init]; - LocalPasteboard *pasteboard = [localPasteboards objectForKey:name]; - if (pasteboard) - return pasteboard; - pasteboard = [[LocalPasteboard alloc] init]; - [localPasteboards setObject:pasteboard forKey:name]; - [pasteboard release]; - return pasteboard; -} - -+ (void)releaseLocalPasteboards -{ - [localPasteboards release]; - localPasteboards = nil; -} - -// Convenience method for JS so that it doesn't have to try and create a NSArray on the objc side instead -// of the usual WebScriptObject that is passed around -- (NSInteger)declareType:(NSString *)type owner:(id)newOwner -{ - return [self declareTypes:[NSArray arrayWithObject:type] owner:newOwner]; -} - -@end - -@implementation LocalPasteboard - -+ (id)alloc -{ - return NSAllocateObject(self, 0, 0); -} - -- (id)init -{ - typesArray = [[NSMutableArray alloc] init]; - typesSet = [[NSMutableSet alloc] init]; - dataByType = [[NSMutableDictionary alloc] init]; - return self; -} - -- (void)dealloc -{ - [typesArray release]; - [typesSet release]; - [dataByType release]; - [super dealloc]; -} - -- (NSString *)name -{ - return nil; -} - -- (void)releaseGlobally -{ -} - -- (NSInteger)declareTypes:(NSArray *)newTypes owner:(id)newOwner -{ - [typesArray removeAllObjects]; - [typesSet removeAllObjects]; - [dataByType removeAllObjects]; - return [self addTypes:newTypes owner:newOwner]; -} - -- (NSInteger)addTypes:(NSArray *)newTypes owner:(id)newOwner -{ - unsigned count = [newTypes count]; - unsigned i; - for (i = 0; i < count; ++i) { - NSString *type = [newTypes objectAtIndex:i]; - NSString *setType = [typesSet member:type]; - if (!setType) { - setType = [type copy]; - [typesArray addObject:setType]; - [typesSet addObject:setType]; - [setType release]; - } - if (newOwner && [newOwner respondsToSelector:@selector(pasteboard:provideDataForType:)]) - [newOwner pasteboard:self provideDataForType:setType]; - } - return ++changeCount; -} - -- (NSInteger)changeCount -{ - return changeCount; -} - -- (NSArray *)types -{ - return typesArray; -} - -- (NSString *)availableTypeFromArray:(NSArray *)types -{ - unsigned count = [types count]; - unsigned i; - for (i = 0; i < count; ++i) { - NSString *type = [types objectAtIndex:i]; - NSString *setType = [typesSet member:type]; - if (setType) - return setType; - } - return nil; -} - -- (BOOL)setData:(NSData *)data forType:(NSString *)dataType -{ - if (data == nil) - data = [NSData data]; - if (![typesSet containsObject:dataType]) - return NO; - [dataByType setObject:data forKey:dataType]; - ++changeCount; - return YES; -} - -- (NSData *)dataForType:(NSString *)dataType -{ - return [dataByType objectForKey:dataType]; -} - -- (BOOL)setPropertyList:(id)propertyList forType:(NSString *)dataType -{ - CFDataRef data = NULL; - if (propertyList) - data = CFPropertyListCreateXMLData(NULL, propertyList); - BOOL result = [self setData:(NSData *)data forType:dataType]; - if (data) - CFRelease(data); - return result; -} - -- (BOOL)setString:(NSString *)string forType:(NSString *)dataType -{ - CFDataRef data = NULL; - if (string) { - if ([string length] == 0) - data = CFDataCreate(NULL, NULL, 0); - else - data = CFStringCreateExternalRepresentation(NULL, (CFStringRef)string, kCFStringEncodingUTF8, 0); - } - BOOL result = [self setData:(NSData *)data forType:dataType]; - if (data) - CFRelease(data); - return result; -} - -@end diff --git a/chromium/webkit/support/mock_webclipboard_impl.cc b/chromium/webkit/support/mock_webclipboard_impl.cc deleted file mode 100644 index f1c6d4206bf..00000000000 --- a/chromium/webkit/support/mock_webclipboard_impl.cc +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/support/mock_webclipboard_impl.h" - -#include <algorithm> - -#include "base/logging.h" -#include "base/stl_util.h" -#include "base/strings/string_util.h" -#include "base/strings/utf_string_conversions.h" -#include "third_party/WebKit/public/platform/WebCommon.h" -#include "third_party/WebKit/public/platform/WebDragData.h" -#include "third_party/WebKit/public/platform/WebImage.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "ui/base/clipboard/clipboard.h" -#include "ui/gfx/codec/png_codec.h" -#include "ui/gfx/size.h" -#include "webkit/glue/webkit_glue.h" -#include "webkit/renderer/clipboard_utils.h" - -using WebKit::WebDragData; -using WebKit::WebString; -using WebKit::WebURL; -using WebKit::WebVector; - -MockWebClipboardImpl::MockWebClipboardImpl() { -} - -MockWebClipboardImpl::~MockWebClipboardImpl() { -} - -bool MockWebClipboardImpl::isFormatAvailable(Format format, Buffer buffer) { - switch (format) { - case FormatPlainText: - return !m_plainText.isNull(); - - case FormatHTML: - return !m_htmlText.isNull(); - - case FormatSmartPaste: - return m_writeSmartPaste; - - default: - NOTREACHED(); - return false; - } - - switch (buffer) { - case BufferStandard: - break; - case BufferSelection: -#if defined(OS_POSIX) && !defined(OS_MACOSX) - break; -#endif - default: - NOTREACHED(); - return false; - } - - return true; -} - -WebVector<WebString> MockWebClipboardImpl::readAvailableTypes( - Buffer buffer, bool* containsFilenames) { - *containsFilenames = false; - std::vector<WebString> results; - if (!m_plainText.isEmpty()) { - results.push_back(WebString("text/plain")); - } - if (!m_htmlText.isEmpty()) { - results.push_back(WebString("text/html")); - } - if (!m_image.isNull()) { - results.push_back(WebString("image/png")); - } - for (std::map<base::string16, base::string16>::const_iterator it = - m_customData.begin(); - it != m_customData.end(); ++it) { - CHECK(std::find(results.begin(), results.end(), it->first) == - results.end()); - results.push_back(it->first); - } - return results; -} - -WebKit::WebString MockWebClipboardImpl::readPlainText( - WebKit::WebClipboard::Buffer buffer) { - return m_plainText; -} - -// TODO(wtc): set output argument *url. -WebKit::WebString MockWebClipboardImpl::readHTML( - WebKit::WebClipboard::Buffer buffer, WebKit::WebURL* url, - unsigned* fragmentStart, unsigned* fragmentEnd) { - *fragmentStart = 0; - *fragmentEnd = static_cast<unsigned>(m_htmlText.length()); - return m_htmlText; -} - -WebKit::WebData MockWebClipboardImpl::readImage( - WebKit::WebClipboard::Buffer buffer) { - std::string data; - std::vector<unsigned char> encoded_image; - // TODO(dcheng): Verify that we can assume the image is ARGB8888. Note that - // for endianess reasons, it will be BGRA8888 on Windows. - const SkBitmap& bitmap = m_image.getSkBitmap(); - SkAutoLockPixels lock(bitmap); - gfx::PNGCodec::Encode(static_cast<unsigned char*>(bitmap.getPixels()), -#if defined(OS_ANDROID) - gfx::PNGCodec::FORMAT_RGBA, -#else - gfx::PNGCodec::FORMAT_BGRA, -#endif - gfx::Size(bitmap.width(), bitmap.height()), - bitmap.rowBytes(), - false /* discard_transparency */, - std::vector<gfx::PNGCodec::Comment>(), - &encoded_image); - data.assign(reinterpret_cast<char*>(vector_as_array(&encoded_image)), - encoded_image.size()); - return data; -} - -WebKit::WebString MockWebClipboardImpl::readCustomData( - WebKit::WebClipboard::Buffer buffer, - const WebKit::WebString& type) { - std::map<base::string16, base::string16>::const_iterator it = - m_customData.find(type); - if (it != m_customData.end()) - return it->second; - return WebKit::WebString(); -} - -void MockWebClipboardImpl::writeHTML( - const WebKit::WebString& htmlText, const WebKit::WebURL& url, - const WebKit::WebString& plainText, bool writeSmartPaste) { - clear(); - - m_htmlText = htmlText; - m_plainText = plainText; - m_writeSmartPaste = writeSmartPaste; -} - -void MockWebClipboardImpl::writePlainText(const WebKit::WebString& plain_text) { - clear(); - - m_plainText = plain_text; -} - -void MockWebClipboardImpl::writeURL( - const WebKit::WebURL& url, const WebKit::WebString& title) { - clear(); - - m_htmlText = WebString::fromUTF8(webkit_clipboard::URLToMarkup(url, title)); - m_plainText = url.spec().utf16(); -} - -void MockWebClipboardImpl::writeImage(const WebKit::WebImage& image, - const WebKit::WebURL& url, const WebKit::WebString& title) { - if (!image.isNull()) { - clear(); - - m_plainText = m_htmlText; - m_htmlText = WebString::fromUTF8( - webkit_clipboard::URLToImageMarkup(url, title)); - m_image = image; - } -} - -void MockWebClipboardImpl::writeDataObject(const WebDragData& data) { - clear(); - - const WebVector<WebDragData::Item>& itemList = data.items(); - for (size_t i = 0; i < itemList.size(); ++i) { - const WebDragData::Item& item = itemList[i]; - switch (item.storageType) { - case WebDragData::Item::StorageTypeString: { - if (EqualsASCII(item.stringType, ui::Clipboard::kMimeTypeText)) { - m_plainText = item.stringData; - continue; - } - if (EqualsASCII(item.stringType, ui::Clipboard::kMimeTypeHTML)) { - m_htmlText = item.stringData; - continue; - } - m_customData.insert(std::make_pair(item.stringType, item.stringData)); - continue; - } - case WebDragData::Item::StorageTypeFilename: - case WebDragData::Item::StorageTypeBinaryData: - NOTREACHED(); // Currently unused by the clipboard implementation. - } - } -} - -void MockWebClipboardImpl::clear() { - m_plainText = WebString(); - m_htmlText = WebString(); - m_image.reset(); - m_customData.clear(); - m_writeSmartPaste = false; -} diff --git a/chromium/webkit/support/mock_webclipboard_impl.h b/chromium/webkit/support/mock_webclipboard_impl.h deleted file mode 100644 index 61efcf49839..00000000000 --- a/chromium/webkit/support/mock_webclipboard_impl.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// -// This file mocks out just enough of the WebClipboard API for running the -// webkit tests. This is so we can run webkit tests without them sharing a -// clipboard, which allows for running them in parallel and having the tests -// not interact with actual user actions. - -#ifndef WEBKIT_SUPPORT_MOCK_WEBCLIPBOARD_IMPL_H_ -#define WEBKIT_SUPPORT_MOCK_WEBCLIPBOARD_IMPL_H_ - -#include <map> - -#include "base/strings/string16.h" -#include "third_party/WebKit/public/platform/WebClipboard.h" -#include "third_party/WebKit/public/platform/WebDragData.h" -#include "third_party/WebKit/public/platform/WebImage.h" - -class MockWebClipboardImpl : public WebKit::WebClipboard { - public: - MockWebClipboardImpl(); - virtual ~MockWebClipboardImpl(); - - virtual bool isFormatAvailable(WebKit::WebClipboard::Format format, - WebKit::WebClipboard::Buffer buffer); - virtual WebKit::WebVector<WebKit::WebString> readAvailableTypes( - WebKit::WebClipboard::Buffer buffer, bool* containsFilenames); - - virtual WebKit::WebString readPlainText(WebKit::WebClipboard::Buffer buffer); - virtual WebKit::WebString readHTML(WebKit::WebClipboard::Buffer buffer, - WebKit::WebURL* url, - unsigned* fragmentStart, - unsigned* fragmentEnd); - virtual WebKit::WebData readImage(WebKit::WebClipboard::Buffer buffer); - virtual WebKit::WebString readCustomData(WebKit::WebClipboard::Buffer buffer, - const WebKit::WebString& type); - - virtual void writePlainText(const WebKit::WebString& plain_text); - virtual void writeHTML( - const WebKit::WebString& htmlText, const WebKit::WebURL& url, - const WebKit::WebString& plainText, bool writeSmartPaste); - virtual void writeURL( - const WebKit::WebURL& url, const WebKit::WebString& title); - virtual void writeImage( - const WebKit::WebImage& image, const WebKit::WebURL& url, - const WebKit::WebString& title); - virtual void writeDataObject(const WebKit::WebDragData& data); - - private: - void clear(); - - WebKit::WebString m_plainText; - WebKit::WebString m_htmlText; - WebKit::WebImage m_image; - std::map<base::string16, base::string16> m_customData; - bool m_writeSmartPaste; -}; - -#endif // WEBKIT_SUPPORT_MOCK_WEBCLIPBOARD_IMPL_H_ diff --git a/chromium/webkit/support/platform_support.h b/chromium/webkit/support/platform_support.h deleted file mode 100644 index 73ab9501a7b..00000000000 --- a/chromium/webkit/support/platform_support.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_SUPPORT_PLATFORM_SUPORT_H_ -#define WEBKIT_SUPPORT_PLATFORM_SUPORT_H_ - -namespace webkit_support { -// Called before WebKit::initialize(). -void BeforeInitialize(); - -// Called after WebKit::initialize(). -void AfterInitialize(); - -// Called before WebKit::shutdown(). -void BeforeShutdown(); - -// Called after WebKit::shutdown(). -void AfterShutdown(); -} // namespace webkit_support - -#endif // WEBKIT_SUPPORT_PLATFORM_SUPORT_H_ diff --git a/chromium/webkit/support/platform_support_android.cc b/chromium/webkit/support/platform_support_android.cc deleted file mode 100644 index 582dc3a85bd..00000000000 --- a/chromium/webkit/support/platform_support_android.cc +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/support/platform_support.h" - -#include "base/android/jni_android.h" -#include "base/file_util.h" -#include "base/files/file_path.h" -#include "base/logging.h" -#include "base/path_service.h" -#include "base/strings/string16.h" -#include "base/strings/string_piece.h" -#include "base/test/test_support_android.h" -#include "grit/webkit_resources.h" -#include "media/base/android/media_jni_registrar.h" -#include "net/android/net_jni_registrar.h" -#include "net/android/network_library.h" -#include "ui/android/ui_jni_registrar.h" -#include "ui/base/resource/resource_bundle.h" -#include "ui/gl/android/gl_jni_registrar.h" -#include "url/gurl.h" -#include "webkit/support/test_webkit_platform_support.h" - -namespace { - -// The place where the Android layout test script will put the required tools -// and resources. Must keep consistent with DEVICE_DRT_DIR in -// WebKit/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py. -const char kDumpRenderTreeDir[] = "/data/local/tmp/drt"; - -} - -namespace webkit_support { - -void BeforeInitialize() { - base::InitAndroidTestPaths(); - - // Place cache under kDumpRenderTreeDir to allow the NRWT script to clear it. - base::FilePath path(kDumpRenderTreeDir); - path = path.Append("cache"); - PathService::Override(base::DIR_CACHE, path); - - // Set XML_CATALOG_FILES environment variable to blank to prevent libxml from - // loading and complaining the non-exsistent /etc/xml/catalog file. - setenv("XML_CATALOG_FILES", "", 0); - - JNIEnv* env = base::android::AttachCurrentThread(); - net::android::RegisterNetworkLibrary(env); -} - -void AfterInitialize() { -} - -void BeforeShutdown() { -} - -void AfterShutdown() { -} - -} // namespace webkit_support - diff --git a/chromium/webkit/support/platform_support_linux.cc b/chromium/webkit/support/platform_support_linux.cc deleted file mode 100644 index 85cc8418eaa..00000000000 --- a/chromium/webkit/support/platform_support_linux.cc +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/support/platform_support.h" - -#include "base/file_util.h" -#include "base/files/file_path.h" -#include "base/logging.h" -#include "base/path_service.h" -#include "base/strings/string16.h" -#include "base/strings/string_piece.h" -#include "grit/webkit_resources.h" -#include "ui/base/resource/resource_bundle.h" -#include "webkit/support/test_webkit_platform_support.h" - -namespace webkit_support { - -// TODO(tkent): Implement some of the followings for platform-dependent tasks -// such as loading resource. - -void BeforeInitialize() { -} - -void AfterInitialize() { -} - -void BeforeShutdown() { -} - -void AfterShutdown() { -} - -} // namespace webkit_support - diff --git a/chromium/webkit/support/platform_support_mac.mm b/chromium/webkit/support/platform_support_mac.mm deleted file mode 100644 index 6d96ec13cf8..00000000000 --- a/chromium/webkit/support/platform_support_mac.mm +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/support/platform_support.h" - -#import <AppKit/AppKit.h> -#include <AvailabilityMacros.h> -#import <Foundation/Foundation.h> -#import <objc/objc-runtime.h> - -#include "base/base_paths.h" -#include "base/file_util.h" -#include "base/logging.h" -#include "base/path_service.h" -#include "base/strings/string16.h" -#include "base/strings/utf_string_conversions.h" -#include "grit/webkit_resources.h" -#include "ui/base/resource/data_pack.h" -#import "webkit/support/drt_application_mac.h" -#import "webkit/support/mac/DumpRenderTreePasteboard.h" -#include "webkit/support/test_webkit_platform_support.h" - -namespace webkit_support { - -static NSAutoreleasePool* autorelease_pool; - -void BeforeInitialize() { - [CrDrtApplication sharedApplication]; - autorelease_pool = [[NSAutoreleasePool alloc] init]; - DCHECK(autorelease_pool); -} - -void AfterInitialize() { -} - -void BeforeShutdown() { -} - -void AfterShutdown() { - [DumpRenderTreePasteboard releaseLocalPasteboards]; - [autorelease_pool drain]; -} - -} // namespace webkit_support - diff --git a/chromium/webkit/support/platform_support_win.cc b/chromium/webkit/support/platform_support_win.cc deleted file mode 100644 index ce601c5490c..00000000000 --- a/chromium/webkit/support/platform_support_win.cc +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/support/platform_support.h" - -#include "base/base_paths.h" -#include "base/file_util.h" -#include "base/files/file_path.h" -#include "base/logging.h" -#include "base/path_service.h" -#include "base/strings/string16.h" -#include "base/strings/string_piece.h" -#include "base/win/resource_util.h" -#include "grit/blink_resources.h" -#include "grit/webkit_resources.h" -#include "ui/base/resource/resource_bundle.h" -#include "webkit/support/test_webkit_platform_support.h" - - -namespace webkit_support { - -void BeforeInitialize() { -} - -void AfterInitialize() { -} - -void BeforeShutdown() { -} - -void AfterShutdown() { -} - -} // namespace webkit_support - diff --git a/chromium/webkit/support/test_webkit_platform_support.cc b/chromium/webkit/support/test_webkit_platform_support.cc deleted file mode 100644 index 276a10e77bc..00000000000 --- a/chromium/webkit/support/test_webkit_platform_support.cc +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/support/test_webkit_platform_support.h" - -#include "base/command_line.h" -#include "base/file_util.h" -#include "base/files/file_path.h" -#include "base/files/scoped_temp_dir.h" -#include "base/metrics/stats_counters.h" -#include "base/path_service.h" -#include "base/strings/utf_string_conversions.h" -#include "media/base/media.h" -#include "net/cookies/cookie_monster.h" -#include "net/test/spawned_test_server/spawned_test_server.h" -#include "third_party/WebKit/public/platform/WebData.h" -#include "third_party/WebKit/public/platform/WebFileSystem.h" -#include "third_party/WebKit/public/platform/WebStorageArea.h" -#include "third_party/WebKit/public/platform/WebStorageNamespace.h" -#include "third_party/WebKit/public/platform/WebString.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/web/WebDatabase.h" -#include "third_party/WebKit/public/web/WebKit.h" -#include "third_party/WebKit/public/web/WebRuntimeFeatures.h" -#include "third_party/WebKit/public/web/WebScriptController.h" -#include "third_party/WebKit/public/web/WebSecurityPolicy.h" -#include "third_party/WebKit/public/web/WebStorageEventDispatcher.h" -#include "v8/include/v8.h" -#include "webkit/browser/database/vfs_backend.h" -#include "webkit/child/webkitplatformsupport_impl.h" -#include "webkit/glue/simple_webmimeregistry_impl.h" -#include "webkit/glue/webkit_glue.h" -#include "webkit/renderer/compositor_bindings/web_compositor_support_impl.h" -#include "webkit/support/mock_webclipboard_impl.h" -#include "webkit/support/web_gesture_curve_mock.h" -#include "webkit/support/web_layer_tree_view_impl_for_testing.h" -#include "webkit/support/weburl_loader_mock_factory.h" - -#if defined(OS_WIN) -#include "third_party/WebKit/public/platform/win/WebThemeEngine.h" -#elif defined(OS_MACOSX) -#include "base/mac/mac_util.h" -#endif - -using WebKit::WebScriptController; -using webkit::WebLayerTreeViewImplForTesting; - -TestWebKitPlatformSupport::TestWebKitPlatformSupport() { - v8::V8::SetCounterFunction(base::StatsTable::FindLocation); - - WebKit::initialize(this); - WebKit::setLayoutTestMode(true); - WebKit::WebSecurityPolicy::registerURLSchemeAsLocal( - WebKit::WebString::fromUTF8("test-shell-resource")); - WebKit::WebSecurityPolicy::registerURLSchemeAsNoAccess( - WebKit::WebString::fromUTF8("test-shell-resource")); - WebKit::WebSecurityPolicy::registerURLSchemeAsDisplayIsolated( - WebKit::WebString::fromUTF8("test-shell-resource")); - WebKit::WebSecurityPolicy::registerURLSchemeAsEmptyDocument( - WebKit::WebString::fromUTF8("test-shell-resource")); - WebScriptController::enableV8SingleThreadMode(); - WebKit::WebRuntimeFeatures::enableApplicationCache(true); - WebKit::WebRuntimeFeatures::enableDatabase(true); - WebKit::WebRuntimeFeatures::enableNotifications(true); - WebKit::WebRuntimeFeatures::enableTouch(true); - - // Load libraries for media and enable the media player. - bool enable_media = false; - base::FilePath module_path; - if (PathService::Get(base::DIR_MODULE, &module_path)) { -#if defined(OS_MACOSX) - if (base::mac::AmIBundled()) - module_path = module_path.DirName().DirName().DirName(); -#endif - if (media::InitializeMediaLibrary(module_path)) - enable_media = true; - } - WebKit::WebRuntimeFeatures::enableMediaPlayer(enable_media); - LOG_IF(WARNING, !enable_media) << "Failed to initialize the media library.\n"; - - // TODO(joth): Make a dummy geolocation service implemenation for - // test_shell, and set this to true. http://crbug.com/36451 - WebKit::WebRuntimeFeatures::enableGeolocation(false); - - file_utilities_.set_sandbox_enabled(false); - - if (!file_system_root_.CreateUniqueTempDir()) { - LOG(WARNING) << "Failed to create a temp dir for the filesystem." - "FileSystem feature will be disabled."; - DCHECK(file_system_root_.path().empty()); - } - -#if defined(OS_WIN) - // Ensure we pick up the default theme engine. - SetThemeEngine(NULL); -#endif - - net::CookieMonster::EnableFileScheme(); - - // Test shell always exposes the GC. - webkit_glue::SetJavaScriptFlags(" --expose-gc"); -} - -TestWebKitPlatformSupport::~TestWebKitPlatformSupport() { -} - -WebKit::WebMimeRegistry* TestWebKitPlatformSupport::mimeRegistry() { - return &mime_registry_; -} - -WebKit::WebClipboard* TestWebKitPlatformSupport::clipboard() { - // Mock out clipboard calls so that tests don't mess - // with each other's copies/pastes when running in parallel. - return &mock_clipboard_; -} - -WebKit::WebFileUtilities* TestWebKitPlatformSupport::fileUtilities() { - return &file_utilities_; -} - -WebKit::WebIDBFactory* TestWebKitPlatformSupport::idbFactory() { - NOTREACHED() << - "IndexedDB cannot be tested with in-process harnesses."; - return NULL; -} - -WebKit::WebURLLoader* TestWebKitPlatformSupport::createURLLoader() { - return url_loader_factory_.CreateURLLoader( - webkit_glue::WebKitPlatformSupportImpl::createURLLoader()); -} - -WebKit::WebData TestWebKitPlatformSupport::loadResource(const char* name) { - if (!strcmp(name, "deleteButton")) { - // Create a red 30x30 square. - const char red_square[] = - "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52" - "\x00\x00\x00\x1e\x00\x00\x00\x1e\x04\x03\x00\x00\x00\xc9\x1e\xb3" - "\x91\x00\x00\x00\x30\x50\x4c\x54\x45\x00\x00\x00\x80\x00\x00\x00" - "\x80\x00\x80\x80\x00\x00\x00\x80\x80\x00\x80\x00\x80\x80\x80\x80" - "\x80\xc0\xc0\xc0\xff\x00\x00\x00\xff\x00\xff\xff\x00\x00\x00\xff" - "\xff\x00\xff\x00\xff\xff\xff\xff\xff\x7b\x1f\xb1\xc4\x00\x00\x00" - "\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a" - "\x9c\x18\x00\x00\x00\x17\x49\x44\x41\x54\x78\x01\x63\x98\x89\x0a" - "\x18\x50\xb9\x33\x47\xf9\xa8\x01\x32\xd4\xc2\x03\x00\x33\x84\x0d" - "\x02\x3a\x91\xeb\xa5\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60" - "\x82"; - return WebKit::WebData(red_square, arraysize(red_square)); - } - return webkit_glue::WebKitPlatformSupportImpl::loadResource(name); -} - -WebKit::WebString TestWebKitPlatformSupport::queryLocalizedString( - WebKit::WebLocalizedString::Name name) { - // Returns placeholder strings to check if they are correctly localized. - switch (name) { - case WebKit::WebLocalizedString::OtherDateLabel: - return ASCIIToUTF16("<<OtherDateLabel>>"); - case WebKit::WebLocalizedString::OtherMonthLabel: - return ASCIIToUTF16("<<OtherMonthLabel>>"); - case WebKit::WebLocalizedString::OtherTimeLabel: - return ASCIIToUTF16("<<OtherTimeLabel>>"); - case WebKit::WebLocalizedString::OtherWeekLabel: - return ASCIIToUTF16("<<OtherWeekLabel>>"); - case WebKit::WebLocalizedString::CalendarClear: - return ASCIIToUTF16("<<CalendarClear>>"); - case WebKit::WebLocalizedString::CalendarToday: - return ASCIIToUTF16("<<CalendarToday>>"); - case WebKit::WebLocalizedString::ThisMonthButtonLabel: - return ASCIIToUTF16("<<ThisMonthLabel>>"); - case WebKit::WebLocalizedString::ThisWeekButtonLabel: - return ASCIIToUTF16("<<ThisWeekLabel>>"); - case WebKit::WebLocalizedString::WeekFormatTemplate: - return ASCIIToUTF16("Week $2, $1"); - default: - return WebKitPlatformSupportImpl::queryLocalizedString(name); - } -} - -WebKit::WebString TestWebKitPlatformSupport::queryLocalizedString( - WebKit::WebLocalizedString::Name name, const WebKit::WebString& value) { - if (name == WebKit::WebLocalizedString::ValidationRangeUnderflow) - return ASCIIToUTF16("range underflow"); - if (name == WebKit::WebLocalizedString::ValidationRangeOverflow) - return ASCIIToUTF16("range overflow"); - return WebKitPlatformSupportImpl::queryLocalizedString(name, value); -} - -WebKit::WebString TestWebKitPlatformSupport::queryLocalizedString( - WebKit::WebLocalizedString::Name name, - const WebKit::WebString& value1, - const WebKit::WebString& value2) { - if (name == WebKit::WebLocalizedString::ValidationTooLong) - return ASCIIToUTF16("too long"); - if (name == WebKit::WebLocalizedString::ValidationStepMismatch) - return ASCIIToUTF16("step mismatch"); - return WebKitPlatformSupportImpl::queryLocalizedString(name, value1, value2); -} - -WebKit::WebString TestWebKitPlatformSupport::defaultLocale() { - return ASCIIToUTF16("en-US"); -} - -#if defined(OS_WIN) || defined(OS_MACOSX) -void TestWebKitPlatformSupport::SetThemeEngine(WebKit::WebThemeEngine* engine) { - active_theme_engine_ = engine ? - engine : WebKitPlatformSupportImpl::themeEngine(); -} - -WebKit::WebThemeEngine* TestWebKitPlatformSupport::themeEngine() { - return active_theme_engine_; -} -#endif - -WebKit::WebCompositorSupport* -TestWebKitPlatformSupport::compositorSupport() { - return &compositor_support_; -} - -base::string16 TestWebKitPlatformSupport::GetLocalizedString(int message_id) { - return base::string16(); -} - -base::StringPiece TestWebKitPlatformSupport::GetDataResource( - int resource_id, - ui::ScaleFactor scale_factor) { - return base::StringPiece(); -} - -webkit_glue::ResourceLoaderBridge* -TestWebKitPlatformSupport::CreateResourceLoader( - const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) { - NOTREACHED(); - return NULL; -} - -webkit_glue::WebSocketStreamHandleBridge* -TestWebKitPlatformSupport::CreateWebSocketBridge( - WebKit::WebSocketStreamHandle* handle, - webkit_glue::WebSocketStreamHandleDelegate* delegate) { - NOTREACHED(); - return NULL; -} - -WebKit::WebGestureCurve* TestWebKitPlatformSupport::createFlingAnimationCurve( - int device_source, - const WebKit::WebFloatPoint& velocity, - const WebKit::WebSize& cumulative_scroll) { - // Caller will retain and release. - return new WebGestureCurveMock(velocity, cumulative_scroll); -} - -WebKit::WebUnitTestSupport* TestWebKitPlatformSupport::unitTestSupport() { - return this; -} - -void TestWebKitPlatformSupport::registerMockedURL( - const WebKit::WebURL& url, - const WebKit::WebURLResponse& response, - const WebKit::WebString& file_path) { - url_loader_factory_.RegisterURL(url, response, file_path); -} - -void TestWebKitPlatformSupport::registerMockedErrorURL( - const WebKit::WebURL& url, - const WebKit::WebURLResponse& response, - const WebKit::WebURLError& error) { - url_loader_factory_.RegisterErrorURL(url, response, error); -} - -void TestWebKitPlatformSupport::unregisterMockedURL(const WebKit::WebURL& url) { - url_loader_factory_.UnregisterURL(url); -} - -void TestWebKitPlatformSupport::unregisterAllMockedURLs() { - url_loader_factory_.UnregisterAllURLs(); -} - -void TestWebKitPlatformSupport::serveAsynchronousMockedRequests() { - url_loader_factory_.ServeAsynchronousRequests(); -} - -WebKit::WebString TestWebKitPlatformSupport::webKitRootDir() { - base::FilePath path; - PathService::Get(base::DIR_SOURCE_ROOT, &path); - path = path.Append(FILE_PATH_LITERAL("third_party/WebKit")); - path = base::MakeAbsoluteFilePath(path); - CHECK(!path.empty()); - std::string path_ascii = path.MaybeAsASCII(); - CHECK(!path_ascii.empty()); - return WebKit::WebString::fromUTF8(path_ascii.c_str()); -} - - -WebKit::WebLayerTreeView* - TestWebKitPlatformSupport::createLayerTreeViewForTesting() { - scoped_ptr<WebLayerTreeViewImplForTesting> view( - new WebLayerTreeViewImplForTesting()); - - if (!view->Initialize()) - return NULL; - return view.release(); -} - -WebKit::WebLayerTreeView* - TestWebKitPlatformSupport::createLayerTreeViewForTesting( - TestViewType type) { - DCHECK_EQ(TestViewTypeUnitTest, type); - return createLayerTreeViewForTesting(); -} - -WebKit::WebData TestWebKitPlatformSupport::readFromFile( - const WebKit::WebString& path) { - base::FilePath file_path = base::FilePath::FromUTF16Unsafe(path); - - std::string buffer; - file_util::ReadFileToString(file_path, &buffer); - - return WebKit::WebData(buffer.data(), buffer.size()); -} diff --git a/chromium/webkit/support/test_webkit_platform_support.h b/chromium/webkit/support/test_webkit_platform_support.h deleted file mode 100644 index 0a4e4cb43b5..00000000000 --- a/chromium/webkit/support/test_webkit_platform_support.h +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_SUPPORT_TEST_WEBKIT_PLATFORM_SUPPORT_H_ -#define WEBKIT_SUPPORT_TEST_WEBKIT_PLATFORM_SUPPORT_H_ - -#include "base/compiler_specific.h" -#include "base/files/scoped_temp_dir.h" -#include "third_party/WebKit/public/platform/WebUnitTestSupport.h" -#include "webkit/child/webkitplatformsupport_child_impl.h" -#include "webkit/glue/simple_webmimeregistry_impl.h" -#include "webkit/glue/webfileutilities_impl.h" -#include "webkit/renderer/compositor_bindings/web_compositor_support_impl.h" -#include "webkit/support/mock_webclipboard_impl.h" -#include "webkit/support/weburl_loader_mock_factory.h" - -namespace WebKit { -class WebLayerTreeView; -} - -// An implementation of WebKitPlatformSupport for tests. -class TestWebKitPlatformSupport : - public WebKit::WebUnitTestSupport, - public webkit_glue::WebKitPlatformSupportChildImpl { - public: - TestWebKitPlatformSupport(); - virtual ~TestWebKitPlatformSupport(); - - virtual WebKit::WebMimeRegistry* mimeRegistry(); - virtual WebKit::WebClipboard* clipboard(); - virtual WebKit::WebFileUtilities* fileUtilities(); - virtual WebKit::WebIDBFactory* idbFactory(); - - virtual WebKit::WebURLLoader* createURLLoader(); - virtual WebKit::WebData loadResource(const char* name); - virtual WebKit::WebString queryLocalizedString( - WebKit::WebLocalizedString::Name name); - virtual WebKit::WebString queryLocalizedString( - WebKit::WebLocalizedString::Name name, - const WebKit::WebString& value); - virtual WebKit::WebString queryLocalizedString( - WebKit::WebLocalizedString::Name name, - const WebKit::WebString& value1, - const WebKit::WebString& value2); - virtual WebKit::WebString defaultLocale(); - -#if defined(OS_WIN) || defined(OS_MACOSX) - void SetThemeEngine(WebKit::WebThemeEngine* engine); - virtual WebKit::WebThemeEngine *themeEngine(); -#endif - - virtual WebKit::WebCompositorSupport* compositorSupport(); - - WebURLLoaderMockFactory* url_loader_factory() { - return &url_loader_factory_; - } - - const base::FilePath& file_system_root() const { - return file_system_root_.path(); - } - - virtual base::string16 GetLocalizedString(int message_id) OVERRIDE; - virtual base::StringPiece GetDataResource( - int resource_id, - ui::ScaleFactor scale_factor) OVERRIDE; - virtual webkit_glue::ResourceLoaderBridge* CreateResourceLoader( - const webkit_glue::ResourceLoaderBridge::RequestInfo& request_info) - OVERRIDE; - virtual webkit_glue::WebSocketStreamHandleBridge* CreateWebSocketBridge( - WebKit::WebSocketStreamHandle* handle, - webkit_glue::WebSocketStreamHandleDelegate* delegate) OVERRIDE; - - virtual WebKit::WebGestureCurve* createFlingAnimationCurve( - int device_source, - const WebKit::WebFloatPoint& velocity, - const WebKit::WebSize& cumulative_scroll); - - virtual WebKit::WebUnitTestSupport* unitTestSupport(); - - // WebUnitTestSupport implementation - virtual void registerMockedURL(const WebKit::WebURL& url, - const WebKit::WebURLResponse& response, - const WebKit::WebString& filePath); - virtual void registerMockedErrorURL(const WebKit::WebURL& url, - const WebKit::WebURLResponse& response, - const WebKit::WebURLError& error); - virtual void unregisterMockedURL(const WebKit::WebURL& url); - virtual void unregisterAllMockedURLs(); - virtual void serveAsynchronousMockedRequests(); - virtual WebKit::WebString webKitRootDir(); - virtual WebKit::WebLayerTreeView* createLayerTreeViewForTesting(); - virtual WebKit::WebLayerTreeView* createLayerTreeViewForTesting( - TestViewType type); - virtual WebKit::WebData readFromFile(const WebKit::WebString& path); - - private: - webkit_glue::SimpleWebMimeRegistryImpl mime_registry_; - MockWebClipboardImpl mock_clipboard_; - webkit_glue::WebFileUtilitiesImpl file_utilities_; - base::ScopedTempDir file_system_root_; - WebURLLoaderMockFactory url_loader_factory_; - webkit::WebCompositorSupportImpl compositor_support_; - -#if defined(OS_WIN) || defined(OS_MACOSX) - WebKit::WebThemeEngine* active_theme_engine_; -#endif - DISALLOW_COPY_AND_ASSIGN(TestWebKitPlatformSupport); -}; - -#endif // WEBKIT_SUPPORT_TEST_WEBKIT_PLATFORM_SUPPORT_H_ diff --git a/chromium/webkit/support/web_gesture_curve_mock.cc b/chromium/webkit/support/web_gesture_curve_mock.cc deleted file mode 100644 index a3b49176a7f..00000000000 --- a/chromium/webkit/support/web_gesture_curve_mock.cc +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/support/web_gesture_curve_mock.h" - -#include "third_party/WebKit/public/platform/WebFloatSize.h" -#include "third_party/WebKit/public/platform/WebGestureCurveTarget.h" -#include "webkit/support/weburl_loader_mock_factory.h" - -WebGestureCurveMock::WebGestureCurveMock(const WebKit::WebFloatPoint& velocity, - const WebKit::WebSize& cumulative_scroll) - : velocity_(velocity), - cumulative_scroll_(cumulative_scroll) { -} - -WebGestureCurveMock::~WebGestureCurveMock() { -} - -bool WebGestureCurveMock::apply(double time, - WebKit::WebGestureCurveTarget* target) { - WebKit::WebSize displacement(velocity_.x * time, velocity_.y * time); - WebKit::WebFloatSize increment(displacement.width - cumulative_scroll_.width, - displacement.height - cumulative_scroll_.height); - cumulative_scroll_ = displacement; - target->notifyCurrentFlingVelocity(WebKit::WebFloatSize(velocity_.x, - velocity_.y)); - // scrollBy() could delete this curve if the animation is over, so don't - // touch any member variables after making that call. - target->scrollBy(increment); - return true; -} diff --git a/chromium/webkit/support/web_gesture_curve_mock.h b/chromium/webkit/support/web_gesture_curve_mock.h deleted file mode 100644 index f05f4e98cb2..00000000000 --- a/chromium/webkit/support/web_gesture_curve_mock.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_SUPPORT_WEB_GESTURE_CURVE_MOCK_H_ -#define WEBKIT_SUPPORT_WEB_GESTURE_CURVE_MOCK_H_ - -#include "base/memory/scoped_ptr.h" -#include "third_party/WebKit/public/platform/WebFloatPoint.h" -#include "third_party/WebKit/public/platform/WebGestureCurve.h" -#include "third_party/WebKit/public/platform/WebSize.h" - -// A simple class for mocking a WebGestureCurve. The curve flings at velocity -// indefinitely. -class WebGestureCurveMock : public WebKit::WebGestureCurve { - public: - WebGestureCurveMock(const WebKit::WebFloatPoint& velocity, - const WebKit::WebSize& cumulative_scroll); - virtual ~WebGestureCurveMock(); - - // Returns false if curve has finished and can no longer be applied. - virtual bool apply(double time, - WebKit::WebGestureCurveTarget* target) OVERRIDE; - - private: - WebKit::WebFloatPoint velocity_; - WebKit::WebSize cumulative_scroll_; - - DISALLOW_COPY_AND_ASSIGN(WebGestureCurveMock); -}; - -#endif // WEBKIT_SUPPORT_WEB_GESTURE_CURVE_MOCK_H_ diff --git a/chromium/webkit/support/web_layer_tree_view_impl_for_testing.cc b/chromium/webkit/support/web_layer_tree_view_impl_for_testing.cc deleted file mode 100644 index e4b858cc460..00000000000 --- a/chromium/webkit/support/web_layer_tree_view_impl_for_testing.cc +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/support/web_layer_tree_view_impl_for_testing.h" - -#include "base/command_line.h" -#include "base/strings/string_number_conversions.h" -#include "base/synchronization/lock.h" -#include "cc/base/switches.h" -#include "cc/debug/fake_web_graphics_context_3d.h" -#include "cc/input/input_handler.h" -#include "cc/layers/layer.h" -#include "cc/output/context_provider.h" -#include "cc/output/output_surface.h" -#include "cc/output/software_output_device.h" -#include "cc/trees/layer_tree_host.h" -#include "third_party/WebKit/public/platform/Platform.h" -#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" -#include "third_party/WebKit/public/platform/WebLayer.h" -#include "third_party/WebKit/public/platform/WebLayerTreeView.h" -#include "third_party/WebKit/public/platform/WebRenderingStats.h" -#include "third_party/WebKit/public/platform/WebSize.h" -#include "webkit/common/gpu/test_context_provider_factory.h" -#include "webkit/renderer/compositor_bindings/web_layer_impl.h" -#include "webkit/support/test_webkit_platform_support.h" - -using WebKit::WebColor; -using WebKit::WebGraphicsContext3D; -using WebKit::WebRect; -using WebKit::WebRenderingStats; -using WebKit::WebSize; - -namespace webkit { - -WebLayerTreeViewImplForTesting::WebLayerTreeViewImplForTesting() {} - -WebLayerTreeViewImplForTesting::~WebLayerTreeViewImplForTesting() {} - -bool WebLayerTreeViewImplForTesting::Initialize() { - cc::LayerTreeSettings settings; - - // For web contents, layer transforms should scale up the contents of layers - // to keep content always crisp when possible. - settings.layer_transforms_should_scale_layer_contents = true; - - // Accelerated animations are enabled for unit tests. - settings.accelerated_animation_enabled = true; - layer_tree_host_ = cc::LayerTreeHost::Create(this, settings, NULL); - if (!layer_tree_host_) - return false; - return true; -} - -void WebLayerTreeViewImplForTesting::setSurfaceReady() { - layer_tree_host_->SetLayerTreeHostClientReady(); -} - -void WebLayerTreeViewImplForTesting::setRootLayer( - const WebKit::WebLayer& root) { - layer_tree_host_->SetRootLayer( - static_cast<const WebLayerImpl*>(&root)->layer()); -} - -void WebLayerTreeViewImplForTesting::clearRootLayer() { - layer_tree_host_->SetRootLayer(scoped_refptr<cc::Layer>()); -} - -void WebLayerTreeViewImplForTesting::setViewportSize( - const WebSize& unused_deprecated, - const WebSize& device_viewport_size) { - layer_tree_host_->SetViewportSize(device_viewport_size); -} - -WebSize WebLayerTreeViewImplForTesting::layoutViewportSize() const { - return layer_tree_host_->device_viewport_size(); -} - -WebSize WebLayerTreeViewImplForTesting::deviceViewportSize() const { - return layer_tree_host_->device_viewport_size(); -} - -void WebLayerTreeViewImplForTesting::setDeviceScaleFactor( - float device_scale_factor) { - layer_tree_host_->SetDeviceScaleFactor(device_scale_factor); -} - -float WebLayerTreeViewImplForTesting::deviceScaleFactor() const { - return layer_tree_host_->device_scale_factor(); -} - -void WebLayerTreeViewImplForTesting::setBackgroundColor(WebColor color) { - layer_tree_host_->set_background_color(color); -} - -void WebLayerTreeViewImplForTesting::setHasTransparentBackground( - bool transparent) { - layer_tree_host_->set_has_transparent_background(transparent); -} - -void WebLayerTreeViewImplForTesting::setVisible(bool visible) { - layer_tree_host_->SetVisible(visible); -} - -void WebLayerTreeViewImplForTesting::setPageScaleFactorAndLimits( - float page_scale_factor, - float minimum, - float maximum) { - layer_tree_host_->SetPageScaleFactorAndLimits( - page_scale_factor, minimum, maximum); -} - -void WebLayerTreeViewImplForTesting::startPageScaleAnimation( - const WebKit::WebPoint& scroll, - bool use_anchor, - float new_page_scale, - double duration_sec) {} - -void WebLayerTreeViewImplForTesting::setNeedsAnimate() { - layer_tree_host_->SetNeedsAnimate(); -} - -void WebLayerTreeViewImplForTesting::setNeedsRedraw() { - layer_tree_host_->SetNeedsRedraw(); -} - -bool WebLayerTreeViewImplForTesting::commitRequested() const { - return layer_tree_host_->CommitRequested(); -} - -void WebLayerTreeViewImplForTesting::composite() { - layer_tree_host_->Composite(base::TimeTicks::Now()); -} - -void WebLayerTreeViewImplForTesting::didStopFlinging() {} - -bool WebLayerTreeViewImplForTesting::compositeAndReadback( - void* pixels, const WebRect& rect_in_device_viewport) { - return layer_tree_host_->CompositeAndReadback(pixels, - rect_in_device_viewport); -} - -void WebLayerTreeViewImplForTesting::finishAllRendering() { - layer_tree_host_->FinishAllRendering(); -} - -void WebLayerTreeViewImplForTesting::setDeferCommits(bool defer_commits) { - layer_tree_host_->SetDeferCommits(defer_commits); -} - -void WebLayerTreeViewImplForTesting::renderingStats(WebRenderingStats&) const {} - -void WebLayerTreeViewImplForTesting::Layout() { -} - -void WebLayerTreeViewImplForTesting::ApplyScrollAndScale( - gfx::Vector2d scroll_delta, - float page_scale) {} - -scoped_ptr<cc::OutputSurface> -WebLayerTreeViewImplForTesting::CreateOutputSurface(bool fallback) { - scoped_ptr<cc::OutputSurface> surface; - scoped_ptr<WebGraphicsContext3D> context3d( - new cc::FakeWebGraphicsContext3D); - surface.reset(new cc::OutputSurface(context3d.Pass())); - return surface.Pass(); -} - -void WebLayerTreeViewImplForTesting::ScheduleComposite() { -} - -scoped_refptr<cc::ContextProvider> -WebLayerTreeViewImplForTesting::OffscreenContextProviderForMainThread() { - return webkit::gpu::TestContextProviderFactory::GetInstance()-> - OffscreenContextProviderForMainThread(); -} - -scoped_refptr<cc::ContextProvider> -WebLayerTreeViewImplForTesting::OffscreenContextProviderForCompositorThread() { - NOTREACHED(); - return NULL; -} - -} // namespace webkit diff --git a/chromium/webkit/support/web_layer_tree_view_impl_for_testing.h b/chromium/webkit/support/web_layer_tree_view_impl_for_testing.h deleted file mode 100644 index 612f0f06174..00000000000 --- a/chromium/webkit/support/web_layer_tree_view_impl_for_testing.h +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_SUPPORT_WEB_LAYER_TREE_VIEW_IMPL_FOR_TESTING_H_ -#define WEBKIT_SUPPORT_WEB_LAYER_TREE_VIEW_IMPL_FOR_TESTING_H_ - -#include "base/memory/scoped_ptr.h" -#include "cc/trees/layer_tree_host_client.h" -#include "third_party/WebKit/public/platform/WebLayerTreeView.h" - -namespace cc { -class LayerTreeHost; -} - -namespace WebKit { class WebLayer; } - -namespace webkit { - -class WebLayerTreeViewImplForTesting : public WebKit::WebLayerTreeView, - public cc::LayerTreeHostClient { - public: - WebLayerTreeViewImplForTesting(); - virtual ~WebLayerTreeViewImplForTesting(); - - bool Initialize(); - - // WebKit::WebLayerTreeView implementation. - virtual void setSurfaceReady(); - virtual void setRootLayer(const WebKit::WebLayer& layer); - virtual void clearRootLayer(); - virtual void setViewportSize(const WebKit::WebSize& unused_deprecated, - const WebKit::WebSize& device_viewport_size); - virtual WebKit::WebSize layoutViewportSize() const; - virtual WebKit::WebSize deviceViewportSize() const; - virtual void setDeviceScaleFactor(float scale_factor); - virtual float deviceScaleFactor() const; - virtual void setBackgroundColor(WebKit::WebColor); - virtual void setHasTransparentBackground(bool transparent); - virtual void setVisible(bool visible); - virtual void setPageScaleFactorAndLimits(float page_scale_factor, - float minimum, - float maximum); - virtual void startPageScaleAnimation(const WebKit::WebPoint& destination, - bool use_anchor, - float new_page_scale, - double duration_sec); - virtual void setNeedsAnimate(); - virtual void setNeedsRedraw(); - virtual bool commitRequested() const; - virtual void composite(); - virtual void didStopFlinging(); - virtual bool compositeAndReadback(void* pixels, const WebKit::WebRect& rect); - virtual void finishAllRendering(); - virtual void setDeferCommits(bool defer_commits); - virtual void renderingStats( - WebKit::WebRenderingStats& stats) const; // NOLINT(runtime/references) - - // cc::LayerTreeHostClient implementation. - virtual void WillBeginFrame() OVERRIDE {} - virtual void DidBeginFrame() OVERRIDE {} - virtual void Animate(double frame_begin_time) OVERRIDE {} - virtual void Layout() OVERRIDE; - virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, float page_scale) - OVERRIDE; - virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) - OVERRIDE; - virtual void DidInitializeOutputSurface(bool success) OVERRIDE {} - virtual void WillCommit() OVERRIDE {} - virtual void DidCommit() OVERRIDE {} - virtual void DidCommitAndDrawFrame() OVERRIDE {} - virtual void DidCompleteSwapBuffers() OVERRIDE {} - virtual void ScheduleComposite() OVERRIDE; - virtual scoped_refptr<cc::ContextProvider> - OffscreenContextProviderForMainThread() OVERRIDE; - virtual scoped_refptr<cc::ContextProvider> - OffscreenContextProviderForCompositorThread() OVERRIDE; - - private: - scoped_ptr<cc::LayerTreeHost> layer_tree_host_; - - DISALLOW_COPY_AND_ASSIGN(WebLayerTreeViewImplForTesting); -}; - -} // namespace webkit - -#endif // WEBKIT_SUPPORT_WEB_LAYER_TREE_VIEW_IMPL_FOR_TESTING_H_ diff --git a/chromium/webkit/support/webkit_support.cc b/chromium/webkit/support/webkit_support.cc deleted file mode 100644 index c5846385a70..00000000000 --- a/chromium/webkit/support/webkit_support.cc +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/support/webkit_support.h" - -#include "base/command_line.h" -#include "base/debug/debugger.h" -#include "base/debug/stack_trace.h" -#include "base/logging.h" -#include "base/message_loop/message_loop.h" -#include "base/path_service.h" -#include "base/process/memory.h" -#include "base/run_loop.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "third_party/WebKit/public/web/WebCache.h" -#include "third_party/WebKit/public/web/WebKit.h" -#include "third_party/WebKit/public/web/WebRuntimeFeatures.h" -#include "url/url_util.h" -#include "webkit/child/webkitplatformsupport_impl.h" -#include "webkit/common/user_agent/user_agent.h" -#include "webkit/common/user_agent/user_agent_util.h" -#include "webkit/glue/webkit_glue.h" -#include "webkit/support/platform_support.h" -#include "webkit/support/test_webkit_platform_support.h" - -#if defined(OS_ANDROID) -#include "base/test/test_support_android.h" -#endif - -namespace { - -// All fatal log messages (e.g. DCHECK failures) imply unit test failures -void UnitTestAssertHandler(const std::string& str) { - FAIL() << str; -} - -void InitLogging() { -#if defined(OS_WIN) - if (!::IsDebuggerPresent()) { - UINT new_flags = SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX - | SEM_NOGPFAULTERRORBOX; - - // Preserve existing error mode, as discussed at - // http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx - UINT existing_flags = SetErrorMode(new_flags); - SetErrorMode(existing_flags | new_flags); - - // Don't pop up dialog on assertion failure, log to stdout instead. - _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE); - _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDOUT); - } -#endif - -#if defined(OS_ANDROID) - // On Android we expect the log to appear in logcat. - base::InitAndroidTestLogging(); -#else - base::FilePath log_filename; - PathService::Get(base::DIR_EXE, &log_filename); - log_filename = log_filename.AppendASCII("DumpRenderTree.log"); - logging::LoggingSettings settings; - // Only log to a file. This prevents debugging output from disrupting - // whether or not we pass. - settings.logging_dest = logging::LOG_TO_FILE; - settings.log_file = log_filename.value().c_str(); - settings.delete_old = logging::DELETE_OLD_LOG_FILE; - logging::InitLogging(settings); - - // We want process and thread IDs because we may have multiple processes. - const bool kProcessId = true; - const bool kThreadId = true; - const bool kTimestamp = true; - const bool kTickcount = true; - logging::SetLogItems(kProcessId, kThreadId, !kTimestamp, kTickcount); -#endif // else defined(OS_ANDROID) -} - -class TestEnvironment { - public: -#if defined(OS_ANDROID) - // Android UI message loop goes through Java, so don't use it in tests. - typedef base::MessageLoop MessageLoopType; -#else - typedef base::MessageLoopForUI MessageLoopType; -#endif - - TestEnvironment() { - logging::SetLogAssertHandler(UnitTestAssertHandler); - main_message_loop_.reset(new MessageLoopType); - - // TestWebKitPlatformSupport must be instantiated after MessageLoopType. - webkit_platform_support_.reset(new TestWebKitPlatformSupport); - } - - TestWebKitPlatformSupport* webkit_platform_support() const { - return webkit_platform_support_.get(); - } - - private: - scoped_ptr<MessageLoopType> main_message_loop_; - scoped_ptr<TestWebKitPlatformSupport> webkit_platform_support_; -}; - -TestEnvironment* test_environment; - -} // namespace - -namespace webkit_support { - -void SetUpTestEnvironmentForUnitTests() { - base::debug::EnableInProcessStackDumping(); - base::EnableTerminationOnHeapCorruption(); - - // Initialize the singleton CommandLine with fixed values. Some code refer to - // CommandLine::ForCurrentProcess(). We don't use the actual command-line - // arguments of DRT to avoid unexpected behavior change. - // - // webkit/glue/plugin/plugin_list_posix.cc checks --debug-plugin-loading. - // webkit/glue/plugin/plugin_list_win.cc checks --old-wmp. - // If DRT needs these flags, specify them in the following kFixedArguments. - const char* kFixedArguments[] = {"DumpRenderTree"}; - CommandLine::Init(arraysize(kFixedArguments), kFixedArguments); - - WebKit::WebRuntimeFeatures::enableStableFeatures(true); - WebKit::WebRuntimeFeatures::enableExperimentalFeatures(true); - WebKit::WebRuntimeFeatures::enableTestOnlyFeatures(true); - - // Explicitly initialize the GURL library before spawning any threads. - // Otherwise crash may happend when different threads try to create a GURL - // at same time. - url_util::Initialize(); - webkit_support::BeforeInitialize(); - test_environment = new TestEnvironment; - webkit_support::AfterInitialize(); - webkit_glue::SetUserAgent(webkit_glue::BuildUserAgentFromProduct( - "DumpRenderTree/0.0.0.0"), false); -} - -void TearDownTestEnvironment() { - // Flush any remaining messages before we kill ourselves. - // http://code.google.com/p/chromium/issues/detail?id=9500 - base::RunLoop().RunUntilIdle(); - - BeforeShutdown(); - if (RunningOnValgrind()) - WebKit::WebCache::clear(); - WebKit::shutdown(); - delete test_environment; - test_environment = NULL; - AfterShutdown(); - logging::CloseLogFile(); -} - -} // namespace webkit_support diff --git a/chromium/webkit/support/webkit_support.gyp b/chromium/webkit/support/webkit_support.gyp index 5bbf80a127a..f7d6d5fb853 100644 --- a/chromium/webkit/support/webkit_support.gyp +++ b/chromium/webkit/support/webkit_support.gyp @@ -11,7 +11,6 @@ 'includes': [ '../../build/win_precompile.gypi', '../glue/webkit_glue.gypi', - 'webkit_support.gypi', ], }], ], diff --git a/chromium/webkit/support/webkit_support.gypi b/chromium/webkit/support/webkit_support.gypi deleted file mode 100644 index bc7fae0b9e7..00000000000 --- a/chromium/webkit/support/webkit_support.gypi +++ /dev/null @@ -1,119 +0,0 @@ -# Copyright (c) 2012 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -{ - 'variables': { - 'chromium_code': 1, - }, - 'targets': [ - { - 'target_name': 'webkit_support', - 'type': 'static_library', - 'variables': { 'enable_wexit_time_destructors': 1, }, - 'dependencies': [ - '<(DEPTH)/base/base.gyp:base', - '<(DEPTH)/base/base.gyp:base_i18n', - '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', - '<(DEPTH)/cc/cc.gyp:cc', - '<(DEPTH)/media/media.gyp:media', - '<(DEPTH)/net/net.gyp:net', - '<(DEPTH)/skia/skia.gyp:skia', - '<(DEPTH)/testing/gtest.gyp:gtest', - '<(DEPTH)/ui/gl/gl.gyp:gl', - '<(DEPTH)/ui/ui.gyp:shell_dialogs', - '<(DEPTH)/ui/ui.gyp:ui', - '<(DEPTH)/webkit/common/gpu/webkit_gpu.gyp:webkit_gpu', - '<(DEPTH)/webkit/common/user_agent/webkit_user_agent.gyp:user_agent', - '<(DEPTH)/webkit/common/webkit_common.gyp:webkit_common', - '<(DEPTH)/webkit/renderer/compositor_bindings/compositor_bindings.gyp:webkit_compositor_bindings', - '<(DEPTH)/webkit/renderer/compositor_bindings/compositor_bindings.gyp:webkit_compositor_support', - '<(DEPTH)/webkit/renderer/webkit_renderer.gyp:webkit_renderer', - '<(DEPTH)/webkit/storage_browser.gyp:webkit_storage_browser', - '<(DEPTH)/webkit/storage_common.gyp:webkit_storage_common', - '<(DEPTH)/webkit/storage_renderer.gyp:webkit_storage_renderer', - 'glue', - 'glue_child', - 'webkit_support_common', - ], - 'include_dirs': [ - '<(SHARED_INTERMEDIATE_DIR)/webkit', # for a header generated by grit - ], - 'defines': [ - # Technically not a unit test but require functions available only to - # unit tests. - 'UNIT_TEST' - ], - 'sources': [ - 'drt_application_mac.h', - 'drt_application_mac.mm', - 'platform_support.h', - 'platform_support_android.cc', - 'platform_support_linux.cc', - 'platform_support_mac.mm', - 'platform_support_win.cc', - 'test_webkit_platform_support.cc', - 'test_webkit_platform_support.h', - 'webkit_support.cc', - 'webkit_support.h', - 'webkit_support_glue.cc', - 'weburl_loader_mock.cc', - 'weburl_loader_mock.h', - 'weburl_loader_mock_factory.cc', - 'weburl_loader_mock_factory.h', - 'web_gesture_curve_mock.cc', - 'web_gesture_curve_mock.h', - 'web_layer_tree_view_impl_for_testing.cc', - 'web_layer_tree_view_impl_for_testing.h', - ], - 'conditions': [ - ['OS=="mac"', { - 'copies': [{ - 'destination': '<(SHARED_INTERMEDIATE_DIR)/webkit', - 'files': [ - '../tools/test_shell/resources/missingImage.png', - '../tools/test_shell/resources/textAreaResizeCorner.png', - ], - }], - },{ # OS!="mac" - 'copies': [{ - 'destination': '<(PRODUCT_DIR)/DumpRenderTree_resources', - 'files': [ - '../tools/test_shell/resources/missingImage.gif', - '../tools/test_shell/resources/textAreaResizeCorner.png', - ], - }], - }], - ], - # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. - 'msvs_disabled_warnings': [ 4267, ], - }, - - { - 'target_name': 'webkit_support_common', - 'type': 'static_library', - 'variables': { 'enable_wexit_time_destructors': 1, }, - 'dependencies': [ - '<(DEPTH)/base/base.gyp:base', - '<(DEPTH)/net/net.gyp:net', - '<(DEPTH)/skia/skia.gyp:skia', - '<(DEPTH)/third_party/zlib/zlib.gyp:zlib', - '<(DEPTH)/ui/ui.gyp:ui', - '<(DEPTH)/webkit/common/user_agent/webkit_user_agent.gyp:user_agent', - '<(DEPTH)/webkit/renderer/webkit_renderer.gyp:webkit_renderer', - 'glue', - ], - 'export_dependent_settings': [ - '<(DEPTH)/base/base.gyp:base', - ], - 'sources': [ - '<(DEPTH)/webkit/support/mac/DumpRenderTreePasteboard.h', - '<(DEPTH)/webkit/support/mac/DumpRenderTreePasteboard.m', - '<(DEPTH)/webkit/support/mock_webclipboard_impl.cc', - '<(DEPTH)/webkit/support/mock_webclipboard_impl.h', - ], - # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. - 'msvs_disabled_warnings': [ 4267, ], - }, - ], -} diff --git a/chromium/webkit/support/webkit_support.h b/chromium/webkit/support/webkit_support.h deleted file mode 100644 index 9369be1fe06..00000000000 --- a/chromium/webkit/support/webkit_support.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_SUPPORT_WEBKIT_SUPPORT_H_ -#define WEBKIT_SUPPORT_WEBKIT_SUPPORT_H_ - -// This package provides functions used by DumpRenderTree/chromium. -namespace webkit_support { - -// Initializes or terminates a test environment. -// |unit_test_mode| should be set to true when running in a TestSuite, in which -// case no AtExitManager is created and ICU is not initialized (as it is already -// done by the TestSuite). -// SetUpTestEnvironment() and SetUpTestEnvironmentForUnitTests() calls -// WebKit::initialize(). -// TearDownTestEnvironment() calls WebKit::shutdown(). -// SetUpTestEnvironmentForUnitTests() should be used when running in a -// TestSuite, in which case no AtExitManager is created and ICU is not -// initialized (as it is already done by the TestSuite). -void SetUpTestEnvironmentForUnitTests(); -void TearDownTestEnvironment(); - -} // namespace webkit_support - -#endif // WEBKIT_SUPPORT_WEBKIT_SUPPORT_H_ diff --git a/chromium/webkit/support/webkit_support_glue.cc b/chromium/webkit/support/webkit_support_glue.cc deleted file mode 100644 index b49522d0f72..00000000000 --- a/chromium/webkit/support/webkit_support_glue.cc +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/glue/webkit_glue.h" - -#include "base/base_paths.h" -#include "base/path_service.h" - -// Functions needed by webkit_glue. - -namespace webkit_glue { - -void AppendToLog(const char*, int, const char*) { -} - -bool GetPluginFinderURL(std::string* plugin_finder_url) { - return false; -} - -#if defined(OS_WIN) -bool DownloadUrl(const std::string& url, HWND caller_window) { - return false; -} -#endif - -void EnableSpdy(bool enable) { -} - -void UserMetricsRecordAction(const std::string& action) { -} - -} // namespace webkit_glue diff --git a/chromium/webkit/support/weburl_loader_mock.cc b/chromium/webkit/support/weburl_loader_mock.cc deleted file mode 100644 index 06aff4da960..00000000000 --- a/chromium/webkit/support/weburl_loader_mock.cc +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/support/weburl_loader_mock.h" - -#include "base/logging.h" -#include "third_party/WebKit/public/platform/WebData.h" -#include "third_party/WebKit/public/platform/WebURLError.h" -#include "third_party/WebKit/public/platform/WebURLLoaderClient.h" -#include "webkit/support/weburl_loader_mock_factory.h" - -WebURLLoaderMock::WebURLLoaderMock(WebURLLoaderMockFactory* factory, - WebKit::WebURLLoader* default_loader) - : factory_(factory), - client_(NULL), - default_loader_(default_loader), - using_default_loader_(false), - is_deferred_(false) { -} - -WebURLLoaderMock::~WebURLLoaderMock() { -} - -void WebURLLoaderMock::ServeAsynchronousRequest( - const WebKit::WebURLResponse& response, - const WebKit::WebData& data, - const WebKit::WebURLError& error) { - DCHECK(!using_default_loader_); - if (!client_) - return; - - client_->didReceiveResponse(this, response); - - if (error.reason) { - client_->didFail(this, error); - return; - } - client_->didReceiveData(this, data.data(), data.size(), data.size()); - client_->didFinishLoading(this, 0); -} - -WebKit::WebURLRequest WebURLLoaderMock::ServeRedirect( - const WebKit::WebURLResponse& redirectResponse) { - WebKit::WebURLRequest newRequest; - newRequest.initialize(); - GURL redirectURL(redirectResponse.httpHeaderField("Location")); - newRequest.setURL(redirectURL); - client_->willSendRequest(this, newRequest, redirectResponse); - return newRequest; -} - -void WebURLLoaderMock::loadSynchronously(const WebKit::WebURLRequest& request, - WebKit::WebURLResponse& response, - WebKit::WebURLError& error, - WebKit::WebData& data) { - if (factory_->IsMockedURL(request.url())) { - factory_->LoadSynchronously(request, &response, &error, &data); - return; - } - DCHECK(static_cast<const GURL&>(request.url()).SchemeIs("data")) - << "loadSynchronously shouldn't be falling back: " - << request.url().spec().data(); - using_default_loader_ = true; - default_loader_->loadSynchronously(request, response, error, data); -} - -void WebURLLoaderMock::loadAsynchronously(const WebKit::WebURLRequest& request, - WebKit::WebURLLoaderClient* client) { - if (factory_->IsMockedURL(request.url())) { - client_ = client; - factory_->LoadAsynchronouly(request, this); - return; - } - DCHECK(static_cast<const GURL&>(request.url()).SchemeIs("data")) - << "loadAsynchronously shouldn't be falling back: " - << request.url().spec().data(); - using_default_loader_ = true; - default_loader_->loadAsynchronously(request, client); -} - -void WebURLLoaderMock::cancel() { - if (using_default_loader_) { - default_loader_->cancel(); - return; - } - client_ = NULL; - factory_->CancelLoad(this); -} - -void WebURLLoaderMock::setDefersLoading(bool deferred) { - is_deferred_ = deferred; - if (using_default_loader_) { - default_loader_->setDefersLoading(deferred); - return; - } - NOTIMPLEMENTED(); -} diff --git a/chromium/webkit/support/weburl_loader_mock.h b/chromium/webkit/support/weburl_loader_mock.h deleted file mode 100644 index 46de7be0918..00000000000 --- a/chromium/webkit/support/weburl_loader_mock.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_SUPPORT_WEBURL_LOADER_MOCK_H_ -#define WEBKIT_SUPPORT_WEBURL_LOADER_MOCK_H_ - -#include "base/basictypes.h" -#include "base/memory/scoped_ptr.h" -#include "third_party/WebKit/public/platform/WebURLLoader.h" - -namespace WebKit { -class WebData; -struct WebURLError; -class WebURLLoaderClient; -class WebURLRequest; -class WebURLResponse; -} - -class WebURLLoaderMockFactory; - -// A simple class for mocking WebURLLoader. -// If the WebURLLoaderMockFactory it is associated with has been configured to -// mock the request it gets, it serves the mocked resource. Otherwise it just -// forwards it to the default loader. -class WebURLLoaderMock : public WebKit::WebURLLoader { - public: - // This object becomes the owner of |default_loader|. - WebURLLoaderMock(WebURLLoaderMockFactory* factory, - WebKit::WebURLLoader* default_loader); - virtual ~WebURLLoaderMock(); - - // Simulates the asynchronous request being served. - void ServeAsynchronousRequest(const WebKit::WebURLResponse& response, - const WebKit::WebData& data, - const WebKit::WebURLError& error); - - // Simulates the redirect being served. - WebKit::WebURLRequest ServeRedirect( - const WebKit::WebURLResponse& redirectResponse); - - // WebURLLoader methods: - virtual void loadSynchronously(const WebKit::WebURLRequest& request, - WebKit::WebURLResponse& response, - WebKit::WebURLError& error, - WebKit::WebData& data); - virtual void loadAsynchronously(const WebKit::WebURLRequest& request, - WebKit::WebURLLoaderClient* client); - virtual void cancel(); - virtual void setDefersLoading(bool defer); - - bool isDeferred() { return is_deferred_; } - - private: - WebURLLoaderMockFactory* factory_; - WebKit::WebURLLoaderClient* client_; - scoped_ptr<WebKit::WebURLLoader> default_loader_; - bool using_default_loader_; - bool is_deferred_; - - DISALLOW_COPY_AND_ASSIGN(WebURLLoaderMock); -}; - -#endif // WEBKIT_SUPPORT_WEBURL_LOADER_MOCK_H_ diff --git a/chromium/webkit/support/weburl_loader_mock_factory.cc b/chromium/webkit/support/weburl_loader_mock_factory.cc deleted file mode 100644 index f459211f015..00000000000 --- a/chromium/webkit/support/weburl_loader_mock_factory.cc +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "webkit/support/weburl_loader_mock_factory.h" - -#include "base/file_util.h" -#include "base/logging.h" -#include "base/run_loop.h" -#include "third_party/WebKit/public/platform/WebString.h" -#include "third_party/WebKit/public/platform/WebURLError.h" -#include "third_party/WebKit/public/platform/WebURLRequest.h" -#include "third_party/WebKit/public/platform/WebURLResponse.h" -#include "third_party/WebKit/public/web/WebCache.h" -#include "webkit/support/webkit_support.h" -#include "webkit/support/weburl_loader_mock.h" - -using WebKit::WebCache; -using WebKit::WebData; -using WebKit::WebString; -using WebKit::WebURL; -using WebKit::WebURLError; -using WebKit::WebURLLoader; -using WebKit::WebURLRequest; -using WebKit::WebURLResponse; - -WebURLLoaderMockFactory::WebURLLoaderMockFactory() {} - -WebURLLoaderMockFactory::~WebURLLoaderMockFactory() {} - -void WebURLLoaderMockFactory::RegisterURL(const WebURL& url, - const WebURLResponse& response, - const WebString& file_path) { - ResponseInfo response_info; - response_info.response = response; - if (!file_path.isNull() && !file_path.isEmpty()) { -#if defined(OS_POSIX) - // TODO(jcivelli): On Linux, UTF8 might not be correct. - response_info.file_path = - base::FilePath(static_cast<std::string>(file_path.utf8())); -#elif defined(OS_WIN) - string16 file_path_16 = file_path; - response_info.file_path = base::FilePath(std::wstring( - file_path_16.data(), file_path_16.length())); -#endif - DCHECK(base::PathExists(response_info.file_path)) - << response_info.file_path.MaybeAsASCII() << " does not exist."; - } - - DCHECK(url_to_reponse_info_.find(url) == url_to_reponse_info_.end()); - url_to_reponse_info_[url] = response_info; -} - - -void WebURLLoaderMockFactory::RegisterErrorURL(const WebURL& url, - const WebURLResponse& response, - const WebURLError& error) { - DCHECK(url_to_reponse_info_.find(url) == url_to_reponse_info_.end()); - RegisterURL(url, response, WebString()); - url_to_error_info_[url] = error; -} - -void WebURLLoaderMockFactory::UnregisterURL(const WebKit::WebURL& url) { - URLToResponseMap::iterator iter = url_to_reponse_info_.find(url); - DCHECK(iter != url_to_reponse_info_.end()); - url_to_reponse_info_.erase(iter); - - URLToErrorMap::iterator error_iter = url_to_error_info_.find(url); - if (error_iter != url_to_error_info_.end()) - url_to_error_info_.erase(error_iter); -} - -void WebURLLoaderMockFactory::UnregisterAllURLs() { - url_to_reponse_info_.clear(); - url_to_error_info_.clear(); - WebCache::clear(); -} - -void WebURLLoaderMockFactory::ServeAsynchronousRequests() { - last_handled_asynchronous_request_.reset(); - // Serving a request might trigger more requests, so we cannot iterate on - // pending_loaders_ as it might get modified. - while (!pending_loaders_.empty()) { - LoaderToRequestMap::iterator iter = pending_loaders_.begin(); - WebURLLoaderMock* loader = iter->first; - const WebURLRequest& request = iter->second; - WebURLResponse response; - WebURLError error; - WebData data; - last_handled_asynchronous_request_ = request; - LoadRequest(request, &response, &error, &data); - // Follow any redirects while the loader is still active. - while (response.httpStatusCode() >= 300 && - response.httpStatusCode() < 400) { - WebURLRequest newRequest = loader->ServeRedirect(response); - if (!IsPending(loader) || loader->isDeferred()) - break; - last_handled_asynchronous_request_ = newRequest; - LoadRequest(newRequest, &response, &error, &data); - } - // Serve the request if the loader is still active. - if (IsPending(loader) && !loader->isDeferred()) - loader->ServeAsynchronousRequest(response, data, error); - // The loader might have already been removed. - pending_loaders_.erase(loader); - } - base::RunLoop().RunUntilIdle(); -} - -WebKit::WebURLRequest -WebURLLoaderMockFactory::GetLastHandledAsynchronousRequest() { - return last_handled_asynchronous_request_; -} - -bool WebURLLoaderMockFactory::IsMockedURL(const WebKit::WebURL& url) { - return url_to_reponse_info_.find(url) != url_to_reponse_info_.end(); -} - -void WebURLLoaderMockFactory::CancelLoad(WebURLLoaderMock* loader) { - LoaderToRequestMap::iterator iter = pending_loaders_.find(loader); - DCHECK(iter != pending_loaders_.end()); - pending_loaders_.erase(iter); -} - -WebURLLoader* WebURLLoaderMockFactory::CreateURLLoader( - WebURLLoader* default_loader) { - DCHECK(default_loader); - return new WebURLLoaderMock(this, default_loader); -} - -void WebURLLoaderMockFactory::LoadSynchronously(const WebURLRequest& request, - WebURLResponse* response, - WebURLError* error, - WebData* data) { - LoadRequest(request, response, error, data); -} - -void WebURLLoaderMockFactory::LoadAsynchronouly(const WebURLRequest& request, - WebURLLoaderMock* loader) { - LoaderToRequestMap::iterator iter = pending_loaders_.find(loader); - DCHECK(iter == pending_loaders_.end()); - pending_loaders_[loader] = request; -} - -void WebURLLoaderMockFactory::LoadRequest(const WebURLRequest& request, - WebURLResponse* response, - WebURLError* error, - WebData* data) { - URLToErrorMap::const_iterator error_iter = - url_to_error_info_.find(request.url()); - if (error_iter != url_to_error_info_.end()) - *error = error_iter->second; - - URLToResponseMap::const_iterator iter = - url_to_reponse_info_.find(request.url()); - if (iter == url_to_reponse_info_.end()) { - // Non mocked URLs should not have been passed to the default URLLoader. - NOTREACHED(); - return; - } - - if (!error->reason && !ReadFile(iter->second.file_path, data)) { - NOTREACHED(); - return; - } - - *response = iter->second.response; -} - -bool WebURLLoaderMockFactory::IsPending(WebURLLoaderMock* loader) { - LoaderToRequestMap::iterator iter = pending_loaders_.find(loader); - return iter != pending_loaders_.end(); -} - -// static -bool WebURLLoaderMockFactory::ReadFile(const base::FilePath& file_path, - WebData* data) { - int64 file_size = 0; - if (!file_util::GetFileSize(file_path, &file_size)) - return false; - - int size = static_cast<int>(file_size); - scoped_ptr<char[]> buffer(new char[size]); - data->reset(); - int read_count = file_util::ReadFile(file_path, buffer.get(), size); - if (read_count == -1) - return false; - DCHECK(read_count == size); - data->assign(buffer.get(), size); - - return true; -} diff --git a/chromium/webkit/support/weburl_loader_mock_factory.h b/chromium/webkit/support/weburl_loader_mock_factory.h deleted file mode 100644 index 8f00fc0e27d..00000000000 --- a/chromium/webkit/support/weburl_loader_mock_factory.h +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef WEBKIT_SUPPORT_WEBURL_LOADER_MOCK_FACTORY_H_ -#define WEBKIT_SUPPORT_WEBURL_LOADER_MOCK_FACTORY_H_ - -#include <map> - -#include "base/files/file_path.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/platform/WebURLError.h" -#include "third_party/WebKit/public/platform/WebURLRequest.h" -#include "third_party/WebKit/public/platform/WebURLResponse.h" - -namespace WebKit { -class WebData; -class WebURLLoader; -} - -class WebURLLoaderMock; - -// A factory that creates WebURLLoaderMock to simulate resource loading in -// tests. -// You register files for specific URLs, the content of the file is then served -// when these URLs are loaded. -// In order to serve the asynchronous requests, you need to invoke -// ServeAsynchronousRequest. -class WebURLLoaderMockFactory { - public: - WebURLLoaderMockFactory(); - virtual ~WebURLLoaderMockFactory(); - - // Called by TestWebKitPlatformSupport to create a WebURLLoader. - // Non-mocked request are forwarded to |default_loader| which should not be - // NULL. - virtual WebKit::WebURLLoader* CreateURLLoader( - WebKit::WebURLLoader* default_loader); - - // Registers a response and the contents to be served when the specified URL - // is loaded. - void RegisterURL(const WebKit::WebURL& url, - const WebKit::WebURLResponse& response, - const WebKit::WebString& filePath); - - // Registers an error to be served when the specified URL is requested. - void RegisterErrorURL(const WebKit::WebURL& url, - const WebKit::WebURLResponse& response, - const WebKit::WebURLError& error); - - // Unregisters |url| so it will no longer be mocked. - void UnregisterURL(const WebKit::WebURL& url); - - // Unregister all URLs so no URL will be mocked anymore. - void UnregisterAllURLs(); - - // Serves all the pending asynchronous requests. - void ServeAsynchronousRequests(); - - // Returns the last request handled by |ServeAsynchronousRequests()|. - WebKit::WebURLRequest GetLastHandledAsynchronousRequest(); - - // Returns true if |url| was registered for being mocked. - bool IsMockedURL(const WebKit::WebURL& url); - - // Called by the loader to load a resource. - void LoadSynchronously(const WebKit::WebURLRequest& request, - WebKit::WebURLResponse* response, - WebKit::WebURLError* error, - WebKit::WebData* data); - void LoadAsynchronouly(const WebKit::WebURLRequest& request, - WebURLLoaderMock* loader); - - // Removes the loader from the list of pending loaders. - void CancelLoad(WebURLLoaderMock* loader); - - private: - struct ResponseInfo { - WebKit::WebURLResponse response; - base::FilePath file_path; - }; - - - // Loads the specified request and populates the response, error and data - // accordingly. - void LoadRequest(const WebKit::WebURLRequest& request, - WebKit::WebURLResponse* response, - WebKit::WebURLError* error, - WebKit::WebData* data); - - // Checks if the loader is pending. Otherwise, it may have been deleted. - bool IsPending(WebURLLoaderMock* loader); - - // Reads |m_filePath| and puts its content in |data|. - // Returns true if it successfully read the file. - static bool ReadFile(const base::FilePath& file_path, WebKit::WebData* data); - - // The loaders that have not being served data yet. - typedef std::map<WebURLLoaderMock*, WebKit::WebURLRequest> LoaderToRequestMap; - LoaderToRequestMap pending_loaders_; - - typedef std::map<GURL, WebKit::WebURLError> URLToErrorMap; - URLToErrorMap url_to_error_info_; - - // Table of the registered URLs and the responses that they should receive. - typedef std::map<GURL, ResponseInfo> URLToResponseMap; - URLToResponseMap url_to_reponse_info_; - - WebKit::WebURLRequest last_handled_asynchronous_request_; - - DISALLOW_COPY_AND_ASSIGN(WebURLLoaderMockFactory); -}; - -#endif // WEBKIT_SUPPORT_WEBURL_LOADER_MOCK_FACTORY_H_ - |