diff options
133 files changed, 952 insertions, 1186 deletions
diff --git a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc index 8872dd7..979f30a6 100644 --- a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc +++ b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc @@ -209,7 +209,7 @@ AwResourceDispatcherHostDelegate::~AwResourceDispatcherHostDelegate() { void AwResourceDispatcherHostDelegate::RequestBeginning( net::URLRequest* request, content::ResourceContext* resource_context, - appcache::AppCacheService* appcache_service, + content::AppCacheService* appcache_service, ResourceType::Type resource_type, int child_id, int route_id, diff --git a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h index 8702b09..e8f9c73 100644 --- a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h +++ b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.h @@ -32,7 +32,7 @@ class AwResourceDispatcherHostDelegate virtual void RequestBeginning( net::URLRequest* request, content::ResourceContext* resource_context, - appcache::AppCacheService* appcache_service, + content::AppCacheService* appcache_service, ResourceType::Type resource_type, int child_id, int route_id, diff --git a/android_webview/tools/third_party_files_whitelist.txt b/android_webview/tools/third_party_files_whitelist.txt index 9347474..f612f5d 100644 --- a/android_webview/tools/third_party_files_whitelist.txt +++ b/android_webview/tools/third_party_files_whitelist.txt @@ -181,11 +181,11 @@ ui/gfx/codec/png_codec.cc # Copyright The Chromium Authors and Apple Inc; BSD license. This third-party # code is taken from WebKit, the license for which we already pick up from # webkit/. -webkit/browser/appcache/manifest_parser.cc +content/browser/appcache/manifest_parser.cc # Copyright The Chromium Authors and Apple Inc; BSD license. This third-party # code is taken from WebKit, the license for which we already pick up from # webkit/. -webkit/browser/appcache/manifest_parser.h +content/browser/appcache/manifest_parser.h # Copyright The Chromium Authors and Netscape Communications Corporation; BSD # and (MPL, GPL v2 or LGPL v2) licenses. This third-party code is taken from # Mozilla, the license for which we already pick up from third_party/npapi/. diff --git a/base/debug/tsan_suppressions.cc b/base/debug/tsan_suppressions.cc index 46868d2..3a4a7e0 100644 --- a/base/debug/tsan_suppressions.cc +++ b/base/debug/tsan_suppressions.cc @@ -289,7 +289,7 @@ char kTSanDefaultSuppressions[] = "deadlock:g_type_add_interface_static\n" // http:://crbug.com/386385 -"race:appcache::AppCacheStorageImpl::DatabaseTask::CallRunCompleted\n" +"race:content::AppCacheStorageImpl::DatabaseTask::CallRunCompleted\n" // http://crbug.com/388730 "race:g_next_user_script_id\n" diff --git a/chrome/browser/browsing_data/browsing_data_appcache_helper.cc b/chrome/browser/browsing_data/browsing_data_appcache_helper.cc index 9810d02..8fb5d42 100644 --- a/chrome/browser/browsing_data/browsing_data_appcache_helper.cc +++ b/chrome/browser/browsing_data/browsing_data_appcache_helper.cc @@ -12,8 +12,6 @@ #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/storage_partition.h" -#include "webkit/browser/appcache/appcache_database.h" -#include "webkit/browser/appcache/appcache_storage.h" using content::BrowserThread; using content::BrowserContext; @@ -29,7 +27,7 @@ void BrowsingDataAppCacheHelper::StartFetching(const base::Closure& callback) { DCHECK(!is_fetching_); DCHECK_EQ(false, callback.is_null()); is_fetching_ = true; - info_collection_ = new appcache::AppCacheInfoCollection; + info_collection_ = new content::AppCacheInfoCollection; completion_callback_ = callback; BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, @@ -65,7 +63,7 @@ void BrowsingDataAppCacheHelper::OnFetchComplete(int rv) { if (BrowserThread::CurrentlyOn(BrowserThread::IO)) { // Filter out appcache info entries for non-websafe schemes. Extension state // and DevTools, for example, are not considered browsing data. - typedef std::map<GURL, appcache::AppCacheInfoVector> InfoByOrigin; + typedef std::map<GURL, content::AppCacheInfoVector> InfoByOrigin; InfoByOrigin& origin_map = info_collection_->infos_by_origin; for (InfoByOrigin::iterator origin = origin_map.begin(); origin != origin_map.end();) { @@ -92,7 +90,7 @@ CannedBrowsingDataAppCacheHelper::CannedBrowsingDataAppCacheHelper( Profile* profile) : BrowsingDataAppCacheHelper(profile), profile_(profile) { - info_collection_ = new appcache::AppCacheInfoCollection; + info_collection_ = new content::AppCacheInfoCollection; } CannedBrowsingDataAppCacheHelper* CannedBrowsingDataAppCacheHelper::Clone() { @@ -109,17 +107,17 @@ void CannedBrowsingDataAppCacheHelper::AddAppCache(const GURL& manifest_url) { return; // Ignore non-websafe schemes. OriginAppCacheInfoMap& origin_map = info_collection_->infos_by_origin; - appcache::AppCacheInfoVector& appcache_infos_ = + content::AppCacheInfoVector& appcache_infos_ = origin_map[manifest_url.GetOrigin()]; - for (appcache::AppCacheInfoVector::iterator + for (content::AppCacheInfoVector::iterator appcache = appcache_infos_.begin(); appcache != appcache_infos_.end(); ++appcache) { if (appcache->manifest_url == manifest_url) return; } - appcache::AppCacheInfo info; + content::AppCacheInfo info; info.manifest_url = manifest_url; appcache_infos_.push_back(info); } diff --git a/chrome/browser/browsing_data/browsing_data_appcache_helper.h b/chrome/browser/browsing_data/browsing_data_appcache_helper.h index 8a23ba2..6a7ea6a34 100644 --- a/chrome/browser/browsing_data/browsing_data_appcache_helper.h +++ b/chrome/browser/browsing_data/browsing_data_appcache_helper.h @@ -7,13 +7,13 @@ #include "base/callback.h" #include "base/memory/ref_counted.h" +#include "content/public/browser/appcache_service.h" #include "net/base/completion_callback.h" #include "url/gurl.h" -#include "webkit/browser/appcache/appcache_service.h" class Profile; -namespace appcache { +namespace content { class AppCacheService; } @@ -22,14 +22,14 @@ class AppCacheService; class BrowsingDataAppCacheHelper : public base::RefCountedThreadSafe<BrowsingDataAppCacheHelper> { public: - typedef std::map<GURL, appcache::AppCacheInfoVector> OriginAppCacheInfoMap; + typedef std::map<GURL, content::AppCacheInfoVector> OriginAppCacheInfoMap; explicit BrowsingDataAppCacheHelper(Profile* profile); virtual void StartFetching(const base::Closure& completion_callback); virtual void DeleteAppCacheGroup(const GURL& manifest_url); - appcache::AppCacheInfoCollection* info_collection() const { + content::AppCacheInfoCollection* info_collection() const { DCHECK(!is_fetching_); return info_collection_.get(); } @@ -39,13 +39,13 @@ class BrowsingDataAppCacheHelper virtual ~BrowsingDataAppCacheHelper(); base::Closure completion_callback_; - scoped_refptr<appcache::AppCacheInfoCollection> info_collection_; + scoped_refptr<content::AppCacheInfoCollection> info_collection_; private: void OnFetchComplete(int rv); bool is_fetching_; - appcache::AppCacheService* appcache_service_; + content::AppCacheService* appcache_service_; net::CancelableCompletionCallback appcache_info_callback_; DISALLOW_COPY_AND_ASSIGN(BrowsingDataAppCacheHelper); diff --git a/chrome/browser/browsing_data/browsing_data_appcache_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_appcache_helper_unittest.cc index 4589574..5040b1e 100644 --- a/chrome/browser/browsing_data/browsing_data_appcache_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_appcache_helper_unittest.cc @@ -56,7 +56,7 @@ TEST_F(CannedBrowsingDataAppCacheHelperTest, SetInfo) { base::Unretained(&callback))); ASSERT_TRUE(callback.have_result()); - std::map<GURL, appcache::AppCacheInfoVector>& collection = + std::map<GURL, content::AppCacheInfoVector>& collection = helper->info_collection()->infos_by_origin; ASSERT_EQ(2u, collection.size()); @@ -88,7 +88,7 @@ TEST_F(CannedBrowsingDataAppCacheHelperTest, Unique) { base::Unretained(&callback))); ASSERT_TRUE(callback.have_result()); - std::map<GURL, appcache::AppCacheInfoVector>& collection = + std::map<GURL, content::AppCacheInfoVector>& collection = helper->info_collection()->infos_by_origin; ASSERT_EQ(1u, collection.size()); diff --git a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc index a47a92f..c4de8ee 100644 --- a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc @@ -142,7 +142,7 @@ class TestStoragePartition : public StoragePartition { virtual quota::QuotaManager* GetQuotaManager() OVERRIDE { return NULL; } - virtual appcache::AppCacheService* GetAppCacheService() OVERRIDE { + virtual content::AppCacheService* GetAppCacheService() OVERRIDE { return NULL; } virtual fileapi::FileSystemContext* GetFileSystemContext() OVERRIDE { diff --git a/chrome/browser/browsing_data/cookies_tree_model.cc b/chrome/browser/browsing_data/cookies_tree_model.cc index 5663eb0..f1c15e2 100644 --- a/chrome/browser/browsing_data/cookies_tree_model.cc +++ b/chrome/browser/browsing_data/cookies_tree_model.cc @@ -214,7 +214,7 @@ CookieTreeNode::DetailedInfo& CookieTreeNode::DetailedInfo::InitSessionStorage( CookieTreeNode::DetailedInfo& CookieTreeNode::DetailedInfo::InitAppCache( const GURL& origin, - const appcache::AppCacheInfo* appcache_info) { + const content::AppCacheInfo* appcache_info) { Init(TYPE_APPCACHE); this->appcache_info = appcache_info; this->origin = origin; @@ -301,7 +301,7 @@ CookieTreeNode::DetailedInfo CookieTreeCookieNode::GetDetailedInfo() const { CookieTreeAppCacheNode::CookieTreeAppCacheNode( const GURL& origin_url, - std::list<appcache::AppCacheInfo>::iterator appcache_info) + std::list<content::AppCacheInfo>::iterator appcache_info) : CookieTreeNode(base::UTF8ToUTF16(appcache_info->manifest_url.spec())), origin_url_(origin_url), appcache_info_(appcache_info) { @@ -1046,7 +1046,7 @@ void CookiesTreeModel::PopulateAppCacheInfoWithFilter( LocalDataContainer* container, ScopedBatchUpdateNotifier* notifier, const base::string16& filter) { - using appcache::AppCacheInfo; + using content::AppCacheInfo; typedef std::map<GURL, std::list<AppCacheInfo> > InfoByOrigin; CookieTreeRootNode* root = static_cast<CookieTreeRootNode*>(GetRoot()); diff --git a/chrome/browser/browsing_data/cookies_tree_model.h b/chrome/browser/browsing_data/cookies_tree_model.h index 106a8fe..c0fae8f 100644 --- a/chrome/browser/browsing_data/cookies_tree_model.h +++ b/chrome/browser/browsing_data/cookies_tree_model.h @@ -111,7 +111,7 @@ class CookieTreeNode : public ui::TreeNode<CookieTreeNode> { const BrowsingDataLocalStorageHelper::LocalStorageInfo* session_storage_info); DetailedInfo& InitAppCache(const GURL& origin, - const appcache::AppCacheInfo* appcache_info); + const content::AppCacheInfo* appcache_info); DetailedInfo& InitIndexedDB( const content::IndexedDBInfo* indexed_db_info); DetailedInfo& InitFileSystem( @@ -129,7 +129,7 @@ class CookieTreeNode : public ui::TreeNode<CookieTreeNode> { const BrowsingDataLocalStorageHelper::LocalStorageInfo* local_storage_info; const BrowsingDataLocalStorageHelper::LocalStorageInfo* session_storage_info; - const appcache::AppCacheInfo* appcache_info; + const content::AppCacheInfo* appcache_info; const content::IndexedDBInfo* indexed_db_info; const BrowsingDataFileSystemHelper::FileSystemInfo* file_system_info; const BrowsingDataQuotaHelper::QuotaInfo* quota_info; @@ -288,7 +288,7 @@ class CookieTreeAppCacheNode : public CookieTreeNode { // CookieTreeAppCacheNode is valid. explicit CookieTreeAppCacheNode( const GURL& origin_url, - std::list<appcache::AppCacheInfo>::iterator appcache_info); + std::list<content::AppCacheInfo>::iterator appcache_info); virtual ~CookieTreeAppCacheNode(); virtual void DeleteStoredObjects() OVERRIDE; @@ -296,7 +296,7 @@ class CookieTreeAppCacheNode : public CookieTreeNode { private: GURL origin_url_; - std::list<appcache::AppCacheInfo>::iterator appcache_info_; + std::list<content::AppCacheInfo>::iterator appcache_info_; DISALLOW_COPY_AND_ASSIGN(CookieTreeAppCacheNode); }; diff --git a/chrome/browser/browsing_data/local_data_container.cc b/chrome/browser/browsing_data/local_data_container.cc index f051296..b7648de 100644 --- a/chrome/browser/browsing_data/local_data_container.cc +++ b/chrome/browser/browsing_data/local_data_container.cc @@ -108,9 +108,9 @@ void LocalDataContainer::Init(CookiesTreeModel* model) { } void LocalDataContainer::OnAppCacheModelInfoLoaded() { - using appcache::AppCacheInfo; - using appcache::AppCacheInfoCollection; - using appcache::AppCacheInfoVector; + using content::AppCacheInfo; + using content::AppCacheInfoCollection; + using content::AppCacheInfoVector; typedef std::map<GURL, AppCacheInfoVector> InfoByOrigin; scoped_refptr<AppCacheInfoCollection> appcache_info = diff --git a/chrome/browser/browsing_data/local_data_container.h b/chrome/browser/browsing_data/local_data_container.h index b50dfb2..1cf4265 100644 --- a/chrome/browser/browsing_data/local_data_container.h +++ b/chrome/browser/browsing_data/local_data_container.h @@ -46,7 +46,7 @@ typedef std::list<BrowsingDataFileSystemHelper::FileSystemInfo> FileSystemInfoList; typedef std::list<BrowsingDataQuotaHelper::QuotaInfo> QuotaInfoList; typedef net::ServerBoundCertStore::ServerBoundCertList ServerBoundCertList; -typedef std::map<GURL, std::list<appcache::AppCacheInfo> > AppCacheInfoMap; +typedef std::map<GURL, std::list<content::AppCacheInfo> > AppCacheInfoMap; typedef std::vector<std::string> FlashLSODomainList; } // namespace diff --git a/chrome/browser/content_settings/local_shared_objects_container.cc b/chrome/browser/content_settings/local_shared_objects_container.cc index 086ffdc..84b66f2 100644 --- a/chrome/browser/content_settings/local_shared_objects_container.cc +++ b/chrome/browser/content_settings/local_shared_objects_container.cc @@ -168,8 +168,8 @@ size_t LocalSharedObjectsContainer::GetObjectCountForDomain( for (OriginAppCacheInfoMap::const_iterator it = map.begin(); it != map.end(); ++it) { - const appcache::AppCacheInfoVector& info_vector = it->second; - for (appcache::AppCacheInfoVector::const_iterator info = + const content::AppCacheInfoVector& info_vector = it->second; + for (content::AppCacheInfoVector::const_iterator info = info_vector.begin(); info != info_vector.end(); ++info) { diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc index ae63d93..d064a5c 100644 --- a/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc +++ b/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc @@ -233,7 +233,7 @@ class TestResourceDispatcherHostDelegate virtual void RequestBeginning( net::URLRequest* request, content::ResourceContext* resource_context, - appcache::AppCacheService* appcache_service, + content::AppCacheService* appcache_service, ResourceType::Type resource_type, int child_id, int route_id, diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc index a46608e..1854225 100644 --- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc +++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc @@ -285,7 +285,7 @@ bool ChromeResourceDispatcherHostDelegate::ShouldBeginRequest( void ChromeResourceDispatcherHostDelegate::RequestBeginning( net::URLRequest* request, content::ResourceContext* resource_context, - appcache::AppCacheService* appcache_service, + content::AppCacheService* appcache_service, ResourceType::Type resource_type, int child_id, int route_id, diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.h b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.h index bb1773f..65bd1f7 100644 --- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.h +++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.h @@ -48,7 +48,7 @@ class ChromeResourceDispatcherHostDelegate virtual void RequestBeginning( net::URLRequest* request, content::ResourceContext* resource_context, - appcache::AppCacheService* appcache_service, + content::AppCacheService* appcache_service, ResourceType::Type resource_type, int child_id, int route_id, diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate_browsertest.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate_browsertest.cc index 74bb514..b865298 100644 --- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate_browsertest.cc +++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate_browsertest.cc @@ -60,7 +60,7 @@ class TestDispatcherHostDelegate : public ChromeResourceDispatcherHostDelegate { virtual void RequestBeginning( net::URLRequest* request, content::ResourceContext* resource_context, - appcache::AppCacheService* appcache_service, + content::AppCacheService* appcache_service, ResourceType::Type resource_type, int child_id, int route_id, diff --git a/chrome/browser/renderer_host/offline_resource_throttle.cc b/chrome/browser/renderer_host/offline_resource_throttle.cc index 272785c..41b7a80 100644 --- a/chrome/browser/renderer_host/offline_resource_throttle.cc +++ b/chrome/browser/renderer_host/offline_resource_throttle.cc @@ -13,6 +13,7 @@ #include "base/strings/string_util.h" #include "chrome/browser/chromeos/offline/offline_load_page.h" #include "chrome/browser/net/chrome_url_request_context.h" +#include "content/public/browser/appcache_service.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/resource_controller.h" @@ -24,7 +25,6 @@ #include "net/url_request/url_request.h" #include "net/url_request/url_request_context.h" #include "url/url_constants.h" -#include "webkit/browser/appcache/appcache_service.h" using content::BrowserThread; using content::RenderViewHost; @@ -60,7 +60,7 @@ void ShowOfflinePage( OfflineResourceThrottle::OfflineResourceThrottle( net::URLRequest* request, - appcache::AppCacheService* appcache_service) + content::AppCacheService* appcache_service) : request_(request), appcache_service_(appcache_service) { DCHECK(appcache_service); diff --git a/chrome/browser/renderer_host/offline_resource_throttle.h b/chrome/browser/renderer_host/offline_resource_throttle.h index a78fadc..bc8cfd6e 100644 --- a/chrome/browser/renderer_host/offline_resource_throttle.h +++ b/chrome/browser/renderer_host/offline_resource_throttle.h @@ -13,7 +13,7 @@ #include "content/public/browser/resource_throttle.h" #include "net/base/completion_callback.h" -namespace appcache { +namespace content { class AppCacheService; } @@ -26,7 +26,7 @@ class OfflineResourceThrottle public base::SupportsWeakPtr<OfflineResourceThrottle> { public: OfflineResourceThrottle(net::URLRequest* request, - appcache::AppCacheService* appcache_service); + content::AppCacheService* appcache_service); virtual ~OfflineResourceThrottle(); // content::ResourceThrottle implementation: @@ -49,7 +49,7 @@ class OfflineResourceThrottle net::URLRequest* request_; // Safe to keep a pointer around since AppCacheService outlives all requests. - appcache::AppCacheService* appcache_service_; + content::AppCacheService* appcache_service_; net::CancelableCompletionCallback appcache_completion_callback_; DISALLOW_COPY_AND_ASSIGN(OfflineResourceThrottle); diff --git a/chrome/browser/ui/cocoa/content_settings/cookie_details.h b/chrome/browser/ui/cocoa/content_settings/cookie_details.h index e76d0d1..85ad46d 100644 --- a/chrome/browser/ui/cocoa/content_settings/cookie_details.h +++ b/chrome/browser/ui/cocoa/content_settings/cookie_details.h @@ -8,7 +8,7 @@ #include "chrome/browser/browsing_data/browsing_data_database_helper.h" #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" -#include "webkit/browser/appcache/appcache_service.h" +#include "content/public/browser/appcache_service.h" class CookieTreeNode; @@ -184,7 +184,7 @@ enum CocoaCookieDetailsType { // -initWithAppCacheInfo: creates a cookie details with the manifest URL plus // all of this additional information that is available after an appcache is // actually created, including its creation date, size and last accessed time. -- (id)initWithAppCacheInfo:(const appcache::AppCacheInfo*)appcacheInfo; +- (id)initWithAppCacheInfo:(const content::AppCacheInfo*)appcacheInfo; // Used for local storage details in the cookie prompt dialog. - (id)initWithLocalStorage:(const std::string&)domain diff --git a/chrome/browser/ui/cocoa/content_settings/cookie_details.mm b/chrome/browser/ui/cocoa/content_settings/cookie_details.mm index 02f6f57..3ae66b3 100644 --- a/chrome/browser/ui/cocoa/content_settings/cookie_details.mm +++ b/chrome/browser/ui/cocoa/content_settings/cookie_details.mm @@ -11,7 +11,7 @@ #include "net/cookies/canonical_cookie.h" #include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/text/bytes_formatting.h" -#include "webkit/browser/appcache/appcache_service.h" +#include "content/public/browser/appcache_service.h" #pragma mark Cocoa Cookie Details @@ -182,7 +182,7 @@ return self; } -- (id)initWithAppCacheInfo:(const appcache::AppCacheInfo*)appcacheInfo { +- (id)initWithAppCacheInfo:(const content::AppCacheInfo*)appcacheInfo { if ((self = [super init])) { type_ = kCocoaCookieDetailsTypeTreeAppCache; canEditExpiration_ = NO; diff --git a/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm b/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm index 3c9dc36..d227f19 100644 --- a/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm +++ b/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm @@ -107,7 +107,7 @@ TEST_F(CookiesDetailsTest, CreateForTreeAppCache) { base::scoped_nsobject<CocoaCookieDetails> details; GURL url("http://chromium.org/stuff.manifest"); - appcache::AppCacheInfo info; + content::AppCacheInfo info; info.creation_time = base::Time::Now(); info.last_update_time = base::Time::Now(); info.last_access_time = base::Time::Now(); diff --git a/chrome/browser/ui/webui/cookies_tree_model_util.cc b/chrome/browser/ui/webui/cookies_tree_model_util.cc index 3ee3cc9..43c27eb 100644 --- a/chrome/browser/ui/webui/cookies_tree_model_util.cc +++ b/chrome/browser/ui/webui/cookies_tree_model_util.cc @@ -168,7 +168,7 @@ bool CookiesTreeModelUtil::GetCookieTreeNodeDictionary( dict->SetString(kKeyType, "app_cache"); dict->SetString(kKeyIcon, "chrome://theme/IDR_COOKIE_STORAGE_ICON"); - const appcache::AppCacheInfo& appcache_info = + const content::AppCacheInfo& appcache_info = *node.GetDetailedInfo().appcache_info; dict->SetString(kKeyManifest, appcache_info.manifest_url.spec()); diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 7ec025c..c3e3226 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn @@ -6,6 +6,12 @@ import("//build/config/features.gni") import("//build/config/ui.gni") import("//content/browser/browser.gni") +config("storage_config") { + if (is_android) { + defines = [ "APPCACHE_USE_SIMPLE_CACHE" ] + } +} + source_set("browser") { # Only targets in the content tree can depend directly on this target. visibility = [ "//content/*" ] diff --git a/webkit/browser/appcache/DEPS b/content/browser/appcache/DEPS index 8608d5f..8608d5f 100644 --- a/webkit/browser/appcache/DEPS +++ b/content/browser/appcache/DEPS diff --git a/webkit/browser/appcache/appcache.cc b/content/browser/appcache/appcache.cc index 9179a40..7b23f64 100644 --- a/webkit/browser/appcache/appcache.cc +++ b/content/browser/appcache/appcache.cc @@ -2,19 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache.h" #include <algorithm> #include "base/logging.h" #include "base/stl_util.h" -#include "webkit/browser/appcache/appcache_executable_handler.h" -#include "webkit/browser/appcache/appcache_group.h" -#include "webkit/browser/appcache/appcache_host.h" -#include "webkit/browser/appcache/appcache_storage.h" -#include "webkit/common/appcache/appcache_interfaces.h" +#include "content/browser/appcache/appcache_executable_handler.h" +#include "content/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_host.h" +#include "content/browser/appcache/appcache_storage.h" +#include "content/common/appcache_interfaces.h" -namespace appcache { +namespace content { AppCache::AppCache(AppCacheStorage* storage, int64 cache_id) : cache_id_(cache_id), @@ -115,7 +115,7 @@ AppCacheExecutableHandler* AppCache::GetOrCreateExecutableHandler( return handler; } -GURL AppCache::GetNamespaceEntryUrl(const NamespaceVector& namespaces, +GURL AppCache::GetNamespaceEntryUrl(const AppCacheNamespaceVector& namespaces, const GURL& namespace_url) const { size_t count = namespaces.size(); for (size_t i = 0; i < count; ++i) { @@ -128,7 +128,7 @@ GURL AppCache::GetNamespaceEntryUrl(const NamespaceVector& namespaces, namespace { bool SortNamespacesByLength( - const Namespace& lhs, const Namespace& rhs) { + const AppCacheNamespace& lhs, const AppCacheNamespace& rhs) { return lhs.namespace_url.spec().length() > rhs.namespace_url.spec().length(); } } @@ -181,7 +181,7 @@ void AppCache::InitializeWithDatabaseRecords( for (size_t i = 0; i < whitelists.size(); ++i) { const AppCacheDatabase::OnlineWhiteListRecord& record = whitelists.at(i); online_whitelist_namespaces_.push_back( - Namespace(APPCACHE_NETWORK_NAMESPACE, + AppCacheNamespace(APPCACHE_NETWORK_NAMESPACE, record.namespace_url, GURL(), record.is_pattern)); @@ -268,7 +268,8 @@ bool AppCache::FindResponseForRequest(const GURL& url, if ((*found_network_namespace = IsInNetworkNamespace(url_no_ref))) return true; - const Namespace* intercept_namespace = FindInterceptNamespace(url_no_ref); + const AppCacheNamespace* intercept_namespace = + FindInterceptNamespace(url_no_ref); if (intercept_namespace) { entry = GetEntry(intercept_namespace->target_url); DCHECK(entry); @@ -277,7 +278,8 @@ bool AppCache::FindResponseForRequest(const GURL& url, return true; } - const Namespace* fallback_namespace = FindFallbackNamespace(url_no_ref); + const AppCacheNamespace* fallback_namespace = + FindFallbackNamespace(url_no_ref); if (fallback_namespace) { entry = GetEntry(fallback_namespace->target_url); DCHECK(entry); @@ -310,8 +312,8 @@ void AppCache::ToResourceInfoVector(AppCacheResourceInfoVector* infos) const { } // static -const Namespace* AppCache::FindNamespace( - const NamespaceVector& namespaces, +const AppCacheNamespace* AppCache::FindNamespace( + const AppCacheNamespaceVector& namespaces, const GURL& url) { size_t count = namespaces.size(); for (size_t i = 0; i < count; ++i) { @@ -321,4 +323,4 @@ const Namespace* AppCache::FindNamespace( return NULL; } -} // namespace appcache +} // namespace content diff --git a/webkit/browser/appcache/appcache.h b/content/browser/appcache/appcache.h index 54713b7..d449139 100644 --- a/webkit/browser/appcache/appcache.h +++ b/content/browser/appcache/appcache.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_H_ #include <map> #include <set> @@ -12,11 +12,11 @@ #include "base/gtest_prod_util.h" #include "base/memory/ref_counted.h" #include "base/time/time.h" +#include "content/browser/appcache/appcache_database.h" +#include "content/browser/appcache/appcache_entry.h" +#include "content/browser/appcache/manifest_parser.h" +#include "content/common/content_export.h" #include "url/gurl.h" -#include "webkit/browser/appcache/appcache_database.h" -#include "webkit/browser/appcache/appcache_entry.h" -#include "webkit/browser/appcache/manifest_parser.h" -#include "webkit/browser/webkit_storage_browser_export.h" namespace net { class IOBuffer; @@ -30,7 +30,7 @@ class AppCacheStorageImplTest; class AppCacheUpdateJobTest; } -namespace appcache { +namespace content { class AppCacheExecutableHandler; class AppCacheGroup; @@ -40,7 +40,7 @@ class AppCacheStorage; // Set of cached resources for an application. A cache exists as long as a // host is associated with it, the cache is in an appcache group or the // cache is being created during an appcache upate. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCache +class CONTENT_EXPORT AppCache : public base::RefCounted<AppCache> { public: typedef std::map<GURL, AppCacheEntry> EntryMap; @@ -143,8 +143,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCache // Populates the 'infos' vector with an element per entry in the appcache. void ToResourceInfoVector(AppCacheResourceInfoVector* infos) const; - static const Namespace* FindNamespace( - const NamespaceVector& namespaces, + static const AppCacheNamespace* FindNamespace( + const AppCacheNamespaceVector& namespaces, const GURL& url); private: @@ -161,17 +161,17 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCache void set_owning_group(AppCacheGroup* group) { owning_group_ = group; } // FindResponseForRequest helpers - const Namespace* FindInterceptNamespace(const GURL& url) { + const AppCacheNamespace* FindInterceptNamespace(const GURL& url) { return FindNamespace(intercept_namespaces_, url); } - const Namespace* FindFallbackNamespace(const GURL& url) { + const AppCacheNamespace* FindFallbackNamespace(const GURL& url) { return FindNamespace(fallback_namespaces_, url); } bool IsInNetworkNamespace(const GURL& url) { return FindNamespace(online_whitelist_namespaces_, url) != NULL; } - GURL GetNamespaceEntryUrl(const NamespaceVector& namespaces, + GURL GetNamespaceEntryUrl(const AppCacheNamespaceVector& namespaces, const GURL& namespace_url) const; // Use AppCacheHost::Associate*Cache() to manipulate host association. @@ -186,9 +186,9 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCache EntryMap entries_; // contains entries of all types - NamespaceVector intercept_namespaces_; - NamespaceVector fallback_namespaces_; - NamespaceVector online_whitelist_namespaces_; + AppCacheNamespaceVector intercept_namespaces_; + AppCacheNamespaceVector fallback_namespaces_; + AppCacheNamespaceVector online_whitelist_namespaces_; bool online_whitelist_all_; bool is_complete_; @@ -209,6 +209,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCache DISALLOW_COPY_AND_ASSIGN(AppCache); }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_H_ diff --git a/webkit/browser/appcache/appcache_backend_impl.cc b/content/browser/appcache/appcache_backend_impl.cc index 376724e..099c54e 100644 --- a/webkit/browser/appcache/appcache_backend_impl.cc +++ b/content/browser/appcache/appcache_backend_impl.cc @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/browser/appcache/appcache_backend_impl.h" +#include "content/browser/appcache/appcache_backend_impl.h" #include "base/stl_util.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_group.h" -#include "webkit/browser/appcache/appcache_service_impl.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_service_impl.h" -namespace appcache { +namespace content { AppCacheBackendImpl::AppCacheBackendImpl() : service_(NULL), @@ -139,7 +139,7 @@ bool AppCacheBackendImpl::SwapCacheWithCallback( } void AppCacheBackendImpl::GetResourceList( - int host_id, std::vector<appcache::AppCacheResourceInfo>* resource_infos) { + int host_id, std::vector<AppCacheResourceInfo>* resource_infos) { AppCacheHost* host = GetHost(host_id); if (!host) return; @@ -179,4 +179,4 @@ void AppCacheBackendImpl::TransferHostIn( found->second = host.release(); } -} // namespace appcache +} // namespace content diff --git a/webkit/browser/appcache/appcache_backend_impl.h b/content/browser/appcache/appcache_backend_impl.h index cc85a76..bd6f440 100644 --- a/webkit/browser/appcache/appcache_backend_impl.h +++ b/content/browser/appcache/appcache_backend_impl.h @@ -2,18 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ #include "base/containers/hash_tables.h" -#include "webkit/browser/appcache/appcache_host.h" -#include "webkit/browser/webkit_storage_browser_export.h" +#include "content/browser/appcache/appcache_host.h" +#include "content/common/content_export.h" -namespace appcache { +namespace content { class AppCacheServiceImpl; -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheBackendImpl { +class CONTENT_EXPORT AppCacheBackendImpl { public: AppCacheBackendImpl(); ~AppCacheBackendImpl(); @@ -72,4 +72,4 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheBackendImpl { } // namespace -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_BACKEND_IMPL_H_ diff --git a/webkit/browser/appcache/appcache_database.cc b/content/browser/appcache/appcache_database.cc index a5349d8..546c1dc 100644 --- a/webkit/browser/appcache/appcache_database.cc +++ b/content/browser/appcache/appcache_database.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/appcache/appcache_database.h" +#include "content/browser/appcache/appcache_database.h" #include "base/auto_reset.h" #include "base/bind.h" @@ -10,15 +10,15 @@ #include "base/file_util.h" #include "base/logging.h" #include "base/strings/utf_string_conversions.h" +#include "content/browser/appcache/appcache_entry.h" +#include "content/browser/appcache/appcache_histograms.h" #include "sql/connection.h" #include "sql/error_delegate_util.h" #include "sql/meta_table.h" #include "sql/statement.h" #include "sql/transaction.h" -#include "webkit/browser/appcache/appcache_entry.h" -#include "webkit/browser/appcache/appcache_histograms.h" -namespace appcache { +namespace content { // Schema ------------------------------------------------------------------- namespace { @@ -1223,4 +1223,4 @@ void AppCacheDatabase::OnDatabaseError(int err, sql::Statement* stmt) { // TODO: Maybe use non-catostrophic errors to trigger a full integrity check? } -} // namespace appcache +} // namespace content diff --git a/webkit/browser/appcache/appcache_database.h b/content/browser/appcache/appcache_database.h index 93bc1bf..2fe5e12 100644 --- a/webkit/browser/appcache/appcache_database.h +++ b/content/browser/appcache/appcache_database.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ #include <map> #include <set> @@ -14,9 +14,9 @@ #include "base/gtest_prod_util.h" #include "base/memory/scoped_ptr.h" #include "base/time/time.h" +#include "content/common/appcache_interfaces.h" +#include "content/common/content_export.h" #include "url/gurl.h" -#include "webkit/browser/webkit_storage_browser_export.h" -#include "webkit/common/appcache/appcache_interfaces.h" namespace sql { class Connection; @@ -44,11 +44,11 @@ class AppCacheDatabaseTest; class AppCacheStorageImplTest; } -namespace appcache { +namespace content { -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheDatabase { +class CONTENT_EXPORT AppCacheDatabase { public: - struct WEBKIT_STORAGE_BROWSER_EXPORT GroupRecord { + struct CONTENT_EXPORT GroupRecord { GroupRecord(); ~GroupRecord(); @@ -59,7 +59,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheDatabase { base::Time last_access_time; }; - struct WEBKIT_STORAGE_BROWSER_EXPORT CacheRecord { + struct CONTENT_EXPORT CacheRecord { CacheRecord() : cache_id(0), group_id(0), online_wildcard(false), cache_size(0) {} @@ -80,13 +80,13 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheDatabase { int64 response_size; }; - struct WEBKIT_STORAGE_BROWSER_EXPORT NamespaceRecord { + struct CONTENT_EXPORT NamespaceRecord { NamespaceRecord(); ~NamespaceRecord(); int64 cache_id; GURL origin; - Namespace namespace_; + AppCacheNamespace namespace_; }; typedef std::vector<NamespaceRecord> NamespaceRecordVector; @@ -249,6 +249,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheDatabase { DISALLOW_COPY_AND_ASSIGN(AppCacheDatabase); }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_DATABASE_H_ diff --git a/content/browser/appcache/appcache_database_unittest.cc b/content/browser/appcache/appcache_database_unittest.cc index 92fa6a5..44a6c6a 100644 --- a/content/browser/appcache/appcache_database_unittest.cc +++ b/content/browser/appcache/appcache_database_unittest.cc @@ -6,6 +6,8 @@ #include "base/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/strings/stringprintf.h" +#include "content/browser/appcache/appcache_database.h" +#include "content/browser/appcache/appcache_entry.h" #include "sql/connection.h" #include "sql/meta_table.h" #include "sql/statement.h" @@ -14,14 +16,6 @@ #include "sql/transaction.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/sqlite/sqlite3.h" -#include "webkit/browser/appcache/appcache_database.h" -#include "webkit/browser/appcache/appcache_entry.h" - -using appcache::AppCacheDatabase; -using appcache::AppCacheEntry; -using appcache::APPCACHE_FALLBACK_NAMESPACE; -using appcache::APPCACHE_INTERCEPT_NAMESPACE; -using appcache::APPCACHE_NETWORK_NAMESPACE; namespace { diff --git a/webkit/browser/appcache/appcache_disk_cache.cc b/content/browser/appcache/appcache_disk_cache.cc index 9c16f98..50995c7 100644 --- a/webkit/browser/appcache/appcache_disk_cache.cc +++ b/content/browser/appcache/appcache_disk_cache.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/appcache/appcache_disk_cache.h" +#include "content/browser/appcache/appcache_disk_cache.h" #include "base/bind.h" #include "base/bind_helpers.h" @@ -13,7 +13,7 @@ #include "net/base/cache_type.h" #include "net/base/net_errors.h" -namespace appcache { +namespace content { // A callback shim that provides storage for the 'backend_ptr' value // and will delete a resulting ptr if completion occurs after its @@ -348,4 +348,4 @@ void AppCacheDiskCache::OnCreateBackendComplete(int rv) { pending_calls_.clear(); } -} // namespace appcache +} // namespace content diff --git a/webkit/browser/appcache/appcache_disk_cache.h b/content/browser/appcache/appcache_disk_cache.h index d9f27d0f..3d51889 100644 --- a/webkit/browser/appcache/appcache_disk_cache.h +++ b/content/browser/appcache/appcache_disk_cache.h @@ -2,22 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ #include <set> #include <vector> #include "base/memory/scoped_ptr.h" +#include "content/browser/appcache/appcache_response.h" +#include "content/common/content_export.h" #include "net/disk_cache/disk_cache.h" -#include "webkit/browser/appcache/appcache_response.h" -#include "webkit/browser/webkit_storage_browser_export.h" -namespace appcache { +namespace content { // An implementation of AppCacheDiskCacheInterface that // uses net::DiskCache as the backing store. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheDiskCache +class CONTENT_EXPORT AppCacheDiskCache : public AppCacheDiskCacheInterface { public: AppCacheDiskCache(); @@ -99,6 +99,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheDiskCache scoped_ptr<disk_cache::Backend> disk_cache_; }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_DISK_CACHE_H_ diff --git a/content/browser/appcache/appcache_disk_cache_unittest.cc b/content/browser/appcache/appcache_disk_cache_unittest.cc index 5e1e083..b7e1407 100644 --- a/content/browser/appcache/appcache_disk_cache_unittest.cc +++ b/content/browser/appcache/appcache_disk_cache_unittest.cc @@ -7,12 +7,10 @@ #include "base/files/scoped_temp_dir.h" #include "base/message_loop/message_loop_proxy.h" #include "base/run_loop.h" +#include "content/browser/appcache/appcache_disk_cache.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/appcache/appcache_disk_cache.h" - -using appcache::AppCacheDiskCache; namespace content { diff --git a/content/browser/appcache/appcache_dispatcher_host.cc b/content/browser/appcache/appcache_dispatcher_host.cc index 64e46b1..eac1eff 100644 --- a/content/browser/appcache/appcache_dispatcher_host.cc +++ b/content/browser/appcache/appcache_dispatcher_host.cc @@ -103,7 +103,7 @@ void AppCacheDispatcherHost::OnSelectCache( BadMessageReceived(); } } else { - frontend_proxy_.OnCacheSelected(host_id, appcache::AppCacheInfo()); + frontend_proxy_.OnCacheSelected(host_id, AppCacheInfo()); } } @@ -115,7 +115,7 @@ void AppCacheDispatcherHost::OnSelectCacheForWorker( BadMessageReceived(); } } else { - frontend_proxy_.OnCacheSelected(host_id, appcache::AppCacheInfo()); + frontend_proxy_.OnCacheSelected(host_id, AppCacheInfo()); } } @@ -125,7 +125,7 @@ void AppCacheDispatcherHost::OnSelectCacheForSharedWorker( if (!backend_impl_.SelectCacheForSharedWorker(host_id, appcache_id)) BadMessageReceived(); } else { - frontend_proxy_.OnCacheSelected(host_id, appcache::AppCacheInfo()); + frontend_proxy_.OnCacheSelected(host_id, AppCacheInfo()); } } @@ -141,7 +141,7 @@ void AppCacheDispatcherHost::OnMarkAsForeignEntry( } void AppCacheDispatcherHost::OnGetResourceList( - int host_id, std::vector<appcache::AppCacheResourceInfo>* params) { + int host_id, std::vector<AppCacheResourceInfo>* params) { if (appcache_service_.get()) backend_impl_.GetResourceList(host_id, params); } @@ -162,7 +162,7 @@ void AppCacheDispatcherHost::OnGetStatus(int host_id, IPC::Message* reply_msg) { return; } - GetStatusCallback(appcache::APPCACHE_STATUS_UNCACHED, reply_msg); + GetStatusCallback(APPCACHE_STATUS_UNCACHED, reply_msg); } void AppCacheDispatcherHost::OnStartUpdate(int host_id, @@ -205,7 +205,7 @@ void AppCacheDispatcherHost::OnSwapCache(int host_id, IPC::Message* reply_msg) { } void AppCacheDispatcherHost::GetStatusCallback( - appcache::AppCacheStatus status, void* param) { + AppCacheStatus status, void* param) { IPC::Message* reply_msg = reinterpret_cast<IPC::Message*>(param); DCHECK_EQ(pending_reply_msg_.get(), reply_msg); AppCacheHostMsg_GetStatus::WriteReplyParams(reply_msg, status); diff --git a/content/browser/appcache/appcache_dispatcher_host.h b/content/browser/appcache/appcache_dispatcher_host.h index 8bad796..3e32898 100644 --- a/content/browser/appcache/appcache_dispatcher_host.h +++ b/content/browser/appcache/appcache_dispatcher_host.h @@ -10,9 +10,9 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/process/process.h" +#include "content/browser/appcache/appcache_backend_impl.h" #include "content/browser/appcache/appcache_frontend_proxy.h" #include "content/public/browser/browser_message_filter.h" -#include "webkit/browser/appcache/appcache_backend_impl.h" namespace content { class ChromeAppCacheService; @@ -54,19 +54,19 @@ class AppCacheDispatcherHost : public BrowserMessageFilter { void OnSwapCache(int host_id, IPC::Message* reply_msg); void OnGetResourceList( int host_id, - std::vector<appcache::AppCacheResourceInfo>* resource_infos); - void GetStatusCallback(appcache::AppCacheStatus status, void* param); + std::vector<AppCacheResourceInfo>* resource_infos); + void GetStatusCallback(AppCacheStatus status, void* param); void StartUpdateCallback(bool result, void* param); void SwapCacheCallback(bool result, void* param); scoped_refptr<ChromeAppCacheService> appcache_service_; AppCacheFrontendProxy frontend_proxy_; - appcache::AppCacheBackendImpl backend_impl_; + AppCacheBackendImpl backend_impl_; - appcache::GetStatusCallback get_status_callback_; - appcache::StartUpdateCallback start_update_callback_; - appcache::SwapCacheCallback swap_cache_callback_; + content::GetStatusCallback get_status_callback_; + content::StartUpdateCallback start_update_callback_; + content::SwapCacheCallback swap_cache_callback_; scoped_ptr<IPC::Message> pending_reply_msg_; // The corresponding ChildProcessHost object's id(). diff --git a/webkit/browser/appcache/appcache_entry.h b/content/browser/appcache/appcache_entry.h index fabaa62..5c4fffd 100644 --- a/webkit/browser/appcache/appcache_entry.h +++ b/content/browser/appcache/appcache_entry.h @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_ENTRY_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_ENTRY_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_ENTRY_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_ENTRY_H_ -#include "webkit/common/appcache/appcache_interfaces.h" +#include "content/common/appcache_interfaces.h" -namespace appcache { +namespace content { // A cached entry is identified by a URL and is classified into one // (or more) categories. URL is not stored here as this class is stored @@ -62,6 +62,6 @@ class AppCacheEntry { int64 response_size_; }; -} // namespace appcache +} // namespace content #endif // WEBKIT_APPCACHE_APPCACHE_RESOURCE_H_ diff --git a/webkit/browser/appcache/appcache_executable_handler.h b/content/browser/appcache/appcache_executable_handler.h index 43ee0a3..445a6cd 100644 --- a/webkit/browser/appcache/appcache_executable_handler.h +++ b/content/browser/appcache/appcache_executable_handler.h @@ -2,23 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_EXECUTABLE_HANDLER_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_EXECUTABLE_HANDLER_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_EXECUTABLE_HANDLER_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_EXECUTABLE_HANDLER_H_ #include "base/callback.h" #include "base/memory/scoped_ptr.h" +#include "content/common/content_export.h" #include "url/gurl.h" -#include "webkit/browser/webkit_storage_browser_export.h" namespace net { class IOBuffer; class URLRequest; } -namespace appcache { +namespace content { // An interface that must be provided by the embedder to support this feature. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheExecutableHandler { +class CONTENT_EXPORT AppCacheExecutableHandler { public: // A handler can respond in one of 4 ways, if each of the GURL fields // in 'Response' are empty and use_network is false, an error response is @@ -40,7 +40,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheExecutableHandler { }; // A factory to produce instances. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheExecutableHandlerFactory { +class CONTENT_EXPORT AppCacheExecutableHandlerFactory { public: virtual scoped_ptr<AppCacheExecutableHandler> CreateHandler( const GURL& handler_url, net::IOBuffer* handler_source) = 0; @@ -49,6 +49,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheExecutableHandlerFactory { virtual ~AppCacheExecutableHandlerFactory() {} }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_EXECUTABLE_HANDLER_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_EXECUTABLE_HANDLER_H_ diff --git a/content/browser/appcache/appcache_frontend_proxy.cc b/content/browser/appcache/appcache_frontend_proxy.cc index ea693e9d..4242304 100644 --- a/content/browser/appcache/appcache_frontend_proxy.cc +++ b/content/browser/appcache/appcache_frontend_proxy.cc @@ -13,18 +13,18 @@ AppCacheFrontendProxy::AppCacheFrontendProxy(IPC::Sender* sender) } void AppCacheFrontendProxy::OnCacheSelected( - int host_id, const appcache::AppCacheInfo& info) { + int host_id, const AppCacheInfo& info) { sender_->Send(new AppCacheMsg_CacheSelected(host_id, info)); } void AppCacheFrontendProxy::OnStatusChanged(const std::vector<int>& host_ids, - appcache::AppCacheStatus status) { + AppCacheStatus status) { sender_->Send(new AppCacheMsg_StatusChanged(host_ids, status)); } void AppCacheFrontendProxy::OnEventRaised(const std::vector<int>& host_ids, - appcache::AppCacheEventID event_id) { - DCHECK_NE(appcache::APPCACHE_PROGRESS_EVENT, + AppCacheEventID event_id) { + DCHECK_NE(APPCACHE_PROGRESS_EVENT, event_id); // See OnProgressEventRaised. sender_->Send(new AppCacheMsg_EventRaised(host_ids, event_id)); } @@ -38,12 +38,12 @@ void AppCacheFrontendProxy::OnProgressEventRaised( void AppCacheFrontendProxy::OnErrorEventRaised( const std::vector<int>& host_ids, - const appcache::AppCacheErrorDetails& details) { + const AppCacheErrorDetails& details) { sender_->Send(new AppCacheMsg_ErrorEventRaised(host_ids, details)); } void AppCacheFrontendProxy::OnLogMessage(int host_id, - appcache::AppCacheLogLevel log_level, + AppCacheLogLevel log_level, const std::string& message) { sender_->Send(new AppCacheMsg_LogMessage(host_id, log_level, message)); } diff --git a/content/browser/appcache/appcache_frontend_proxy.h b/content/browser/appcache/appcache_frontend_proxy.h index 904c8ae..fdd05cd 100644 --- a/content/browser/appcache/appcache_frontend_proxy.h +++ b/content/browser/appcache/appcache_frontend_proxy.h @@ -8,30 +8,30 @@ #include <string> #include <vector> +#include "content/common/appcache_interfaces.h" #include "ipc/ipc_sender.h" -#include "webkit/common/appcache/appcache_interfaces.h" namespace content { // Sends appcache related messages to a child process. -class AppCacheFrontendProxy : public appcache::AppCacheFrontend { +class AppCacheFrontendProxy : public AppCacheFrontend { public: explicit AppCacheFrontendProxy(IPC::Sender* sender); // AppCacheFrontend methods virtual void OnCacheSelected(int host_id, - const appcache::AppCacheInfo& info) OVERRIDE; + const AppCacheInfo& info) OVERRIDE; virtual void OnStatusChanged(const std::vector<int>& host_ids, - appcache::AppCacheStatus status) OVERRIDE; + AppCacheStatus status) OVERRIDE; virtual void OnEventRaised(const std::vector<int>& host_ids, - appcache::AppCacheEventID event_id) OVERRIDE; + AppCacheEventID event_id) OVERRIDE; virtual void OnProgressEventRaised(const std::vector<int>& host_ids, const GURL& url, int num_total, int num_complete) OVERRIDE; virtual void OnErrorEventRaised(const std::vector<int>& host_ids, - const appcache::AppCacheErrorDetails& details) + const AppCacheErrorDetails& details) OVERRIDE; - virtual void OnLogMessage(int host_id, appcache::AppCacheLogLevel log_level, + virtual void OnLogMessage(int host_id, AppCacheLogLevel log_level, const std::string& message) OVERRIDE; virtual void OnContentBlocked(int host_id, const GURL& manifest_url) OVERRIDE; diff --git a/webkit/browser/appcache/appcache_group.cc b/content/browser/appcache/appcache_group.cc index f5ad43d..60a1024 100644 --- a/webkit/browser/appcache/appcache_group.cc +++ b/content/browser/appcache/appcache_group.cc @@ -2,20 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_group.h" #include <algorithm> #include "base/bind.h" #include "base/logging.h" #include "base/message_loop/message_loop.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_host.h" -#include "webkit/browser/appcache/appcache_service_impl.h" -#include "webkit/browser/appcache/appcache_storage.h" -#include "webkit/browser/appcache/appcache_update_job.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_host.h" +#include "content/browser/appcache/appcache_service_impl.h" +#include "content/browser/appcache/appcache_storage.h" +#include "content/browser/appcache/appcache_update_job.h" -namespace appcache { +namespace content { class AppCacheGroup; @@ -261,4 +261,4 @@ void AppCacheGroup::SetUpdateAppCacheStatus(UpdateAppCacheStatus status) { } } -} // namespace appcache +} // namespace content diff --git a/webkit/browser/appcache/appcache_group.h b/content/browser/appcache/appcache_group.h index 68cdb2a..c79318f 100644 --- a/webkit/browser/appcache/appcache_group.h +++ b/content/browser/appcache/appcache_group.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_GROUP_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_GROUP_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_GROUP_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_GROUP_H_ #include <map> #include <vector> @@ -14,8 +14,8 @@ #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/time/time.h" +#include "content/common/content_export.h" #include "url/gurl.h" -#include "webkit/browser/webkit_storage_browser_export.h" namespace content { FORWARD_DECLARE_TEST(AppCacheGroupTest, StartUpdate); @@ -27,7 +27,7 @@ class AppCacheUpdateJobTest; class MockAppCacheStorage; } -namespace appcache { +namespace content { class AppCache; class AppCacheHost; @@ -37,11 +37,11 @@ class HostObserver; // Collection of application caches identified by the same manifest URL. // A group exists as long as it is in use by a host or is being updated. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheGroup +class CONTENT_EXPORT AppCacheGroup : public base::RefCounted<AppCacheGroup> { public: - class WEBKIT_STORAGE_BROWSER_EXPORT UpdateObserver { + class CONTENT_EXPORT UpdateObserver { public: // Called just after an appcache update has completed. virtual void OnUpdateComplete(AppCacheGroup* group) = 0; @@ -172,6 +172,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheGroup DISALLOW_COPY_AND_ASSIGN(AppCacheGroup); }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_GROUP_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_GROUP_H_ diff --git a/content/browser/appcache/appcache_group_unittest.cc b/content/browser/appcache/appcache_group_unittest.cc index cec20fa..ad45b3b 100644 --- a/content/browser/appcache/appcache_group_unittest.cc +++ b/content/browser/appcache/appcache_group_unittest.cc @@ -5,47 +5,40 @@ #include <string> #include "base/message_loop/message_loop.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_host.h" +#include "content/browser/appcache/appcache_update_job.h" #include "content/browser/appcache/mock_appcache_service.h" +#include "content/common/appcache_interfaces.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_group.h" -#include "webkit/browser/appcache/appcache_host.h" -#include "webkit/browser/appcache/appcache_update_job.h" -#include "webkit/common/appcache/appcache_interfaces.h" - -using appcache::AppCache; -using appcache::AppCacheFrontend; -using appcache::AppCacheGroup; -using appcache::AppCacheHost; -using appcache::AppCacheServiceImpl; -using appcache::AppCacheUpdateJob; namespace { -class TestAppCacheFrontend : public appcache::AppCacheFrontend { +class TestAppCacheFrontend : public content::AppCacheFrontend { public: TestAppCacheFrontend() : last_host_id_(-1), last_cache_id_(-1), - last_status_(appcache::APPCACHE_STATUS_OBSOLETE) { + last_status_(content::APPCACHE_STATUS_OBSOLETE) { } virtual void OnCacheSelected( - int host_id, const appcache::AppCacheInfo& info) OVERRIDE { + int host_id, const content::AppCacheInfo& info) OVERRIDE { last_host_id_ = host_id; last_cache_id_ = info.cache_id; last_status_ = info.status; } virtual void OnStatusChanged(const std::vector<int>& host_ids, - appcache::AppCacheStatus status) OVERRIDE { + content::AppCacheStatus status) OVERRIDE { } virtual void OnEventRaised(const std::vector<int>& host_ids, - appcache::AppCacheEventID event_id) OVERRIDE { + content::AppCacheEventID event_id) OVERRIDE { } virtual void OnErrorEventRaised(const std::vector<int>& host_ids, - const appcache::AppCacheErrorDetails& details) + const content::AppCacheErrorDetails& details) OVERRIDE {} virtual void OnProgressEventRaised(const std::vector<int>& host_ids, @@ -53,7 +46,7 @@ class TestAppCacheFrontend : public appcache::AppCacheFrontend { int num_total, int num_complete) OVERRIDE { } - virtual void OnLogMessage(int host_id, appcache::AppCacheLogLevel log_level, + virtual void OnLogMessage(int host_id, content::AppCacheLogLevel log_level, const std::string& message) OVERRIDE { } @@ -63,7 +56,7 @@ class TestAppCacheFrontend : public appcache::AppCacheFrontend { int last_host_id_; int64 last_cache_id_; - appcache::AppCacheStatus last_status_; + content::AppCacheStatus last_status_; }; } // namespace anon @@ -197,12 +190,12 @@ TEST_F(AppCacheGroupTest, CleanupUnusedGroup) { host1.AssociateCompleteCache(cache1); EXPECT_EQ(frontend.last_host_id_, host1.host_id()); EXPECT_EQ(frontend.last_cache_id_, cache1->cache_id()); - EXPECT_EQ(frontend.last_status_, appcache::APPCACHE_STATUS_IDLE); + EXPECT_EQ(frontend.last_status_, APPCACHE_STATUS_IDLE); host2.AssociateCompleteCache(cache1); EXPECT_EQ(frontend.last_host_id_, host2.host_id()); EXPECT_EQ(frontend.last_cache_id_, cache1->cache_id()); - EXPECT_EQ(frontend.last_status_, appcache::APPCACHE_STATUS_IDLE); + EXPECT_EQ(frontend.last_status_, APPCACHE_STATUS_IDLE); AppCache* cache2 = new AppCache(service.storage(), 222); cache2->set_complete(true); @@ -214,8 +207,8 @@ TEST_F(AppCacheGroupTest, CleanupUnusedGroup) { host1.AssociateNoCache(GURL()); host2.AssociateNoCache(GURL()); EXPECT_EQ(frontend.last_host_id_, host2.host_id()); - EXPECT_EQ(frontend.last_cache_id_, appcache::kAppCacheNoCacheId); - EXPECT_EQ(frontend.last_status_, appcache::APPCACHE_STATUS_UNCACHED); + EXPECT_EQ(frontend.last_cache_id_, kAppCacheNoCacheId); + EXPECT_EQ(frontend.last_status_, APPCACHE_STATUS_UNCACHED); } TEST_F(AppCacheGroupTest, StartUpdate) { diff --git a/webkit/browser/appcache/appcache_histograms.cc b/content/browser/appcache/appcache_histograms.cc index b7299e6..ff221b0 100644 --- a/webkit/browser/appcache/appcache_histograms.cc +++ b/content/browser/appcache/appcache_histograms.cc @@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/browser/appcache/appcache_histograms.h" +#include "content/browser/appcache/appcache_histograms.h" #include "base/metrics/histogram.h" -namespace appcache { +namespace content { static std::string OriginToCustomHistogramSuffix(const GURL& origin_url) { if (origin_url.host() == "docs.google.com") @@ -151,4 +151,4 @@ void AppCacheHistograms::AddMissingManifestDetectedAtCallsite( callsite, NUM_MISSING_MANIFEST_CALLSITE_TYPES); } -} // namespace appcache +} // namespace content diff --git a/webkit/browser/appcache/appcache_histograms.h b/content/browser/appcache/appcache_histograms.h index 21cae36..0fcc54c 100644 --- a/webkit/browser/appcache/appcache_histograms.h +++ b/content/browser/appcache/appcache_histograms.h @@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_HISTOGRAMS_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_HISTOGRAMS_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_HISTOGRAMS_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_HISTOGRAMS_H_ #include "base/basictypes.h" -#include "webkit/browser/appcache/appcache_update_job.h" +#include "content/browser/appcache/appcache_update_job.h" namespace base { class TimeDelta; } -namespace appcache { +namespace content { class AppCacheHistograms { public: @@ -58,6 +58,6 @@ class AppCacheHistograms { DISALLOW_IMPLICIT_CONSTRUCTORS(AppCacheHistograms); }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_HISTOGRAMS_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_HISTOGRAMS_H_ diff --git a/webkit/browser/appcache/appcache_host.cc b/content/browser/appcache/appcache_host.cc index b656b06..db04dad 100644 --- a/webkit/browser/appcache/appcache_host.cc +++ b/content/browser/appcache/appcache_host.cc @@ -2,19 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/browser/appcache/appcache_host.h" +#include "content/browser/appcache/appcache_host.h" #include "base/logging.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_backend_impl.h" +#include "content/browser/appcache/appcache_policy.h" +#include "content/browser/appcache/appcache_request_handler.h" #include "net/url_request/url_request.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_backend_impl.h" -#include "webkit/browser/appcache/appcache_policy.h" -#include "webkit/browser/appcache/appcache_request_handler.h" #include "webkit/browser/quota/quota_manager_proxy.h" -namespace appcache { +namespace content { namespace { @@ -543,4 +543,4 @@ void AppCacheHost::AssociateCacheHelper(AppCache* cache, frontend_->OnCacheSelected(host_id_, info); } -} // namespace appcache +} // namespace content diff --git a/webkit/browser/appcache/appcache_host.h b/content/browser/appcache/appcache_host.h index 0831f15..cef737e 100644 --- a/webkit/browser/appcache/appcache_host.h +++ b/content/browser/appcache/appcache_host.h @@ -2,19 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_HOST_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_HOST_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_HOST_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_HOST_H_ #include "base/callback.h" #include "base/gtest_prod_util.h" #include "base/memory/ref_counted.h" #include "base/observer_list.h" +#include "content/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_service_impl.h" +#include "content/browser/appcache/appcache_storage.h" +#include "content/common/appcache_interfaces.h" +#include "content/common/content_export.h" #include "url/gurl.h" -#include "webkit/browser/appcache/appcache_group.h" -#include "webkit/browser/appcache/appcache_service_impl.h" -#include "webkit/browser/appcache/appcache_storage.h" -#include "webkit/browser/webkit_storage_browser_export.h" -#include "webkit/common/appcache/appcache_interfaces.h" #include "webkit/common/resource_type.h" namespace net { @@ -42,7 +42,7 @@ class AppCacheRequestHandlerTest; class AppCacheUpdateJobTest; } -namespace appcache { +namespace content { class AppCache; class AppCacheFrontend; @@ -53,13 +53,13 @@ typedef base::Callback<void(bool, void*)> StartUpdateCallback; typedef base::Callback<void(bool, void*)> SwapCacheCallback; // Server-side representation of an application cache host. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheHost +class CONTENT_EXPORT AppCacheHost : public AppCacheStorage::Delegate, public AppCacheGroup::UpdateObserver, public AppCacheServiceImpl::Observer { public: - class WEBKIT_STORAGE_BROWSER_EXPORT Observer { + class CONTENT_EXPORT Observer { public: // Called just after the cache selection algorithm completes. virtual void OnCacheSelectionComplete(AppCacheHost* host) = 0; @@ -333,6 +333,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheHost DISALLOW_COPY_AND_ASSIGN(AppCacheHost); }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_HOST_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_HOST_H_ diff --git a/content/browser/appcache/appcache_host_unittest.cc b/content/browser/appcache/appcache_host_unittest.cc index 6b9970d..0959e4f 100644 --- a/content/browser/appcache/appcache_host_unittest.cc +++ b/content/browser/appcache/appcache_host_unittest.cc @@ -6,30 +6,16 @@ #include "base/bind_helpers.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_backend_impl.h" +#include "content/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_host.h" #include "content/browser/appcache/mock_appcache_policy.h" #include "content/browser/appcache/mock_appcache_service.h" #include "net/url_request/url_request.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_backend_impl.h" -#include "webkit/browser/appcache/appcache_group.h" -#include "webkit/browser/appcache/appcache_host.h" #include "webkit/browser/quota/quota_manager.h" -using appcache::AppCache; -using appcache::AppCacheBackendImpl; -using appcache::AppCacheEntry; -using appcache::AppCacheFrontend; -using appcache::AppCacheGroup; -using appcache::AppCacheHost; -using appcache::kAppCacheNoCacheId; -using appcache::APPCACHE_ERROR_EVENT; -using appcache::APPCACHE_STATUS_OBSOLETE; -using appcache::APPCACHE_OBSOLETE_EVENT; -using appcache::APPCACHE_PROGRESS_EVENT; -using appcache::AppCacheStatus; -using appcache::APPCACHE_STATUS_UNCACHED; - namespace content { class AppCacheHostTest : public testing::Test { @@ -50,32 +36,32 @@ class AppCacheHostTest : public testing::Test { public: MockFrontend() : last_host_id_(-222), last_cache_id_(-222), - last_status_(appcache::APPCACHE_STATUS_OBSOLETE), - last_status_changed_(appcache::APPCACHE_STATUS_OBSOLETE), - last_event_id_(appcache::APPCACHE_OBSOLETE_EVENT), + last_status_(APPCACHE_STATUS_OBSOLETE), + last_status_changed_(APPCACHE_STATUS_OBSOLETE), + last_event_id_(APPCACHE_OBSOLETE_EVENT), content_blocked_(false) { } virtual void OnCacheSelected( - int host_id, const appcache::AppCacheInfo& info) OVERRIDE { + int host_id, const AppCacheInfo& info) OVERRIDE { last_host_id_ = host_id; last_cache_id_ = info.cache_id; last_status_ = info.status; } virtual void OnStatusChanged(const std::vector<int>& host_ids, - appcache::AppCacheStatus status) OVERRIDE { + AppCacheStatus status) OVERRIDE { last_status_changed_ = status; } virtual void OnEventRaised(const std::vector<int>& host_ids, - appcache::AppCacheEventID event_id) OVERRIDE { + AppCacheEventID event_id) OVERRIDE { last_event_id_ = event_id; } virtual void OnErrorEventRaised( const std::vector<int>& host_ids, - const appcache::AppCacheErrorDetails& details) OVERRIDE { + const AppCacheErrorDetails& details) OVERRIDE { last_event_id_ = APPCACHE_ERROR_EVENT; } @@ -87,7 +73,7 @@ class AppCacheHostTest : public testing::Test { } virtual void OnLogMessage(int host_id, - appcache::AppCacheLogLevel log_level, + AppCacheLogLevel log_level, const std::string& message) OVERRIDE { } @@ -98,9 +84,9 @@ class AppCacheHostTest : public testing::Test { int last_host_id_; int64 last_cache_id_; - appcache::AppCacheStatus last_status_; - appcache::AppCacheStatus last_status_changed_; - appcache::AppCacheEventID last_event_id_; + AppCacheStatus last_status_; + AppCacheStatus last_status_changed_; + AppCacheEventID last_event_id_; bool content_blocked_; }; @@ -172,9 +158,9 @@ class AppCacheHostTest : public testing::Test { MockFrontend mock_frontend_; // Mock callbacks we expect to receive from the 'host' - appcache::GetStatusCallback get_status_callback_; - appcache::StartUpdateCallback start_update_callback_; - appcache::SwapCacheCallback swap_cache_callback_; + content::GetStatusCallback get_status_callback_; + content::StartUpdateCallback start_update_callback_; + content::SwapCacheCallback swap_cache_callback_; AppCacheStatus last_status_result_; bool last_swap_result_; @@ -387,11 +373,11 @@ TEST_F(AppCacheHostTest, SetSwappableCache) { host.AssociateCompleteCache(cache1); EXPECT_FALSE(host.swappable_cache_.get()); // was same as associated cache - EXPECT_EQ(appcache::APPCACHE_STATUS_IDLE, host.GetStatus()); + EXPECT_EQ(APPCACHE_STATUS_IDLE, host.GetStatus()); // verify OnCacheSelected was called EXPECT_EQ(host.host_id(), mock_frontend_.last_host_id_); EXPECT_EQ(cache1->cache_id(), mock_frontend_.last_cache_id_); - EXPECT_EQ(appcache::APPCACHE_STATUS_IDLE, mock_frontend_.last_status_); + EXPECT_EQ(APPCACHE_STATUS_IDLE, mock_frontend_.last_status_); AppCache* cache2 = new AppCache(service_.storage(), 222); cache2->set_complete(true); diff --git a/content/browser/appcache/appcache_interceptor.cc b/content/browser/appcache/appcache_interceptor.cc index ac7dbc3..76c5c0d 100644 --- a/content/browser/appcache/appcache_interceptor.cc +++ b/content/browser/appcache/appcache_interceptor.cc @@ -4,19 +4,12 @@ #include "content/browser/appcache/appcache_interceptor.h" -#include "webkit/browser/appcache/appcache_backend_impl.h" -#include "webkit/browser/appcache/appcache_host.h" -#include "webkit/browser/appcache/appcache_request_handler.h" -#include "webkit/browser/appcache/appcache_service_impl.h" -#include "webkit/browser/appcache/appcache_url_request_job.h" -#include "webkit/common/appcache/appcache_interfaces.h" - -using appcache::AppCacheBackendImpl; -using appcache::AppCacheHost; -using appcache::AppCacheRequestHandler; -using appcache::AppCacheServiceImpl; -using appcache::kAppCacheNoCacheId; -using appcache::kAppCacheNoHostId; +#include "content/browser/appcache/appcache_backend_impl.h" +#include "content/browser/appcache/appcache_host.h" +#include "content/browser/appcache/appcache_request_handler.h" +#include "content/browser/appcache/appcache_service_impl.h" +#include "content/browser/appcache/appcache_url_request_job.h" +#include "content/common/appcache_interfaces.h" namespace content { diff --git a/content/browser/appcache/appcache_interceptor.h b/content/browser/appcache/appcache_interceptor.h index d8da181..4f86a89 100644 --- a/content/browser/appcache/appcache_interceptor.h +++ b/content/browser/appcache/appcache_interceptor.h @@ -11,7 +11,7 @@ #include "url/gurl.h" #include "webkit/common/resource_type.h" -namespace appcache { +namespace content { class AppCacheRequestHandler; class AppCacheServiceImpl; } @@ -31,7 +31,7 @@ class CONTENT_EXPORT AppCacheInterceptor // Must be called to make a request eligible for retrieval from an appcache. static void SetExtraRequestInfo(net::URLRequest* request, - appcache::AppCacheServiceImpl* service, + AppCacheServiceImpl* service, int process_id, int host_id, ResourceType::Type resource_type); @@ -71,8 +71,8 @@ class CONTENT_EXPORT AppCacheInterceptor virtual ~AppCacheInterceptor(); static void SetHandler(net::URLRequest* request, - appcache::AppCacheRequestHandler* handler); - static appcache::AppCacheRequestHandler* GetHandler(net::URLRequest* request); + AppCacheRequestHandler* handler); + static AppCacheRequestHandler* GetHandler(net::URLRequest* request); DISALLOW_COPY_AND_ASSIGN(AppCacheInterceptor); }; diff --git a/webkit/browser/appcache/appcache_policy.h b/content/browser/appcache/appcache_policy.h index 0792fc4..e7ef6f1 100644 --- a/webkit/browser/appcache/appcache_policy.h +++ b/content/browser/appcache/appcache_policy.h @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_POLICY_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_POLICY_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_POLICY_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_POLICY_H_ class GURL; -namespace appcache { +namespace content { class AppCachePolicy { public: @@ -27,6 +27,6 @@ class AppCachePolicy { ~AppCachePolicy() {} }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_POLICY_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_POLICY_H_ diff --git a/webkit/browser/appcache/appcache_quota_client.cc b/content/browser/appcache/appcache_quota_client.cc index 039b554..2e8c2ab 100644 --- a/webkit/browser/appcache/appcache_quota_client.cc +++ b/content/browser/appcache/appcache_quota_client.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/appcache/appcache_quota_client.h" +#include "content/browser/appcache/appcache_quota_client.h" #include <algorithm> #include <map> @@ -10,7 +10,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" -#include "webkit/browser/appcache/appcache_service_impl.h" +#include "content/browser/appcache/appcache_service_impl.h" using quota::QuotaClient; @@ -24,14 +24,14 @@ quota::QuotaStatusCode NetErrorCodeToQuotaStatus(int code) { return quota::kQuotaStatusUnknown; } -void RunFront(appcache::AppCacheQuotaClient::RequestQueue* queue) { +void RunFront(content::AppCacheQuotaClient::RequestQueue* queue) { base::Closure request = queue->front(); queue->pop_front(); request.Run(); } } // namespace -namespace appcache { +namespace content { AppCacheQuotaClient::AppCacheQuotaClient(AppCacheServiceImpl* service) : service_(service), @@ -250,4 +250,4 @@ void AppCacheQuotaClient::NotifyAppCacheDestroyed() { delete this; } -} // namespace appcache +} // namespace content diff --git a/webkit/browser/appcache/appcache_quota_client.h b/content/browser/appcache/appcache_quota_client.h index 825f38e..e0b7aac 100644 --- a/webkit/browser/appcache/appcache_quota_client.h +++ b/content/browser/appcache/appcache_quota_client.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_QUOTA_CLIENT_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_QUOTA_CLIENT_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_QUOTA_CLIENT_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_QUOTA_CLIENT_H_ #include <deque> #include <map> @@ -12,18 +12,18 @@ #include "base/gtest_prod_util.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" +#include "content/browser/appcache/appcache_storage.h" +#include "content/common/content_export.h" #include "net/base/completion_callback.h" -#include "webkit/browser/appcache/appcache_storage.h" #include "webkit/browser/quota/quota_client.h" #include "webkit/browser/quota/quota_task.h" -#include "webkit/browser/webkit_storage_browser_export.h" #include "webkit/common/quota/quota_types.h" namespace content { class AppCacheQuotaClientTest; } -namespace appcache { +namespace content { class AppCacheServiceImpl; class AppCacheStorageImpl; @@ -61,7 +61,7 @@ class AppCacheQuotaClient : public quota::QuotaClient { friend class AppCacheServiceImpl; // for NotifyAppCacheIsDestroyed friend class AppCacheStorageImpl; // for NotifyAppCacheIsReady - WEBKIT_STORAGE_BROWSER_EXPORT + CONTENT_EXPORT explicit AppCacheQuotaClient(AppCacheServiceImpl* service); void DidDeleteAppCachesForOrigin(int rv); @@ -74,8 +74,8 @@ class AppCacheQuotaClient : public quota::QuotaClient { net::CancelableCompletionCallback* GetServiceDeleteCallback(); // For use by appcache internals during initialization and shutdown. - WEBKIT_STORAGE_BROWSER_EXPORT void NotifyAppCacheReady(); - WEBKIT_STORAGE_BROWSER_EXPORT void NotifyAppCacheDestroyed(); + CONTENT_EXPORT void NotifyAppCacheReady(); + CONTENT_EXPORT void NotifyAppCacheDestroyed(); // Prior to appcache service being ready, we have to queue // up reqeusts and defer acting on them until we're ready. @@ -94,6 +94,6 @@ class AppCacheQuotaClient : public quota::QuotaClient { DISALLOW_COPY_AND_ASSIGN(AppCacheQuotaClient); }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_QUOTA_CLIENT_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_QUOTA_CLIENT_H_ diff --git a/content/browser/appcache/appcache_quota_client_unittest.cc b/content/browser/appcache/appcache_quota_client_unittest.cc index 3a32e95..88346ee 100644 --- a/content/browser/appcache/appcache_quota_client_unittest.cc +++ b/content/browser/appcache/appcache_quota_client_unittest.cc @@ -8,12 +8,10 @@ #include "base/bind.h" #include "base/message_loop/message_loop_proxy.h" #include "base/run_loop.h" +#include "content/browser/appcache/appcache_quota_client.h" #include "content/browser/appcache/mock_appcache_service.h" #include "net/base/net_errors.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/appcache/appcache_quota_client.h" - -using appcache::AppCacheQuotaClient; namespace content { diff --git a/webkit/browser/appcache/appcache_request_handler.cc b/content/browser/appcache/appcache_request_handler.cc index 0777044..2db7a52 100644 --- a/webkit/browser/appcache/appcache_request_handler.cc +++ b/content/browser/appcache/appcache_request_handler.cc @@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/browser/appcache/appcache_request_handler.h" +#include "content/browser/appcache/appcache_request_handler.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_backend_impl.h" +#include "content/browser/appcache/appcache_policy.h" +#include "content/browser/appcache/appcache_url_request_job.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_job.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_backend_impl.h" -#include "webkit/browser/appcache/appcache_policy.h" -#include "webkit/browser/appcache/appcache_url_request_job.h" -namespace appcache { +namespace content { AppCacheRequestHandler::AppCacheRequestHandler( AppCacheHost* host, ResourceType::Type resource_type) @@ -38,7 +38,8 @@ AppCacheStorage* AppCacheRequestHandler::storage() const { AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadResource( net::URLRequest* request, net::NetworkDelegate* network_delegate) { maybe_load_resource_executed_ = true; - if (!host_ || !IsSchemeAndMethodSupported(request) || cache_entry_not_found_) + if (!host_ || !IsSchemeAndMethodSupportedForAppCache(request) || + cache_entry_not_found_) return NULL; // This method can get called multiple times over the life @@ -86,7 +87,8 @@ AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForRedirect( net::URLRequest* request, net::NetworkDelegate* network_delegate, const GURL& location) { - if (!host_ || !IsSchemeAndMethodSupported(request) || cache_entry_not_found_) + if (!host_ || !IsSchemeAndMethodSupportedForAppCache(request) || + cache_entry_not_found_) return NULL; if (is_main_resource()) return NULL; @@ -121,7 +123,8 @@ AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForRedirect( AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForResponse( net::URLRequest* request, net::NetworkDelegate* network_delegate) { - if (!host_ || !IsSchemeAndMethodSupported(request) || cache_entry_not_found_) + if (!host_ || !IsSchemeAndMethodSupportedForAppCache(request) || + cache_entry_not_found_) return NULL; if (!found_fallback_entry_.has_response_id()) return NULL; @@ -396,4 +399,4 @@ void AppCacheRequestHandler::OnCacheSelectionComplete(AppCacheHost* host) { ContinueMaybeLoadSubResource(); } -} // namespace appcache +} // namespace content diff --git a/webkit/browser/appcache/appcache_request_handler.h b/content/browser/appcache/appcache_request_handler.h index fd3d1ad..c73e1dd 100644 --- a/webkit/browser/appcache/appcache_request_handler.h +++ b/content/browser/appcache/appcache_request_handler.h @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ #include "base/compiler_specific.h" #include "base/supports_user_data.h" -#include "webkit/browser/appcache/appcache_entry.h" -#include "webkit/browser/appcache/appcache_host.h" -#include "webkit/browser/webkit_storage_browser_export.h" +#include "content/browser/appcache/appcache_entry.h" +#include "content/browser/appcache/appcache_host.h" +#include "content/common/content_export.h" #include "webkit/common/resource_type.h" namespace net { @@ -22,7 +22,7 @@ namespace content { class AppCacheRequestHandlerTest; } -namespace appcache { +namespace content { class AppCacheURLRequestJob; @@ -31,7 +31,7 @@ class AppCacheURLRequestJob; // given the opportunity to hijack the request along the way. Callers // should use AppCacheHost::CreateRequestHandler to manufacture instances // that can retrieve resources for a particular host. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheRequestHandler +class CONTENT_EXPORT AppCacheRequestHandler : public base::SupportsUserData::Data, public AppCacheHost::Observer, public AppCacheStorage::Delegate { @@ -147,6 +147,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheRequestHandler DISALLOW_COPY_AND_ASSIGN(AppCacheRequestHandler); }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ diff --git a/content/browser/appcache/appcache_request_handler_unittest.cc b/content/browser/appcache/appcache_request_handler_unittest.cc index df6fb33..e8cc8f6 100644 --- a/content/browser/appcache/appcache_request_handler_unittest.cc +++ b/content/browser/appcache/appcache_request_handler_unittest.cc @@ -12,6 +12,10 @@ #include "base/message_loop/message_loop.h" #include "base/synchronization/waitable_event.h" #include "base/threading/thread.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_backend_impl.h" +#include "content/browser/appcache/appcache_request_handler.h" +#include "content/browser/appcache/appcache_url_request_job.h" #include "content/browser/appcache/mock_appcache_policy.h" #include "content/browser/appcache/mock_appcache_service.h" #include "net/base/net_errors.h" @@ -22,21 +26,6 @@ #include "net/url_request/url_request_error_job.h" #include "net/url_request/url_request_job_factory.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_backend_impl.h" -#include "webkit/browser/appcache/appcache_request_handler.h" -#include "webkit/browser/appcache/appcache_url_request_job.h" - -using appcache::AppCache; -using appcache::AppCacheBackendImpl; -using appcache::AppCacheEntry; -using appcache::AppCacheFrontend; -using appcache::AppCacheGroup; -using appcache::AppCacheHost; -using appcache::AppCacheInfo; -using appcache::AppCacheRequestHandler; -using appcache::AppCacheURLRequestJob; -using appcache::kAppCacheNoCacheId; namespace content { @@ -47,17 +36,17 @@ class AppCacheRequestHandlerTest : public testing::Test { class MockFrontend : public AppCacheFrontend { public: virtual void OnCacheSelected( - int host_id, const appcache::AppCacheInfo& info) OVERRIDE {} + int host_id, const AppCacheInfo& info) OVERRIDE {} virtual void OnStatusChanged(const std::vector<int>& host_ids, - appcache::AppCacheStatus status) OVERRIDE {} + AppCacheStatus status) OVERRIDE {} virtual void OnEventRaised(const std::vector<int>& host_ids, - appcache::AppCacheEventID event_id) OVERRIDE {} + AppCacheEventID event_id) OVERRIDE {} virtual void OnErrorEventRaised( const std::vector<int>& host_ids, - const appcache::AppCacheErrorDetails& details) OVERRIDE {} + const AppCacheErrorDetails& details) OVERRIDE {} virtual void OnProgressEventRaised(const std::vector<int>& host_ids, const GURL& url, @@ -66,7 +55,7 @@ class AppCacheRequestHandlerTest : public testing::Test { } virtual void OnLogMessage(int host_id, - appcache::AppCacheLogLevel log_level, + AppCacheLogLevel log_level, const std::string& message) OVERRIDE { } diff --git a/webkit/browser/appcache/appcache_response.cc b/content/browser/appcache/appcache_response.cc index cd0d384..b1d2366 100644 --- a/webkit/browser/appcache/appcache_response.cc +++ b/content/browser/appcache/appcache_response.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/appcache/appcache_response.h" +#include "content/browser/appcache/appcache_response.h" #include "base/bind.h" #include "base/bind_helpers.h" @@ -11,12 +11,12 @@ #include "base/message_loop/message_loop.h" #include "base/pickle.h" #include "base/strings/string_util.h" +#include "content/browser/appcache/appcache_storage.h" #include "net/base/completion_callback.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" -#include "webkit/browser/appcache/appcache_storage.h" -namespace appcache { +namespace content { namespace { @@ -420,4 +420,4 @@ void AppCacheResponseWriter::OnCreateEntryComplete( ContinueWriteData(); } -} // namespace appcache +} // namespace content diff --git a/webkit/browser/appcache/appcache_response.h b/content/browser/appcache/appcache_response.h index d9695b3..474b4d0 100644 --- a/webkit/browser/appcache/appcache_response.h +++ b/content/browser/appcache/appcache_response.h @@ -2,18 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_RESPONSE_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_RESPONSE_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_RESPONSE_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_RESPONSE_H_ #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" +#include "content/common/appcache_interfaces.h" +#include "content/common/content_export.h" #include "net/base/completion_callback.h" #include "net/http/http_response_info.h" #include "url/gurl.h" -#include "webkit/browser/webkit_storage_browser_export.h" -#include "webkit/common/appcache/appcache_interfaces.h" namespace net { class IOBuffer; @@ -23,7 +23,7 @@ namespace content { class MockAppCacheStorage; } -namespace appcache { +namespace content { class AppCacheStorage; @@ -31,7 +31,7 @@ static const int kUnkownResponseDataSize = -1; // Response info for a particular response id. Instances are tracked in // the working set. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheResponseInfo +class CONTENT_EXPORT AppCacheResponseInfo : public base::RefCounted<AppCacheResponseInfo> { public: // AppCacheResponseInfo takes ownership of the http_info. @@ -59,7 +59,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheResponseInfo // A refcounted wrapper for HttpResponseInfo so we can apply the // refcounting semantics used with IOBuffer with these structures too. -struct WEBKIT_STORAGE_BROWSER_EXPORT HttpResponseInfoIOBuffer +struct CONTENT_EXPORT HttpResponseInfoIOBuffer : public base::RefCountedThreadSafe<HttpResponseInfoIOBuffer> { scoped_ptr<net::HttpResponseInfo> http_info; int response_data_size; @@ -73,7 +73,7 @@ struct WEBKIT_STORAGE_BROWSER_EXPORT HttpResponseInfoIOBuffer }; // Low level storage API used by the response reader and writer. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheDiskCacheInterface { +class CONTENT_EXPORT AppCacheDiskCacheInterface { public: class Entry { public: @@ -99,7 +99,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheDiskCacheInterface { }; // Common base class for response reader and writer. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheResponseIO { +class CONTENT_EXPORT AppCacheResponseIO { public: virtual ~AppCacheResponseIO(); int64 response_id() const { return response_id_; } @@ -135,7 +135,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheResponseIO { // and there is a read in progress, the implementation will return // immediately but will take care of any side effect of cancelling the // operation. In other words, instances are safe to delete at will. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheResponseReader +class CONTENT_EXPORT AppCacheResponseReader : public AppCacheResponseIO { public: virtual ~AppCacheResponseReader(); @@ -198,7 +198,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheResponseReader // and there is a write in progress, the implementation will return // immediately but will take care of any side effect of cancelling the // operation. In other words, instances are safe to delete at will. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheResponseWriter +class CONTENT_EXPORT AppCacheResponseWriter : public AppCacheResponseIO { public: virtual ~AppCacheResponseWriter(); @@ -261,6 +261,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheResponseWriter base::WeakPtrFactory<AppCacheResponseWriter> weak_factory_; }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_RESPONSE_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_RESPONSE_H_ diff --git a/content/browser/appcache/appcache_response_unittest.cc b/content/browser/appcache/appcache_response_unittest.cc index 935fd7c..49a3be8 100644 --- a/content/browser/appcache/appcache_response_unittest.cc +++ b/content/browser/appcache/appcache_response_unittest.cc @@ -13,18 +13,13 @@ #include "base/pickle.h" #include "base/synchronization/waitable_event.h" #include "base/threading/thread.h" +#include "content/browser/appcache/appcache_response.h" #include "content/browser/appcache/mock_appcache_service.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" #include "net/http/http_response_headers.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/appcache/appcache_response.h" -using appcache::AppCacheStorage; -using appcache::AppCacheResponseInfo; -using appcache::AppCacheResponseReader; -using appcache::AppCacheResponseWriter; -using appcache::HttpResponseInfoIOBuffer; using net::IOBuffer; using net::WrappedIOBuffer; diff --git a/webkit/browser/appcache/appcache_service_impl.cc b/content/browser/appcache/appcache_service_impl.cc index 3091a5c..6c3f0fd 100644 --- a/webkit/browser/appcache/appcache_service_impl.cc +++ b/content/browser/appcache/appcache_service_impl.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/appcache/appcache_service_impl.h" +#include "content/browser/appcache/appcache_service_impl.h" #include <functional> @@ -11,21 +11,21 @@ #include "base/logging.h" #include "base/message_loop/message_loop.h" #include "base/stl_util.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_backend_impl.h" +#include "content/browser/appcache/appcache_entry.h" +#include "content/browser/appcache/appcache_executable_handler.h" +#include "content/browser/appcache/appcache_histograms.h" +#include "content/browser/appcache/appcache_policy.h" +#include "content/browser/appcache/appcache_quota_client.h" +#include "content/browser/appcache/appcache_response.h" +#include "content/browser/appcache/appcache_service_impl.h" +#include "content/browser/appcache/appcache_storage_impl.h" #include "net/base/completion_callback.h" #include "net/base/io_buffer.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_backend_impl.h" -#include "webkit/browser/appcache/appcache_entry.h" -#include "webkit/browser/appcache/appcache_executable_handler.h" -#include "webkit/browser/appcache/appcache_histograms.h" -#include "webkit/browser/appcache/appcache_policy.h" -#include "webkit/browser/appcache/appcache_quota_client.h" -#include "webkit/browser/appcache/appcache_response.h" -#include "webkit/browser/appcache/appcache_service_impl.h" -#include "webkit/browser/appcache/appcache_storage_impl.h" #include "webkit/browser/quota/special_storage_policy.h" -namespace appcache { +namespace content { namespace { @@ -143,8 +143,8 @@ class AppCacheServiceImpl::DeleteHelper : public AsyncHelper { private: // AppCacheStorage::Delegate implementation. virtual void OnGroupLoaded( - appcache::AppCacheGroup* group, const GURL& manifest_url) OVERRIDE; - virtual void OnGroupMadeObsolete(appcache::AppCacheGroup* group, + AppCacheGroup* group, const GURL& manifest_url) OVERRIDE; + virtual void OnGroupMadeObsolete(AppCacheGroup* group, bool success, int response_code) OVERRIDE; @@ -153,7 +153,7 @@ class AppCacheServiceImpl::DeleteHelper : public AsyncHelper { }; void AppCacheServiceImpl::DeleteHelper::OnGroupLoaded( - appcache::AppCacheGroup* group, const GURL& manifest_url) { + AppCacheGroup* group, const GURL& manifest_url) { if (group) { group->set_being_deleted(true); group->CancelUpdate(); @@ -165,7 +165,7 @@ void AppCacheServiceImpl::DeleteHelper::OnGroupLoaded( } void AppCacheServiceImpl::DeleteHelper::OnGroupMadeObsolete( - appcache::AppCacheGroup* group, + AppCacheGroup* group, bool success, int response_code) { CallCallback(success ? net::OK : net::ERR_FAILED); @@ -192,8 +192,8 @@ class AppCacheServiceImpl::DeleteOriginHelper : public AsyncHelper { // AppCacheStorage::Delegate implementation. virtual void OnAllInfo(AppCacheInfoCollection* collection) OVERRIDE; virtual void OnGroupLoaded( - appcache::AppCacheGroup* group, const GURL& manifest_url) OVERRIDE; - virtual void OnGroupMadeObsolete(appcache::AppCacheGroup* group, + AppCacheGroup* group, const GURL& manifest_url) OVERRIDE; + virtual void OnGroupMadeObsolete(AppCacheGroup* group, bool success, int response_code) OVERRIDE; @@ -237,7 +237,7 @@ void AppCacheServiceImpl::DeleteOriginHelper::OnAllInfo( } void AppCacheServiceImpl::DeleteOriginHelper::OnGroupLoaded( - appcache::AppCacheGroup* group, const GURL& manifest_url) { + AppCacheGroup* group, const GURL& manifest_url) { if (group) { group->set_being_deleted(true); group->CancelUpdate(); @@ -248,7 +248,7 @@ void AppCacheServiceImpl::DeleteOriginHelper::OnGroupLoaded( } void AppCacheServiceImpl::DeleteOriginHelper::OnGroupMadeObsolete( - appcache::AppCacheGroup* group, + AppCacheGroup* group, bool success, int response_code) { CacheCompleted(success); @@ -575,4 +575,4 @@ void AppCacheServiceImpl::UnregisterBackend( backends_.erase(backend_impl->process_id()); } -} // namespace appcache +} // namespace content diff --git a/webkit/browser/appcache/appcache_service_impl.h b/content/browser/appcache/appcache_service_impl.h index 12524ec..ef4f060 100644 --- a/webkit/browser/appcache/appcache_service_impl.h +++ b/content/browser/appcache/appcache_service_impl.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_SERVICE_IMPL_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_SERVICE_IMPL_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_SERVICE_IMPL_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_SERVICE_IMPL_H_ #include <map> #include <set> @@ -14,12 +14,12 @@ #include "base/observer_list.h" #include "base/time/time.h" #include "base/timer/timer.h" +#include "content/common/appcache_interfaces.h" +#include "content/common/content_export.h" +#include "content/public/browser/appcache_service.h" #include "net/base/completion_callback.h" #include "net/base/net_errors.h" -#include "webkit/browser/appcache/appcache_service.h" #include "webkit/browser/quota/quota_manager_proxy.h" -#include "webkit/browser/webkit_storage_browser_export.h" -#include "webkit/common/appcache/appcache_interfaces.h" namespace net { class URLRequestContext; @@ -40,7 +40,7 @@ namespace quota { class SpecialStoragePolicy; } -namespace appcache { +namespace content { class AppCacheBackendImpl; class AppCacheExecutableHandlerFactory; @@ -50,7 +50,7 @@ class AppCacheStorage; // Refcounted container to manage the lifetime of the old storage instance // during Reinitialization. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheStorageReference +class CONTENT_EXPORT AppCacheStorageReference : public base::RefCounted<AppCacheStorageReference> { public: AppCacheStorage* storage() const { return storage_.get(); } @@ -66,11 +66,11 @@ private: // Class that manages the application cache service. Sends notifications // to many frontends. One instance per user-profile. Each instance has // exclusive access to its cache_directory on disk. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheServiceImpl +class CONTENT_EXPORT AppCacheServiceImpl : public AppCacheService { public: - class WEBKIT_STORAGE_BROWSER_EXPORT Observer { + class CONTENT_EXPORT Observer { public: // An observer method to inform consumers of reinitialzation. Managing // the lifetime of the old storage instance is a delicate process. @@ -222,6 +222,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheServiceImpl DISALLOW_COPY_AND_ASSIGN(AppCacheServiceImpl); }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_SERVICE_IMPL_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_SERVICE_IMPL_H_ diff --git a/content/browser/appcache/appcache_service_unittest.cc b/content/browser/appcache/appcache_service_unittest.cc index 80016a9..d22fb041 100644 --- a/content/browser/appcache/appcache_service_unittest.cc +++ b/content/browser/appcache/appcache_service_unittest.cc @@ -8,23 +8,13 @@ #include "base/bind_helpers.h" #include "base/pickle.h" #include "base/run_loop.h" +#include "content/browser/appcache/appcache_response.h" +#include "content/browser/appcache/appcache_service_impl.h" #include "content/browser/appcache/mock_appcache_storage.h" #include "net/base/completion_callback.h" #include "net/base/io_buffer.h" #include "net/http/http_response_headers.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/appcache/appcache_response.h" -#include "webkit/browser/appcache/appcache_service_impl.h" - -using appcache::AppCache; -using appcache::AppCacheEntry; -using appcache::AppCacheGroup; -using appcache::AppCacheInfo; -using appcache::AppCacheInfoCollection; -using appcache::AppCacheInfoVector; -using appcache::AppCacheResponseReader; -using appcache::AppCacheServiceImpl; -using appcache::HttpResponseInfoIOBuffer; namespace content { namespace { @@ -199,7 +189,7 @@ TEST_F(AppCacheServiceImplTest, DeleteAppCachesForOrigin) { delete_completion_count_ = 0; // Should succeed given an empty info collection. - mock_storage()->SimulateGetAllInfo(new AppCacheInfoCollection); + mock_storage()->SimulateGetAllInfo(new content::AppCacheInfoCollection); service_->DeleteAppCachesForOrigin(kOrigin, deletion_callback_); EXPECT_EQ(0, delete_completion_count_); base::RunLoop().RunUntilIdle(); diff --git a/webkit/browser/appcache/appcache_storage.cc b/content/browser/appcache/appcache_storage.cc index ce4f01e..d78339d 100644 --- a/webkit/browser/appcache/appcache_storage.cc +++ b/content/browser/appcache/appcache_storage.cc @@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/browser/appcache/appcache_storage.h" +#include "content/browser/appcache/appcache_storage.h" #include "base/bind.h" #include "base/bind_helpers.h" #include "base/stl_util.h" -#include "webkit/browser/appcache/appcache_response.h" -#include "webkit/browser/appcache/appcache_service_impl.h" +#include "content/browser/appcache/appcache_response.h" +#include "content/browser/appcache/appcache_service_impl.h" #include "webkit/browser/quota/quota_client.h" #include "webkit/browser/quota/quota_manager_proxy.h" -namespace appcache { +namespace content { // static const int64 AppCacheStorage::kUnitializedId = -1; @@ -132,5 +132,5 @@ void AppCacheStorage::NotifyStorageAccessed(const GURL& origin) { origin, quota::kStorageTypeTemporary); } -} // namespace appcache +} // namespace content diff --git a/webkit/browser/appcache/appcache_storage.h b/content/browser/appcache/appcache_storage.h index 41bbd55..871110c 100644 --- a/webkit/browser/appcache/appcache_storage.h +++ b/content/browser/appcache/appcache_storage.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ #include <map> #include <vector> @@ -13,9 +13,9 @@ #include "base/gtest_prod_util.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" +#include "content/browser/appcache/appcache_working_set.h" +#include "content/common/content_export.h" #include "net/base/completion_callback.h" -#include "webkit/browser/appcache/appcache_working_set.h" -#include "webkit/browser/webkit_storage_browser_export.h" class GURL; @@ -27,7 +27,7 @@ class AppCacheResponseTest; class AppCacheStorageTest; } -namespace appcache { +namespace content { class AppCache; class AppCacheEntry; @@ -38,11 +38,11 @@ class AppCacheServiceImpl; struct AppCacheInfoCollection; struct HttpResponseInfoIOBuffer; -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheStorage { +class CONTENT_EXPORT AppCacheStorage { public: typedef std::map<GURL, int64> UsageMap; - class WEBKIT_STORAGE_BROWSER_EXPORT Delegate { + class CONTENT_EXPORT Delegate { public: // If retrieval fails, 'collection' will be NULL. virtual void OnAllInfo(AppCacheInfoCollection* collection) {} @@ -325,6 +325,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheStorage { DISALLOW_COPY_AND_ASSIGN(AppCacheStorage); }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ diff --git a/webkit/browser/appcache/appcache_storage_impl.cc b/content/browser/appcache/appcache_storage_impl.cc index 62563d7..dee1f9c 100644 --- a/webkit/browser/appcache/appcache_storage_impl.cc +++ b/content/browser/appcache/appcache_storage_impl.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/appcache/appcache_storage_impl.h" +#include "content/browser/appcache/appcache_storage_impl.h" #include <algorithm> #include <functional> @@ -16,24 +16,24 @@ #include "base/message_loop/message_loop.h" #include "base/stl_util.h" #include "base/strings/string_util.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_database.h" +#include "content/browser/appcache/appcache_entry.h" +#include "content/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_histograms.h" +#include "content/browser/appcache/appcache_quota_client.h" +#include "content/browser/appcache/appcache_response.h" +#include "content/browser/appcache/appcache_service_impl.h" #include "net/base/cache_type.h" #include "net/base/net_errors.h" #include "sql/connection.h" #include "sql/transaction.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_database.h" -#include "webkit/browser/appcache/appcache_entry.h" -#include "webkit/browser/appcache/appcache_group.h" -#include "webkit/browser/appcache/appcache_histograms.h" -#include "webkit/browser/appcache/appcache_quota_client.h" -#include "webkit/browser/appcache/appcache_response.h" -#include "webkit/browser/appcache/appcache_service_impl.h" #include "webkit/browser/quota/quota_client.h" #include "webkit/browser/quota/quota_manager.h" #include "webkit/browser/quota/quota_manager_proxy.h" #include "webkit/browser/quota/special_storage_policy.h" -namespace appcache { +namespace content { // Hard coded default when not using quota management. static const int kDefaultQuota = 5 * 1024 * 1024; @@ -841,7 +841,7 @@ class NetworkNamespaceHelper { bool IsInNetworkNamespace(const GURL& url, int64 cache_id) { typedef std::pair<WhiteListMap::iterator, bool> InsertResult; InsertResult result = namespaces_map_.insert( - WhiteListMap::value_type(cache_id, NamespaceVector())); + WhiteListMap::value_type(cache_id, AppCacheNamespaceVector())); if (result.second) GetOnlineWhiteListForCache(cache_id, &result.first->second); return AppCache::FindNamespace(result.first->second, url) != NULL; @@ -849,7 +849,7 @@ class NetworkNamespaceHelper { private: void GetOnlineWhiteListForCache( - int64 cache_id, NamespaceVector* namespaces) { + int64 cache_id, AppCacheNamespaceVector* namespaces) { DCHECK(namespaces && namespaces->empty()); typedef std::vector<AppCacheDatabase::OnlineWhiteListRecord> WhiteListVector; @@ -859,14 +859,14 @@ class NetworkNamespaceHelper { WhiteListVector::const_iterator iter = records.begin(); while (iter != records.end()) { namespaces->push_back( - Namespace(APPCACHE_NETWORK_NAMESPACE, iter->namespace_url, GURL(), - iter->is_pattern)); + AppCacheNamespace(APPCACHE_NETWORK_NAMESPACE, iter->namespace_url, + GURL(), iter->is_pattern)); ++iter; } } // Key is cache id - typedef std::map<int64, NamespaceVector> WhiteListMap; + typedef std::map<int64, AppCacheNamespaceVector> WhiteListMap; WhiteListMap namespaces_map_; AppCacheDatabase* database_; }; @@ -1857,4 +1857,4 @@ void AppCacheStorageImpl::CallScheduleReinitialize() { // note: 'this' may be deleted at this point. } -} // namespace appcache +} // namespace content diff --git a/webkit/browser/appcache/appcache_storage_impl.h b/content/browser/appcache/appcache_storage_impl.h index a5103a6..dadf72e 100644 --- a/webkit/browser/appcache/appcache_storage_impl.h +++ b/content/browser/appcache/appcache_storage_impl.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_ #include <deque> #include <map> @@ -15,17 +15,17 @@ #include "base/files/file_path.h" #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop_proxy.h" -#include "webkit/browser/appcache/appcache_database.h" -#include "webkit/browser/appcache/appcache_disk_cache.h" -#include "webkit/browser/appcache/appcache_storage.h" -#include "webkit/browser/webkit_storage_browser_export.h" +#include "content/browser/appcache/appcache_database.h" +#include "content/browser/appcache/appcache_disk_cache.h" +#include "content/browser/appcache/appcache_storage.h" +#include "content/common/content_export.h" namespace content { class AppCacheStorageImplTest; class ChromeAppCacheServiceTest; } -namespace appcache { +namespace content { class AppCacheStorageImpl : public AppCacheStorage { public: @@ -132,7 +132,7 @@ class AppCacheStorageImpl : public AppCacheStorage { const GURL& namespace_entry_url, const AppCacheEntry& fallback_entry, int64 cache_id, int64 group_id, const GURL& manifest_url); - WEBKIT_STORAGE_BROWSER_EXPORT AppCacheDiskCache* disk_cache(); + CONTENT_EXPORT AppCacheDiskCache* disk_cache(); // The directory in which we place files in the file system. base::FilePath cache_directory_; @@ -176,6 +176,6 @@ class AppCacheStorageImpl : public AppCacheStorage { friend class content::ChromeAppCacheServiceTest; }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_ diff --git a/content/browser/appcache/appcache_storage_impl_unittest.cc b/content/browser/appcache/appcache_storage_impl_unittest.cc index 4c467a1..a8489af 100644 --- a/content/browser/appcache/appcache_storage_impl_unittest.cc +++ b/content/browser/appcache/appcache_storage_impl_unittest.cc @@ -13,7 +13,16 @@ #include "base/message_loop/message_loop.h" #include "base/synchronization/waitable_event.h" #include "base/threading/thread.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_backend_impl.h" +#include "content/browser/appcache/appcache_database.h" +#include "content/browser/appcache/appcache_entry.h" +#include "content/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_host.h" #include "content/browser/appcache/appcache_interceptor.h" +#include "content/browser/appcache/appcache_request_handler.h" +#include "content/browser/appcache/appcache_service_impl.h" +#include "content/browser/appcache/appcache_storage_impl.h" #include "net/base/net_errors.h" #include "net/base/request_priority.h" #include "net/http/http_response_headers.h" @@ -23,40 +32,8 @@ #include "net/url_request/url_request_test_util.h" #include "sql/test/test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_backend_impl.h" -#include "webkit/browser/appcache/appcache_database.h" -#include "webkit/browser/appcache/appcache_entry.h" -#include "webkit/browser/appcache/appcache_group.h" -#include "webkit/browser/appcache/appcache_host.h" -#include "webkit/browser/appcache/appcache_request_handler.h" -#include "webkit/browser/appcache/appcache_service_impl.h" -#include "webkit/browser/appcache/appcache_storage_impl.h" #include "webkit/browser/quota/quota_manager.h" -using appcache::APPCACHE_FALLBACK_NAMESPACE; -using appcache::APPCACHE_NETWORK_NAMESPACE; -using appcache::AppCacheBackendImpl; -using appcache::AppCacheDatabase; -using appcache::AppCacheEntry; -using appcache::AppCacheFrontend; -using appcache::AppCacheHost; -using appcache::AppCacheInfo; -using appcache::AppCacheGroup; -using appcache::AppCacheServiceImpl; -using appcache::AppCacheStorage; -using appcache::AppCacheStorageImpl; -using appcache::AppCacheStorageReference; -using appcache::AppCache; -using appcache::AppCacheErrorDetails; -using appcache::AppCacheEventID; -using appcache::kAppCacheNoCacheId; -using appcache::kAppCacheNoResponseId; -using appcache::APPCACHE_INTERCEPT_NAMESPACE; -using appcache::AppCacheLogLevel; -using appcache::Namespace; -using appcache::AppCacheStatus; - namespace content { namespace { @@ -1054,12 +1031,12 @@ class AppCacheStorageImplTest : public testing::Test { cache_->AddEntry(kEntryUrl, AppCacheEntry(AppCacheEntry::FALLBACK, 1)); cache_->AddEntry(kEntryUrl2, AppCacheEntry(AppCacheEntry::FALLBACK, 2)); cache_->fallback_namespaces_.push_back( - Namespace(APPCACHE_FALLBACK_NAMESPACE, + AppCacheNamespace(APPCACHE_FALLBACK_NAMESPACE, kFallbackNamespace2, kEntryUrl2, false)); cache_->fallback_namespaces_.push_back( - Namespace(APPCACHE_FALLBACK_NAMESPACE, + AppCacheNamespace(APPCACHE_FALLBACK_NAMESPACE, kFallbackNamespace, kEntryUrl, false)); @@ -1132,10 +1109,10 @@ class AppCacheStorageImplTest : public testing::Test { cache_->AddEntry(kEntryUrl, AppCacheEntry(AppCacheEntry::INTERCEPT, 1)); cache_->AddEntry(kEntryUrl2, AppCacheEntry(AppCacheEntry::INTERCEPT, 2)); cache_->intercept_namespaces_.push_back( - Namespace(APPCACHE_INTERCEPT_NAMESPACE, kInterceptNamespace2, + AppCacheNamespace(APPCACHE_INTERCEPT_NAMESPACE, kInterceptNamespace2, kEntryUrl2, false)); cache_->intercept_namespaces_.push_back( - Namespace(APPCACHE_INTERCEPT_NAMESPACE, kInterceptNamespace, + AppCacheNamespace(APPCACHE_INTERCEPT_NAMESPACE, kInterceptNamespace, kEntryUrl, false)); AppCacheDatabase::CacheRecord cache_record; std::vector<AppCacheDatabase::EntryRecord> entries; @@ -1202,8 +1179,8 @@ class AppCacheStorageImplTest : public testing::Test { MakeCacheAndGroup(kManifestUrl, 2, 1, true); cache_->AddEntry(kEntryUrl, AppCacheEntry(AppCacheEntry::INTERCEPT, 1)); cache_->intercept_namespaces_.push_back( - Namespace(APPCACHE_INTERCEPT_NAMESPACE, kInterceptPatternNamespace, - kEntryUrl, true)); + AppCacheNamespace(APPCACHE_INTERCEPT_NAMESPACE, + kInterceptPatternNamespace, kEntryUrl, true)); AppCacheDatabase::CacheRecord cache_record; std::vector<AppCacheDatabase::EntryRecord> entries; std::vector<AppCacheDatabase::NamespaceRecord> intercepts; @@ -1289,8 +1266,8 @@ class AppCacheStorageImplTest : public testing::Test { MakeCacheAndGroup(kManifestUrl, 2, 1, true); cache_->AddEntry(kEntryUrl, AppCacheEntry(AppCacheEntry::FALLBACK, 1)); cache_->fallback_namespaces_.push_back( - Namespace(APPCACHE_FALLBACK_NAMESPACE, kFallbackPatternNamespace, - kEntryUrl, true)); + AppCacheNamespace(APPCACHE_FALLBACK_NAMESPACE, + kFallbackPatternNamespace, kEntryUrl, true)); AppCacheDatabase::CacheRecord cache_record; std::vector<AppCacheDatabase::EntryRecord> entries; std::vector<AppCacheDatabase::NamespaceRecord> intercepts; @@ -1420,7 +1397,7 @@ class AppCacheStorageImplTest : public testing::Test { fallback_namespace_record.origin = manifest_url.GetOrigin(); EXPECT_TRUE(database()->InsertNamespace(&fallback_namespace_record)); cache_->fallback_namespaces_.push_back( - Namespace(APPCACHE_FALLBACK_NAMESPACE, + AppCacheNamespace(APPCACHE_FALLBACK_NAMESPACE, kFallbackNamespace, kEntryUrl2, false)); @@ -1535,16 +1512,16 @@ class AppCacheStorageImplTest : public testing::Test { AppCacheEntry(AppCacheEntry::EXPLICIT | AppCacheEntry::FOREIGN, 1)); cache_->AddEntry(kEntryUrl2, AppCacheEntry(AppCacheEntry::FALLBACK, 2)); cache_->fallback_namespaces_.push_back( - Namespace(APPCACHE_FALLBACK_NAMESPACE, + AppCacheNamespace(APPCACHE_FALLBACK_NAMESPACE, kFallbackNamespace, kEntryUrl2, false)); cache_->online_whitelist_namespaces_.push_back( - Namespace(APPCACHE_NETWORK_NAMESPACE, kOnlineNamespace, + AppCacheNamespace(APPCACHE_NETWORK_NAMESPACE, kOnlineNamespace, GURL(), false)); cache_->online_whitelist_namespaces_.push_back( - Namespace(APPCACHE_NETWORK_NAMESPACE, kOnlineNamespaceWithinFallback, - GURL(), false)); + AppCacheNamespace(APPCACHE_NETWORK_NAMESPACE, + kOnlineNamespaceWithinFallback, GURL(), false)); AppCacheDatabase::EntryRecord entry_record; entry_record.cache_id = 1; diff --git a/content/browser/appcache/appcache_storage_unittest.cc b/content/browser/appcache/appcache_storage_unittest.cc index fa69696..827fce6 100644 --- a/content/browser/appcache/appcache_storage_unittest.cc +++ b/content/browser/appcache/appcache_storage_unittest.cc @@ -3,19 +3,13 @@ // found in the LICENSE file. #include "base/message_loop/message_loop.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_response.h" +#include "content/browser/appcache/appcache_storage.h" #include "content/browser/appcache/mock_appcache_service.h" #include "content/browser/quota/mock_quota_manager_proxy.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_group.h" -#include "webkit/browser/appcache/appcache_response.h" -#include "webkit/browser/appcache/appcache_storage.h" - -using appcache::AppCache; -using appcache::AppCacheGroup; -using appcache::AppCacheResponseInfo; -using appcache::AppCacheStorage; -using appcache::kUnkownResponseDataSize; namespace content { diff --git a/content/browser/appcache/appcache_unittest.cc b/content/browser/appcache/appcache_unittest.cc index 32c4e89..a82ab3d 100644 --- a/content/browser/appcache/appcache_unittest.cc +++ b/content/browser/appcache/appcache_unittest.cc @@ -2,30 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_host.h" #include "content/browser/appcache/mock_appcache_service.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_host.h" - -using appcache::AppCache; -using appcache::AppCacheDatabase; -using appcache::AppCacheEntry; -using appcache::AppCacheFrontend; -using appcache::AppCacheGroup; -using appcache::AppCacheHost; -using appcache::AppCacheInfo; -using appcache::AppCacheErrorDetails; -using appcache::AppCacheEventID; -using appcache::APPCACHE_FALLBACK_NAMESPACE; -using appcache::APPCACHE_INTERCEPT_NAMESPACE; -using appcache::AppCacheLogLevel; -using appcache::Manifest; -using appcache::Namespace; -using appcache::NamespaceVector; -using appcache::APPCACHE_NETWORK_NAMESPACE; -using appcache::PARSE_MANIFEST_ALLOWING_INTERCEPTS; -using appcache::PARSE_MANIFEST_PER_STANDARD; -using appcache::AppCacheStatus; namespace content { @@ -132,23 +112,26 @@ TEST(AppCacheTest, InitializeWithManifest) { manifest.explicit_urls.insert("http://one.com"); manifest.explicit_urls.insert("http://two.com"); manifest.fallback_namespaces.push_back( - Namespace(APPCACHE_FALLBACK_NAMESPACE, GURL("http://fb1.com"), + AppCacheNamespace(APPCACHE_FALLBACK_NAMESPACE, GURL("http://fb1.com"), GURL("http://fbone.com"), true)); manifest.online_whitelist_namespaces.push_back( - Namespace(APPCACHE_NETWORK_NAMESPACE, GURL("http://w1.com"), GURL(), false)); + AppCacheNamespace(APPCACHE_NETWORK_NAMESPACE, GURL("http://w1.com"), + GURL(), false)); manifest.online_whitelist_namespaces.push_back( - Namespace(APPCACHE_NETWORK_NAMESPACE, GURL("http://w2.com"), GURL(), false)); + AppCacheNamespace(APPCACHE_NETWORK_NAMESPACE, GURL("http://w2.com"), + GURL(), false)); manifest.online_whitelist_all = true; cache->InitializeWithManifest(&manifest); - const std::vector<Namespace>& fallbacks = + const std::vector<AppCacheNamespace>& fallbacks = cache->fallback_namespaces_; size_t expected = 1; EXPECT_EQ(expected, fallbacks.size()); EXPECT_EQ(GURL("http://fb1.com"), fallbacks[0].namespace_url); EXPECT_EQ(GURL("http://fbone.com"), fallbacks[0].target_url); EXPECT_TRUE(fallbacks[0].is_pattern); - const NamespaceVector& whitelist = cache->online_whitelist_namespaces_; + const AppCacheNamespaceVector& whitelist = + cache->online_whitelist_namespaces_; expected = 2; EXPECT_EQ(expected, whitelist.size()); EXPECT_EQ(GURL("http://w1.com"), whitelist[0].namespace_url); @@ -193,24 +176,23 @@ TEST(AppCacheTest, FindResponseForRequest) { Manifest manifest; manifest.online_whitelist_namespaces.push_back( - Namespace(APPCACHE_NETWORK_NAMESPACE, kOnlineNamespaceUrl, - GURL(), false)); + AppCacheNamespace(APPCACHE_NETWORK_NAMESPACE, kOnlineNamespaceUrl, + GURL(), false)); manifest.online_whitelist_namespaces.push_back( - Namespace(APPCACHE_NETWORK_NAMESPACE, - kOnlineNamespaceWithinOtherNamespaces, - GURL(), false)); + AppCacheNamespace(APPCACHE_NETWORK_NAMESPACE, + kOnlineNamespaceWithinOtherNamespaces, GURL(), false)); manifest.fallback_namespaces.push_back( - Namespace(APPCACHE_FALLBACK_NAMESPACE, kFallbackNamespaceUrl1, - kFallbackEntryUrl1, false)); + AppCacheNamespace(APPCACHE_FALLBACK_NAMESPACE, kFallbackNamespaceUrl1, + kFallbackEntryUrl1, false)); manifest.fallback_namespaces.push_back( - Namespace(APPCACHE_FALLBACK_NAMESPACE, kFallbackNamespaceUrl2, - kFallbackEntryUrl2, false)); + AppCacheNamespace(APPCACHE_FALLBACK_NAMESPACE, kFallbackNamespaceUrl2, + kFallbackEntryUrl2, false)); manifest.intercept_namespaces.push_back( - Namespace(APPCACHE_INTERCEPT_NAMESPACE, kInterceptNamespace, - kInterceptNamespaceEntry, false)); + AppCacheNamespace(APPCACHE_INTERCEPT_NAMESPACE, kInterceptNamespace, + kInterceptNamespaceEntry, false)); manifest.intercept_namespaces.push_back( - Namespace(APPCACHE_INTERCEPT_NAMESPACE, kInterceptNamespaceWithinFallback, - kInterceptNamespaceEntry, false)); + AppCacheNamespace(APPCACHE_INTERCEPT_NAMESPACE, + kInterceptNamespaceWithinFallback, kInterceptNamespaceEntry, false)); // Create a cache with some namespaces and entries. scoped_refptr<AppCache> cache(new AppCache(service.storage(), 1234)); @@ -385,8 +367,8 @@ TEST(AppCacheTest, FindInterceptPatternResponseForRequest) { const int64 kInterceptResponseId = 1; Manifest manifest; manifest.intercept_namespaces.push_back( - Namespace(APPCACHE_INTERCEPT_NAMESPACE, kInterceptPatternNamespace, - kInterceptNamespaceEntry, true)); + AppCacheNamespace(APPCACHE_INTERCEPT_NAMESPACE, + kInterceptPatternNamespace, kInterceptNamespaceEntry, true)); scoped_refptr<AppCache> cache(new AppCache(service.storage(), 1234)); cache->InitializeWithManifest(&manifest); cache->AddEntry( @@ -456,7 +438,7 @@ TEST(AppCacheTest, FindFallbackPatternResponseForRequest) { const int64 kFallbackResponseId = 1; Manifest manifest; manifest.fallback_namespaces.push_back( - Namespace(APPCACHE_FALLBACK_NAMESPACE, kFallbackPatternNamespace, + AppCacheNamespace(APPCACHE_FALLBACK_NAMESPACE, kFallbackPatternNamespace, kFallbackNamespaceEntry, true)); scoped_refptr<AppCache> cache(new AppCache(service.storage(), 1234)); cache->InitializeWithManifest(&manifest); @@ -526,7 +508,7 @@ TEST(AppCacheTest, FindNetworkNamespacePatternResponseForRequest) { kNetworkNamespaceBase.Resolve("*.hit*")); Manifest manifest; manifest.online_whitelist_namespaces.push_back( - Namespace(APPCACHE_NETWORK_NAMESPACE, kNetworkPatternNamespace, + AppCacheNamespace(APPCACHE_NETWORK_NAMESPACE, kNetworkPatternNamespace, GURL(), true)); manifest.online_whitelist_all = false; scoped_refptr<AppCache> cache(new AppCache(service.storage(), 1234)); @@ -644,7 +626,7 @@ TEST(AppCacheTest, ToFromDatabaseRecords) { } TEST(AppCacheTest, IsNamespaceMatch) { - Namespace prefix; + AppCacheNamespace prefix; prefix.namespace_url = GURL("http://foo.com/prefix"); prefix.is_pattern = false; EXPECT_TRUE(prefix.IsMatch( @@ -652,7 +634,7 @@ TEST(AppCacheTest, IsNamespaceMatch) { EXPECT_FALSE(prefix.IsMatch( GURL("http://foo.com/nope"))); - Namespace bar_no_star; + AppCacheNamespace bar_no_star; bar_no_star.namespace_url = GURL("http://foo.com/bar"); bar_no_star.is_pattern = true; EXPECT_TRUE(bar_no_star.IsMatch( @@ -660,7 +642,7 @@ TEST(AppCacheTest, IsNamespaceMatch) { EXPECT_FALSE(bar_no_star.IsMatch( GURL("http://foo.com/bar/nope"))); - Namespace bar_star; + AppCacheNamespace bar_star; bar_star.namespace_url = GURL("http://foo.com/bar/*"); bar_star.is_pattern = true; EXPECT_TRUE(bar_star.IsMatch( @@ -670,7 +652,7 @@ TEST(AppCacheTest, IsNamespaceMatch) { EXPECT_FALSE(bar_star.IsMatch( GURL("http://foo.com/not_bar/should_not_match"))); - Namespace star_bar_star; + AppCacheNamespace star_bar_star; star_bar_star.namespace_url = GURL("http://foo.com/*/bar/*"); star_bar_star.is_pattern = true; EXPECT_TRUE(star_bar_star.IsMatch( @@ -680,7 +662,7 @@ TEST(AppCacheTest, IsNamespaceMatch) { EXPECT_FALSE(star_bar_star.IsMatch( GURL("http://foo.com/any/not_bar/no_match"))); - Namespace query_star_edit; + AppCacheNamespace query_star_edit; query_star_edit.namespace_url = GURL("http://foo.com/query?id=*&verb=edit*"); query_star_edit.is_pattern = true; EXPECT_TRUE(query_star_edit.IsMatch( @@ -692,7 +674,7 @@ TEST(AppCacheTest, IsNamespaceMatch) { EXPECT_TRUE(query_star_edit.IsMatch( GURL("http://foo.com/query?id=123&verb=print&verb=edit"))); - Namespace star_greediness; + AppCacheNamespace star_greediness; star_greediness.namespace_url = GURL("http://foo.com/*/b"); star_greediness.is_pattern = true; EXPECT_TRUE(star_greediness.IsMatch( diff --git a/webkit/browser/appcache/appcache_update_job.cc b/content/browser/appcache/appcache_update_job.cc index 0c5593c..347d4b5c 100644 --- a/webkit/browser/appcache/appcache_update_job.cc +++ b/content/browser/appcache/appcache_update_job.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/appcache/appcache_update_job.h" +#include "content/browser/appcache/appcache_update_job.h" #include "base/bind.h" #include "base/bind_helpers.h" @@ -10,6 +10,8 @@ #include "base/message_loop/message_loop.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" +#include "content/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_histograms.h" #include "net/base/io_buffer.h" #include "net/base/load_flags.h" #include "net/base/net_errors.h" @@ -17,10 +19,8 @@ #include "net/http/http_request_headers.h" #include "net/http/http_response_headers.h" #include "net/url_request/url_request_context.h" -#include "webkit/browser/appcache/appcache_group.h" -#include "webkit/browser/appcache/appcache_histograms.h" -namespace appcache { +namespace content { static const int kBufferSize = 32768; static const size_t kMaxConcurrentUrlFetches = 2; @@ -526,7 +526,7 @@ void AppCacheUpdateJob::HandleManifestFetchCompleted( std::string message = FormatUrlErrorMessage( kFormatString, manifest_url_, fetcher->result(), response_code); HandleCacheFailure(AppCacheErrorDetails(message, - appcache::APPCACHE_MANIFEST_ERROR, + APPCACHE_MANIFEST_ERROR, manifest_url_, response_code, false /*is_cross_origin*/), @@ -542,7 +542,7 @@ void AppCacheUpdateJob::OnGroupMadeObsolete(AppCacheGroup* group, CancelAllMasterEntryFetches(AppCacheErrorDetails( "The cache has been made obsolete, " "the manifest file returned 404 or 410", - appcache::APPCACHE_MANIFEST_ERROR, + APPCACHE_MANIFEST_ERROR, GURL(), response_code, false /*is_cross_origin*/)); @@ -591,7 +591,7 @@ void AppCacheUpdateJob::ContinueHandleManifestFetchCompleted(bool changed) { AppCacheErrorDetails( message, APPCACHE_SIGNATURE_ERROR, GURL(), 0, false /*is_cross_origin*/), - APPCACHE_MANIFEST_ERROR, + MANIFEST_ERROR, GURL()); VLOG(1) << message; return; @@ -790,7 +790,7 @@ void AppCacheUpdateJob::HandleMasterEntryFetchCompleted( kFormatString, request->url(), fetcher->result(), response_code); host_notifier.SendErrorNotifications( AppCacheErrorDetails(message, - appcache::APPCACHE_MANIFEST_ERROR, + APPCACHE_MANIFEST_ERROR, request->url(), response_code, false /*is_cross_origin*/)); @@ -805,7 +805,7 @@ void AppCacheUpdateJob::HandleMasterEntryFetchCompleted( // Section 6.9.4, step 22.3. if (update_type_ == CACHE_ATTEMPT && pending_master_entries_.empty()) { HandleCacheFailure(AppCacheErrorDetails(message, - appcache::APPCACHE_MANIFEST_ERROR, + APPCACHE_MANIFEST_ERROR, request->url(), response_code, false /*is_cross_origin*/), @@ -857,14 +857,14 @@ void AppCacheUpdateJob::HandleManifestRefetchCompleted( GURL(), 0, false /*is_cross_origin*/), - APPCACHE_MANIFEST_ERROR, + MANIFEST_ERROR, GURL()); } else { const char* kFormatString = "Manifest re-fetch failed (%d) %s"; std::string message = FormatUrlErrorMessage( kFormatString, manifest_url_, fetcher->result(), response_code); HandleCacheFailure(AppCacheErrorDetails(message, - appcache::APPCACHE_MANIFEST_ERROR, + APPCACHE_MANIFEST_ERROR, GURL(), response_code, false /*is_cross_origin*/), @@ -951,8 +951,8 @@ void AppCacheUpdateJob::OnGroupAndNewestCacheStored(AppCacheGroup* group, std::string message("Failed to commit new cache to storage"); if (would_exceed_quota) { message.append(", would exceed quota"); - result = APPCACHE_QUOTA_ERROR; - reason = appcache::APPCACHE_QUOTA_ERROR; + result = QUOTA_ERROR; + reason = APPCACHE_QUOTA_ERROR; } HandleCacheFailure( AppCacheErrorDetails(message, reason, GURL(), 0, @@ -1099,9 +1099,9 @@ void AppCacheUpdateJob::BuildUrlFileList(const Manifest& manifest) { AddUrlToFileList(GURL(*it), AppCacheEntry::EXPLICIT); } - const std::vector<Namespace>& intercepts = + const std::vector<AppCacheNamespace>& intercepts = manifest.intercept_namespaces; - for (std::vector<Namespace>::const_iterator it = intercepts.begin(); + for (std::vector<AppCacheNamespace>::const_iterator it = intercepts.begin(); it != intercepts.end(); ++it) { int flags = AppCacheEntry::INTERCEPT; if (it->is_executable) @@ -1109,9 +1109,9 @@ void AppCacheUpdateJob::BuildUrlFileList(const Manifest& manifest) { AddUrlToFileList(it->target_url, flags); } - const std::vector<Namespace>& fallbacks = + const std::vector<AppCacheNamespace>& fallbacks = manifest.fallback_namespaces; - for (std::vector<Namespace>::const_iterator it = fallbacks.begin(); + for (std::vector<AppCacheNamespace>::const_iterator it = fallbacks.begin(); it != fallbacks.end(); ++it) { AddUrlToFileList(it->target_url, AppCacheEntry::FALLBACK); } @@ -1608,4 +1608,4 @@ void AppCacheUpdateJob::DeleteSoon() { base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } -} // namespace appcache +} // namespace content diff --git a/webkit/browser/appcache/appcache_update_job.h b/content/browser/appcache/appcache_update_job.h index ba15541..14fc831 100644 --- a/webkit/browser/appcache/appcache_update_job.h +++ b/content/browser/appcache/appcache_update_job.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ #include <deque> #include <map> @@ -14,17 +14,17 @@ #include "base/gtest_prod_util.h" #include "base/memory/ref_counted.h" #include "base/time/time.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_host.h" +#include "content/browser/appcache/appcache_response.h" +#include "content/browser/appcache/appcache_service_impl.h" +#include "content/browser/appcache/appcache_storage.h" +#include "content/common/appcache_interfaces.h" +#include "content/common/content_export.h" #include "net/base/completion_callback.h" #include "net/http/http_response_headers.h" #include "net/url_request/url_request.h" #include "url/gurl.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_host.h" -#include "webkit/browser/appcache/appcache_response.h" -#include "webkit/browser/appcache/appcache_service_impl.h" -#include "webkit/browser/appcache/appcache_storage.h" -#include "webkit/browser/webkit_storage_browser_export.h" -#include "webkit/common/appcache/appcache_interfaces.h" namespace content { FORWARD_DECLARE_TEST(AppCacheGroupTest, QueueUpdate); @@ -32,20 +32,20 @@ class AppCacheGroupTest; class AppCacheUpdateJobTest; } -namespace appcache { +namespace content { class HostNotifier; // Application cache Update algorithm and state. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheUpdateJob +class CONTENT_EXPORT AppCacheUpdateJob : public AppCacheStorage::Delegate, public AppCacheHost::Observer, public AppCacheServiceImpl::Observer { public: // Used for uma stats only for now, so new values are append only. enum ResultType { - UPDATE_OK, DB_ERROR, DISKCACHE_ERROR, APPCACHE_QUOTA_ERROR, REDIRECT_ERROR, - APPCACHE_MANIFEST_ERROR, NETWORK_ERROR, SERVER_ERROR, CANCELLED_ERROR, + UPDATE_OK, DB_ERROR, DISKCACHE_ERROR, QUOTA_ERROR, REDIRECT_ERROR, + MANIFEST_ERROR, NETWORK_ERROR, SERVER_ERROR, CANCELLED_ERROR, NUM_UPDATE_JOB_RESULT_TYPES }; @@ -347,6 +347,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheUpdateJob DISALLOW_COPY_AND_ASSIGN(AppCacheUpdateJob); }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_UPDATE_JOB_H_ diff --git a/content/browser/appcache/appcache_update_job_unittest.cc b/content/browser/appcache/appcache_update_job_unittest.cc index bc3957e..6eb4e02 100644 --- a/content/browser/appcache/appcache_update_job_unittest.cc +++ b/content/browser/appcache/appcache_update_job_unittest.cc @@ -7,6 +7,10 @@ #include "base/stl_util.h" #include "base/synchronization/waitable_event.h" #include "base/threading/thread.h" +#include "content/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_host.h" +#include "content/browser/appcache/appcache_response.h" +#include "content/browser/appcache/appcache_update_job.h" #include "content/browser/appcache/mock_appcache_service.h" #include "net/base/net_errors.h" #include "net/http/http_response_headers.h" @@ -15,35 +19,6 @@ #include "net/url_request/url_request_test_job.h" #include "net/url_request/url_request_test_util.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/appcache/appcache_group.h" -#include "webkit/browser/appcache/appcache_host.h" -#include "webkit/browser/appcache/appcache_response.h" -#include "webkit/browser/appcache/appcache_update_job.h" - -using appcache::AppCache; -using appcache::AppCacheEntry; -using appcache::AppCacheFrontend; -using appcache::AppCacheHost; -using appcache::AppCacheGroup; -using appcache::AppCacheResponseInfo; -using appcache::AppCacheUpdateJob; -using appcache::AppCacheResponseWriter; -using appcache::APPCACHE_CACHED_EVENT; -using appcache::APPCACHE_CHECKING_EVENT; -using appcache::APPCACHE_DOWNLOADING_EVENT; -using appcache::APPCACHE_ERROR_EVENT; -using appcache::AppCacheEventID; -using appcache::APPCACHE_FALLBACK_NAMESPACE; -using appcache::HttpResponseInfoIOBuffer; -using appcache::kAppCacheNoCacheId; -using appcache::kAppCacheNoResponseId; -using appcache::Namespace; -using appcache::APPCACHE_NETWORK_NAMESPACE; -using appcache::APPCACHE_NO_UPDATE_EVENT; -using appcache::APPCACHE_OBSOLETE_EVENT; -using appcache::APPCACHE_PROGRESS_EVENT; -using appcache::APPCACHE_UPDATE_READY_EVENT; -using appcache::AppCacheStatus; namespace content { class AppCacheUpdateJobTest; @@ -227,7 +202,8 @@ class MockHttpServerJobFactory } }; -inline bool operator==(const Namespace& lhs, const Namespace& rhs) { +inline bool operator==(const AppCacheNamespace& lhs, + const AppCacheNamespace& rhs) { return lhs.type == rhs.type && lhs.namespace_url == rhs.namespace_url && lhs.target_url == rhs.target_url; @@ -244,7 +220,7 @@ class MockFrontend : public AppCacheFrontend { } virtual void OnCacheSelected( - int host_id, const appcache::AppCacheInfo& info) OVERRIDE { + int host_id, const AppCacheInfo& info) OVERRIDE { } virtual void OnStatusChanged(const std::vector<int>& host_ids, @@ -268,7 +244,7 @@ class MockFrontend : public AppCacheFrontend { } virtual void OnErrorEventRaised(const std::vector<int>& host_ids, - const appcache::AppCacheErrorDetails& details) + const AppCacheErrorDetails& details) OVERRIDE { error_message_ = details.message; OnEventRaised(host_ids, APPCACHE_ERROR_EVENT); @@ -306,7 +282,7 @@ class MockFrontend : public AppCacheFrontend { } virtual void OnLogMessage(int host_id, - appcache::AppCacheLogLevel log_level, + AppCacheLogLevel log_level, const std::string& message) OVERRIDE { } @@ -3273,7 +3249,7 @@ class AppCacheUpdateJobTest : public testing::Test, expected = 1; ASSERT_EQ(expected, cache->fallback_namespaces_.size()); EXPECT_TRUE(cache->fallback_namespaces_[0] == - Namespace( + AppCacheNamespace( APPCACHE_FALLBACK_NAMESPACE, MockHttpServer::GetMockUrl("files/fallback1"), MockHttpServer::GetMockUrl("files/fallback1a"), @@ -3301,7 +3277,7 @@ class AppCacheUpdateJobTest : public testing::Test, expected = 1; ASSERT_EQ(expected, cache->fallback_namespaces_.size()); EXPECT_TRUE(cache->fallback_namespaces_[0] == - Namespace( + AppCacheNamespace( APPCACHE_FALLBACK_NAMESPACE, MockHttpServer::GetMockUrl("files/fallback1"), MockHttpServer::GetMockUrl("files/explicit1"), @@ -3309,7 +3285,7 @@ class AppCacheUpdateJobTest : public testing::Test, EXPECT_EQ(expected, cache->online_whitelist_namespaces_.size()); EXPECT_TRUE(cache->online_whitelist_namespaces_[0] == - Namespace( + AppCacheNamespace( APPCACHE_NETWORK_NAMESPACE, MockHttpServer::GetMockUrl("files/online1"), GURL(), false)); @@ -3498,7 +3474,7 @@ TEST_F(AppCacheUpdateJobTest, AlreadyDownloading) { EXPECT_EQ(expected, events[1].first.size()); EXPECT_EQ(host.host_id(), events[1].first[0]); - EXPECT_EQ(appcache::APPCACHE_DOWNLOADING_EVENT, events[1].second); + EXPECT_EQ(APPCACHE_DOWNLOADING_EVENT, events[1].second); EXPECT_EQ(AppCacheGroup::DOWNLOADING, group->update_status()); } diff --git a/webkit/browser/appcache/appcache_url_request_job.cc b/content/browser/appcache/appcache_url_request_job.cc index 2cdcb77..b12a5b6 100644 --- a/webkit/browser/appcache/appcache_url_request_job.cc +++ b/content/browser/appcache/appcache_url_request_job.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/appcache/appcache_url_request_job.h" +#include "content/browser/appcache/appcache_url_request_job.h" #include <vector> @@ -13,6 +13,11 @@ #include "base/message_loop/message_loop.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_histograms.h" +#include "content/browser/appcache/appcache_host.h" +#include "content/browser/appcache/appcache_service_impl.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" #include "net/base/net_log.h" @@ -21,13 +26,8 @@ #include "net/http/http_util.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_status.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_group.h" -#include "webkit/browser/appcache/appcache_histograms.h" -#include "webkit/browser/appcache/appcache_host.h" -#include "webkit/browser/appcache/appcache_service_impl.h" -namespace appcache { +namespace content { AppCacheURLRequestJob::AppCacheURLRequestJob( net::URLRequest* request, @@ -446,4 +446,4 @@ void AppCacheURLRequestJob::SetExtraRequestHeaders( range_requested_ = ranges[0]; } -} // namespace appcache +} // namespace content diff --git a/webkit/browser/appcache/appcache_url_request_job.h b/content/browser/appcache/appcache_url_request_job.h index 01c80a1..4b9bbcd 100644 --- a/webkit/browser/appcache/appcache_url_request_job.h +++ b/content/browser/appcache/appcache_url_request_job.h @@ -2,19 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_URL_REQUEST_JOB_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_URL_REQUEST_JOB_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_URL_REQUEST_JOB_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_URL_REQUEST_JOB_H_ #include <string> #include "base/memory/weak_ptr.h" +#include "content/browser/appcache/appcache_entry.h" +#include "content/browser/appcache/appcache_executable_handler.h" +#include "content/browser/appcache/appcache_response.h" +#include "content/browser/appcache/appcache_storage.h" +#include "content/common/content_export.h" #include "net/http/http_byte_range.h" #include "net/url_request/url_request_job.h" -#include "webkit/browser/appcache/appcache_entry.h" -#include "webkit/browser/appcache/appcache_executable_handler.h" -#include "webkit/browser/appcache/appcache_response.h" -#include "webkit/browser/appcache/appcache_storage.h" -#include "webkit/browser/webkit_storage_browser_export.h" namespace content { class AppCacheRequestHandlerTest; @@ -25,13 +25,13 @@ namespace net { class GrowableIOBuffer; }; -namespace appcache { +namespace content { class AppCacheHost; // A net::URLRequestJob derivative that knows how to return a response stored // in the appcache. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheURLRequestJob +class CONTENT_EXPORT AppCacheURLRequestJob : public net::URLRequestJob, public AppCacheStorage::Delegate { public: @@ -177,6 +177,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheURLRequestJob base::WeakPtrFactory<AppCacheURLRequestJob> weak_factory_; }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_REQUEST_HANDLER_H_ diff --git a/content/browser/appcache/appcache_url_request_job_unittest.cc b/content/browser/appcache/appcache_url_request_job_unittest.cc index edaa07e..7c70eed 100644 --- a/content/browser/appcache/appcache_url_request_job_unittest.cc +++ b/content/browser/appcache/appcache_url_request_job_unittest.cc @@ -12,6 +12,8 @@ #include "base/pickle.h" #include "base/synchronization/waitable_event.h" #include "base/threading/thread.h" +#include "content/browser/appcache/appcache_response.h" +#include "content/browser/appcache/appcache_url_request_job.h" #include "content/browser/appcache/mock_appcache_service.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" @@ -22,17 +24,7 @@ #include "net/url_request/url_request_error_job.h" #include "net/url_request/url_request_job_factory.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/appcache/appcache_response.h" -#include "webkit/browser/appcache/appcache_url_request_job.h" - -using appcache::AppCacheEntry; -using appcache::AppCacheStorage; -using appcache::AppCacheResponseInfo; -using appcache::AppCacheResponseReader; -using appcache::AppCacheResponseWriter; -using appcache::AppCacheURLRequestJob; -using appcache::HttpResponseInfoIOBuffer; -using appcache::kAppCacheNoCacheId; + using net::IOBuffer; using net::WrappedIOBuffer; diff --git a/webkit/browser/appcache/appcache_working_set.cc b/content/browser/appcache/appcache_working_set.cc index 2b9a70c..4394097 100644 --- a/webkit/browser/appcache/appcache_working_set.cc +++ b/content/browser/appcache/appcache_working_set.cc @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "webkit/browser/appcache/appcache_working_set.h" +#include "content/browser/appcache/appcache_working_set.h" #include "base/logging.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_group.h" -#include "webkit/browser/appcache/appcache_response.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_response.h" -namespace appcache { +namespace content { AppCacheWorkingSet::AppCacheWorkingSet() : is_disabled_(false) {} diff --git a/webkit/browser/appcache/appcache_working_set.h b/content/browser/appcache/appcache_working_set.h index 482e58f..5b9d00a 100644 --- a/webkit/browser/appcache/appcache_working_set.h +++ b/content/browser/appcache/appcache_working_set.h @@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_WORKING_SET_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_WORKING_SET_H_ +#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_WORKING_SET_H_ +#define CONTENT_BROWSER_APPCACHE_APPCACHE_WORKING_SET_H_ #include <map> #include "base/containers/hash_tables.h" +#include "content/common/content_export.h" #include "url/gurl.h" -#include "webkit/browser/webkit_storage_browser_export.h" -namespace appcache { +namespace content { class AppCache; class AppCacheGroup; @@ -19,7 +19,7 @@ class AppCacheResponseInfo; // Represents the working set of appcache object instances // currently in memory. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheWorkingSet { +class CONTENT_EXPORT AppCacheWorkingSet { public: typedef std::map<GURL, AppCacheGroup*> GroupMap; @@ -71,6 +71,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheWorkingSet { bool is_disabled_; }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_WORKING_SET_H_ +#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_WORKING_SET_H_ diff --git a/content/browser/appcache/chrome_appcache_service.cc b/content/browser/appcache/chrome_appcache_service.cc index c72c218..8d686e8 100644 --- a/content/browser/appcache/chrome_appcache_service.cc +++ b/content/browser/appcache/chrome_appcache_service.cc @@ -5,12 +5,12 @@ #include "content/browser/appcache/chrome_appcache_service.h" #include "base/files/file_path.h" +#include "content/browser/appcache/appcache_storage_impl.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/resource_context.h" #include "net/base/net_errors.h" #include "net/url_request/url_request_context_getter.h" -#include "webkit/browser/appcache/appcache_storage_impl.h" #include "webkit/browser/quota/quota_manager.h" namespace content { diff --git a/content/browser/appcache/chrome_appcache_service.h b/content/browser/appcache/chrome_appcache_service.h index 2f33d9b..8bc54d4 100644 --- a/content/browser/appcache/chrome_appcache_service.h +++ b/content/browser/appcache/chrome_appcache_service.h @@ -8,9 +8,9 @@ #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" #include "base/sequenced_task_runner_helpers.h" +#include "content/browser/appcache/appcache_policy.h" +#include "content/browser/appcache/appcache_service_impl.h" #include "content/common/content_export.h" -#include "webkit/browser/appcache/appcache_policy.h" -#include "webkit/browser/appcache/appcache_service_impl.h" #include "webkit/browser/quota/special_storage_policy.h" namespace base { @@ -40,8 +40,8 @@ struct ChromeAppCacheServiceDeleter; class CONTENT_EXPORT ChromeAppCacheService : public base::RefCountedThreadSafe<ChromeAppCacheService, ChromeAppCacheServiceDeleter>, - NON_EXPORTED_BASE(public appcache::AppCacheServiceImpl), - NON_EXPORTED_BASE(public appcache::AppCachePolicy) { + NON_EXPORTED_BASE(public AppCacheServiceImpl), + NON_EXPORTED_BASE(public AppCachePolicy) { public: explicit ChromeAppCacheService(quota::QuotaManagerProxy* proxy); diff --git a/content/browser/appcache/chrome_appcache_service_unittest.cc b/content/browser/appcache/chrome_appcache_service_unittest.cc index 1800d0b..98bf68a 100644 --- a/content/browser/appcache/chrome_appcache_service_unittest.cc +++ b/content/browser/appcache/chrome_appcache_service_unittest.cc @@ -7,6 +7,8 @@ #include "base/files/scoped_temp_dir.h" #include "base/memory/ref_counted.h" #include "base/message_loop/message_loop.h" +#include "content/browser/appcache/appcache_database.h" +#include "content/browser/appcache/appcache_storage_impl.h" #include "content/browser/appcache/chrome_appcache_service.h" #include "content/browser/browser_thread_impl.h" #include "content/public/browser/resource_context.h" @@ -15,8 +17,6 @@ #include "content/test/appcache_test_helper.h" #include "net/url_request/url_request_context_getter.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/appcache/appcache_database.h" -#include "webkit/browser/appcache/appcache_storage_impl.h" #include <set> @@ -116,8 +116,8 @@ ChromeAppCacheServiceTest::CreateAppCacheServiceImpl( // Steps needed to initialize the storage of AppCache data. message_loop_.RunUntilIdle(); if (init_storage) { - appcache::AppCacheStorageImpl* storage = - static_cast<appcache::AppCacheStorageImpl*>( + AppCacheStorageImpl* storage = + static_cast<AppCacheStorageImpl*>( appcache_service->storage()); storage->database_->db_connection(); storage->disk_cache(); diff --git a/webkit/browser/appcache/manifest_parser.cc b/content/browser/appcache/manifest_parser.cc index f43d889..fb63f22 100644 --- a/webkit/browser/appcache/manifest_parser.cc +++ b/content/browser/appcache/manifest_parser.cc @@ -29,7 +29,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "webkit/browser/appcache/manifest_parser.h" +#include "content/browser/appcache/manifest_parser.h" #include "base/command_line.h" #include "base/i18n/icu_string_conversions.h" @@ -37,7 +37,7 @@ #include "base/strings/utf_string_conversions.h" #include "url/gurl.h" -namespace appcache { +namespace content { namespace { @@ -219,7 +219,8 @@ bool ParseManifest(const GURL& manifest_url, const char* data, int length, } else { bool is_pattern = HasPatternMatchingAnnotation(line_p, line_end); manifest.online_whitelist_namespaces.push_back( - Namespace(APPCACHE_NETWORK_NAMESPACE, url, GURL(), is_pattern)); + AppCacheNamespace(APPCACHE_NETWORK_NAMESPACE, url, GURL(), + is_pattern)); } } else if (mode == INTERCEPT) { if (parse_mode != PARSE_MANIFEST_ALLOWING_INTERCEPTS) { @@ -304,7 +305,7 @@ bool ParseManifest(const GURL& manifest_url, const char* data, int length, bool is_pattern = HasPatternMatchingAnnotation(line_p, line_end); manifest.intercept_namespaces.push_back( - Namespace(APPCACHE_INTERCEPT_NAMESPACE, namespace_url, + AppCacheNamespace(APPCACHE_INTERCEPT_NAMESPACE, namespace_url, target_url, is_pattern, verb == EXECUTE)); } else if (mode == FALLBACK) { const wchar_t* line_p = line.c_str(); @@ -368,7 +369,7 @@ bool ParseManifest(const GURL& manifest_url, const char* data, int length, // Store regardless of duplicate namespace URL. Only first match // will ever be used. manifest.fallback_namespaces.push_back( - Namespace(APPCACHE_FALLBACK_NAMESPACE, namespace_url, + AppCacheNamespace(APPCACHE_FALLBACK_NAMESPACE, namespace_url, fallback_url, is_pattern)); } else { NOTREACHED(); @@ -378,4 +379,4 @@ bool ParseManifest(const GURL& manifest_url, const char* data, int length, return true; } -} // namespace appcache +} // namespace content diff --git a/webkit/browser/appcache/manifest_parser.h b/content/browser/appcache/manifest_parser.h index c8d5f00..4deb599 100644 --- a/webkit/browser/appcache/manifest_parser.h +++ b/content/browser/appcache/manifest_parser.h @@ -29,28 +29,28 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WEBKIT_BROWSER_APPCACHE_MANIFEST_PARSER_H_ -#define WEBKIT_BROWSER_APPCACHE_MANIFEST_PARSER_H_ +#ifndef CONTENT_BROWSER_APPCACHE_MANIFEST_PARSER_H_ +#define CONTENT_BROWSER_APPCACHE_MANIFEST_PARSER_H_ #include <string> #include <vector> #include "base/containers/hash_tables.h" -#include "webkit/browser/webkit_storage_browser_export.h" -#include "webkit/common/appcache/appcache_interfaces.h" +#include "content/common/appcache_interfaces.h" +#include "content/common/content_export.h" class GURL; -namespace appcache { +namespace content { -struct WEBKIT_STORAGE_BROWSER_EXPORT Manifest { +struct CONTENT_EXPORT Manifest { Manifest(); ~Manifest(); base::hash_set<std::string> explicit_urls; - NamespaceVector intercept_namespaces; - NamespaceVector fallback_namespaces; - NamespaceVector online_whitelist_namespaces; + AppCacheNamespaceVector intercept_namespaces; + AppCacheNamespaceVector fallback_namespaces; + AppCacheNamespaceVector online_whitelist_namespaces; bool online_whitelist_all; bool did_ignore_intercept_namespaces; }; @@ -60,13 +60,13 @@ enum ParseMode { PARSE_MANIFEST_ALLOWING_INTERCEPTS }; -WEBKIT_STORAGE_BROWSER_EXPORT bool ParseManifest( +CONTENT_EXPORT bool ParseManifest( const GURL& manifest_url, const char* data, int length, ParseMode parse_mode, Manifest& manifest); -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_MANIFEST_PARSER_H_ +#endif // CONTENT_BROWSER_APPCACHE_MANIFEST_PARSER_H_ diff --git a/content/browser/appcache/manifest_parser_unittest.cc b/content/browser/appcache/manifest_parser_unittest.cc index 8a44376..caefca37 100644 --- a/content/browser/appcache/manifest_parser_unittest.cc +++ b/content/browser/appcache/manifest_parser_unittest.cc @@ -4,17 +4,9 @@ #include <string> +#include "content/browser/appcache/manifest_parser.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" -#include "webkit/browser/appcache/manifest_parser.h" - -using appcache::Manifest; -using appcache::NamespaceVector; -using appcache::APPCACHE_FALLBACK_NAMESPACE; -using appcache::APPCACHE_INTERCEPT_NAMESPACE; -using appcache::APPCACHE_NETWORK_NAMESPACE; -using appcache::PARSE_MANIFEST_ALLOWING_INTERCEPTS; -using appcache::PARSE_MANIFEST_PER_STANDARD; namespace content { @@ -167,7 +159,7 @@ TEST(AppCacheManifestParserTest, WhitelistUrls) { EXPECT_TRUE(manifest.intercept_namespaces.empty()); EXPECT_FALSE(manifest.online_whitelist_all); - const NamespaceVector& online = manifest.online_whitelist_namespaces; + const AppCacheNamespaceVector& online = manifest.online_whitelist_namespaces; const size_t kExpected = 6; ASSERT_EQ(kExpected, online.size()); EXPECT_EQ(APPCACHE_NETWORK_NAMESPACE, online[0].type); @@ -213,7 +205,7 @@ TEST(AppCacheManifestParserTest, FallbackUrls) { EXPECT_TRUE(manifest.online_whitelist_namespaces.empty()); EXPECT_FALSE(manifest.online_whitelist_all); - const NamespaceVector& fallbacks = manifest.fallback_namespaces; + const AppCacheNamespaceVector& fallbacks = manifest.fallback_namespaces; const size_t kExpected = 5; ASSERT_EQ(kExpected, fallbacks.size()); EXPECT_EQ(APPCACHE_FALLBACK_NAMESPACE, fallbacks[0].type); @@ -264,7 +256,7 @@ TEST(AppCacheManifestParserTest, FallbackUrlsWithPort) { EXPECT_TRUE(manifest.online_whitelist_namespaces.empty()); EXPECT_FALSE(manifest.online_whitelist_all); - const NamespaceVector& fallbacks = manifest.fallback_namespaces; + const AppCacheNamespaceVector& fallbacks = manifest.fallback_namespaces; const size_t kExpected = 3; ASSERT_EQ(kExpected, fallbacks.size()); EXPECT_EQ(APPCACHE_FALLBACK_NAMESPACE, fallbacks[0].type); @@ -308,7 +300,7 @@ TEST(AppCacheManifestParserTest, InterceptUrls) { EXPECT_TRUE(manifest.online_whitelist_namespaces.empty()); EXPECT_FALSE(manifest.online_whitelist_all); - const NamespaceVector& intercepts = manifest.intercept_namespaces; + const AppCacheNamespaceVector& intercepts = manifest.intercept_namespaces; const size_t kExpected = 3; ASSERT_EQ(kExpected, intercepts.size()); EXPECT_EQ(APPCACHE_INTERCEPT_NAMESPACE, intercepts[0].type); @@ -372,7 +364,7 @@ TEST(AppCacheManifestParserTest, ComboUrls) { EXPECT_TRUE(urls.find("http://combo.com:99/explicit-2") != urls.end()); EXPECT_TRUE(urls.find("http://www.diff.com/explicit-3") != urls.end()); - const NamespaceVector& online = manifest.online_whitelist_namespaces; + const AppCacheNamespaceVector& online = manifest.online_whitelist_namespaces; expected = 4; ASSERT_EQ(expected, online.size()); EXPECT_EQ(GURL("http://combo.com/whitelist-1"), @@ -384,7 +376,7 @@ TEST(AppCacheManifestParserTest, ComboUrls) { EXPECT_EQ(GURL("http://combo.com:99/whitelist-4"), online[3].namespace_url); - const NamespaceVector& fallbacks = manifest.fallback_namespaces; + const AppCacheNamespaceVector& fallbacks = manifest.fallback_namespaces; expected = 2; ASSERT_EQ(expected, fallbacks.size()); EXPECT_EQ(APPCACHE_FALLBACK_NAMESPACE, fallbacks[0].type); diff --git a/content/browser/appcache/mock_appcache_policy.h b/content/browser/appcache/mock_appcache_policy.h index bc75764..93de476 100644 --- a/content/browser/appcache/mock_appcache_policy.h +++ b/content/browser/appcache/mock_appcache_policy.h @@ -6,12 +6,12 @@ #define CONTENT_BROWSER_APPCACHE_MOCK_APPCACHE_POLICY_H_ #include "base/compiler_specific.h" +#include "content/browser/appcache/appcache_policy.h" #include "url/gurl.h" -#include "webkit/browser/appcache/appcache_policy.h" namespace content { -class MockAppCachePolicy : public appcache::AppCachePolicy { +class MockAppCachePolicy : public AppCachePolicy { public: MockAppCachePolicy(); virtual ~MockAppCachePolicy(); diff --git a/content/browser/appcache/mock_appcache_service.h b/content/browser/appcache/mock_appcache_service.h index 691736b..ad86c54 100644 --- a/content/browser/appcache/mock_appcache_service.h +++ b/content/browser/appcache/mock_appcache_service.h @@ -6,12 +6,10 @@ #define CONTENT_BROWSER_APPCACHE_MOCK_APPCACHE_SERVICE_H_ #include "base/compiler_specific.h" +#include "content/browser/appcache/appcache_service_impl.h" #include "content/browser/appcache/mock_appcache_storage.h" -#include "webkit/browser/appcache/appcache_service_impl.h" #include "webkit/browser/quota/quota_manager.h" -using appcache::AppCacheServiceImpl; - namespace content { // For use by unit tests. diff --git a/content/browser/appcache/mock_appcache_storage.cc b/content/browser/appcache/mock_appcache_storage.cc index ea9673d..91630f7 100644 --- a/content/browser/appcache/mock_appcache_storage.cc +++ b/content/browser/appcache/mock_appcache_storage.cc @@ -9,11 +9,11 @@ #include "base/memory/ref_counted.h" #include "base/message_loop/message_loop.h" #include "base/stl_util.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_entry.h" -#include "webkit/browser/appcache/appcache_group.h" -#include "webkit/browser/appcache/appcache_response.h" -#include "webkit/browser/appcache/appcache_service_impl.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_entry.h" +#include "content/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_response.h" +#include "content/browser/appcache/appcache_service_impl.h" // This is a quick and easy 'mock' implementation of the storage interface // that doesn't put anything to disk. @@ -25,13 +25,6 @@ // happen with a real disk-backed storage impl that involves IO on a // background thread. -using appcache::AppCacheResponseWriter; -using appcache::AppCacheServiceImpl; -using appcache::APPCACHE_FALLBACK_NAMESPACE; -using appcache::APPCACHE_INTERCEPT_NAMESPACE; -using appcache::kAppCacheNoCacheId; -using appcache::AppCacheNamespaceType; - namespace content { MockAppCacheStorage::MockAppCacheStorage(AppCacheServiceImpl* service) diff --git a/content/browser/appcache/mock_appcache_storage.h b/content/browser/appcache/mock_appcache_storage.h index 5d31748..2c4f45583a 100644 --- a/content/browser/appcache/mock_appcache_storage.h +++ b/content/browser/appcache/mock_appcache_storage.h @@ -14,22 +14,11 @@ #include "base/gtest_prod_util.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_disk_cache.h" -#include "webkit/browser/appcache/appcache_group.h" -#include "webkit/browser/appcache/appcache_response.h" -#include "webkit/browser/appcache/appcache_storage.h" - -using appcache::AppCache; -using appcache::AppCacheDiskCache; -using appcache::AppCacheEntry; -using appcache::AppCacheGroup; -using appcache::AppCacheInfoCollection; -using appcache::AppCacheResponseReader; -using appcache::AppCacheResponseWriter; -using appcache::AppCacheServiceImpl; -using appcache::AppCacheStorage; -using appcache::kAppCacheNoCacheId; +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_disk_cache.h" +#include "content/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_response.h" +#include "content/browser/appcache/appcache_storage.h" namespace content { FORWARD_DECLARE_TEST(AppCacheServiceImplTest, DeleteAppCachesForOrigin); diff --git a/content/browser/appcache/mock_appcache_storage_unittest.cc b/content/browser/appcache/mock_appcache_storage_unittest.cc index f1c9149..c41fe53 100644 --- a/content/browser/appcache/mock_appcache_storage_unittest.cc +++ b/content/browser/appcache/mock_appcache_storage_unittest.cc @@ -3,24 +3,12 @@ // found in the LICENSE file. #include "base/run_loop.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_response.h" +#include "content/browser/appcache/appcache_storage.h" #include "content/browser/appcache/mock_appcache_service.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_group.h" -#include "webkit/browser/appcache/appcache_response.h" -#include "webkit/browser/appcache/appcache_storage.h" - -using appcache::AppCache; -using appcache::AppCacheEntry; -using appcache::AppCacheGroup; -using appcache::AppCacheStorage; -using appcache::APPCACHE_FALLBACK_NAMESPACE; -using appcache::APPCACHE_INTERCEPT_NAMESPACE; -using appcache::kAppCacheNoCacheId; -using appcache::kAppCacheNoResponseId; -using appcache::Manifest; -using appcache::Namespace; -using appcache::APPCACHE_NETWORK_NAMESPACE; namespace content { @@ -483,10 +471,10 @@ TEST_F(MockAppCacheStorageTest, BasicFindMainFallbackResponse) { Manifest manifest; manifest.fallback_namespaces.push_back( - Namespace(APPCACHE_FALLBACK_NAMESPACE, kFallbackNamespaceUrl1, + AppCacheNamespace(APPCACHE_FALLBACK_NAMESPACE, kFallbackNamespaceUrl1, kFallbackEntryUrl1, false)); manifest.fallback_namespaces.push_back( - Namespace(APPCACHE_FALLBACK_NAMESPACE, kFallbackNamespaceUrl2, + AppCacheNamespace(APPCACHE_FALLBACK_NAMESPACE, kFallbackNamespaceUrl2, kFallbackEntryUrl2, false)); scoped_refptr<AppCache> cache(new AppCache(service.storage(), kCacheId)); @@ -595,7 +583,7 @@ TEST_F(MockAppCacheStorageTest, FindMainResponseExclusions) { Manifest manifest; manifest.online_whitelist_namespaces.push_back( - Namespace(APPCACHE_NETWORK_NAMESPACE, kOnlineNamespaceUrl, + AppCacheNamespace(APPCACHE_NETWORK_NAMESPACE, kOnlineNamespaceUrl, GURL(), false)); scoped_refptr<AppCache> cache(new AppCache(service.storage(), kCacheId)); cache->InitializeWithManifest(&manifest); diff --git a/content/browser/appcache/view_appcache_internals_job.cc b/content/browser/appcache/view_appcache_internals_job.cc index 0cc64c3..3f8ac4f 100644 --- a/content/browser/appcache/view_appcache_internals_job.cc +++ b/content/browser/appcache/view_appcache_internals_job.cc @@ -17,6 +17,12 @@ #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_policy.h" +#include "content/browser/appcache/appcache_response.h" +#include "content/browser/appcache/appcache_service_impl.h" +#include "content/browser/appcache/appcache_storage.h" #include "net/base/escape.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" @@ -24,24 +30,6 @@ #include "net/url_request/url_request.h" #include "net/url_request/url_request_simple_job.h" #include "net/url_request/view_cache_helper.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_group.h" -#include "webkit/browser/appcache/appcache_policy.h" -#include "webkit/browser/appcache/appcache_response.h" -#include "webkit/browser/appcache/appcache_service_impl.h" -#include "webkit/browser/appcache/appcache_storage.h" - -using appcache::AppCacheGroup; -using appcache::AppCacheInfo; -using appcache::AppCacheInfoCollection; -using appcache::AppCacheInfoVector; -using appcache::AppCacheServiceImpl; -using appcache::AppCacheStorage; -using appcache::AppCacheStorageReference; -using appcache::AppCacheResourceInfo; -using appcache::AppCacheResourceInfoVector; -using appcache::AppCacheResponseInfo; -using appcache::AppCacheResponseReader; namespace content { namespace { diff --git a/content/browser/appcache/view_appcache_internals_job.h b/content/browser/appcache/view_appcache_internals_job.h index f11b68e..7fb2ea99 100644 --- a/content/browser/appcache/view_appcache_internals_job.h +++ b/content/browser/appcache/view_appcache_internals_job.h @@ -13,7 +13,7 @@ class URLRequest; class URLRequestJob; } -namespace appcache { +namespace content { class AppCacheServiceImpl; } @@ -24,12 +24,12 @@ class ViewAppCacheInternalsJobFactory { static net::URLRequestJob* CreateJobForRequest( net::URLRequest* request, net::NetworkDelegate* network_delegate, - appcache::AppCacheServiceImpl* service); + AppCacheServiceImpl* service); private: DISALLOW_IMPLICIT_CONSTRUCTORS(ViewAppCacheInternalsJobFactory); }; -} // namespace appcache +} // namespace content #endif // CONTENT_BROWSER_APPCACHE_VIEW_APPCACHE_INTERNALS_JOB_H_ diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc index dbc5949..1562386 100644 --- a/content/browser/browser_context.cc +++ b/content/browser/browser_context.cc @@ -69,7 +69,7 @@ StoragePartition* GetStoragePartitionFromConfig( void SaveSessionStateOnIOThread( const scoped_refptr<net::URLRequestContextGetter>& context_getter, - appcache::AppCacheServiceImpl* appcache_service) { + AppCacheServiceImpl* appcache_service) { net::URLRequestContext* context = context_getter->GetURLRequestContext(); context->cookie_store()->GetCookieMonster()-> SetForceKeepSessionState(); @@ -236,7 +236,7 @@ void BrowserContext::SaveSessionState(BrowserContext* browser_context) { base::Bind( &SaveSessionStateOnIOThread, make_scoped_refptr(browser_context->GetRequestContext()), - static_cast<appcache::AppCacheServiceImpl*>( + static_cast<AppCacheServiceImpl*>( storage_partition->GetAppCacheService()))); } diff --git a/content/browser/cross_site_transfer_browsertest.cc b/content/browser/cross_site_transfer_browsertest.cc index fff180d..9d2d1cc 100644 --- a/content/browser/cross_site_transfer_browsertest.cc +++ b/content/browser/cross_site_transfer_browsertest.cc @@ -36,7 +36,7 @@ class TrackingResourceDispatcherHostDelegate virtual void RequestBeginning( net::URLRequest* request, ResourceContext* resource_context, - appcache::AppCacheService* appcache_service, + AppCacheService* appcache_service, ResourceType::Type resource_type, int child_id, int route_id, diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc index d342ec3..561b215 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc @@ -54,6 +54,7 @@ #include "content/browser/streams/stream_registry.h" #include "content/browser/worker_host/worker_service_impl.h" #include "content/browser/web_contents/web_contents_impl.h" +#include "content/common/appcache_interfaces.h" #include "content/common/resource_messages.h" #include "content/common/resource_request_body.h" #include "content/common/ssl_status_serialization.h" @@ -94,7 +95,6 @@ #include "webkit/browser/blob/blob_url_request_job_factory.h" #include "webkit/browser/fileapi/file_permission_policy.h" #include "webkit/browser/fileapi/file_system_context.h" -#include "webkit/common/appcache/appcache_interfaces.h" #include "webkit/common/blob/shareable_file_reference.h" using base::Time; diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc index a815032..18f9c30 100644 --- a/content/browser/loader/resource_dispatcher_host_unittest.cc +++ b/content/browser/loader/resource_dispatcher_host_unittest.cc @@ -24,6 +24,7 @@ #include "content/browser/loader/resource_message_filter.h" #include "content/browser/loader/resource_request_info_impl.h" #include "content/browser/worker_host/worker_service_impl.h" +#include "content/common/appcache_interfaces.h" #include "content/common/child_process_host_impl.h" #include "content/common/resource_messages.h" #include "content/common/view_messages.h" @@ -50,7 +51,6 @@ #include "net/url_request/url_request_test_job.h" #include "net/url_request/url_request_test_util.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/common/appcache/appcache_interfaces.h" #include "webkit/common/blob/shareable_file_reference.h" // TODO(eroman): Write unit tests for SafeBrowsing that exercise @@ -139,7 +139,7 @@ static ResourceHostMsg_Request CreateResourceRequest( request.origin_pid = 0; request.resource_type = type; request.request_context = 0; - request.appcache_host_id = appcache::kAppCacheNoHostId; + request.appcache_host_id = kAppCacheNoHostId; request.download_to_file = false; request.is_main_frame = true; request.parent_is_main_frame = false; @@ -662,7 +662,7 @@ class TestResourceDispatcherHostDelegate virtual void RequestBeginning( net::URLRequest* request, ResourceContext* resource_context, - appcache::AppCacheService* appcache_service, + AppCacheService* appcache_service, ResourceType::Type resource_type, int child_id, int route_id, diff --git a/content/browser/quota/mock_quota_manager_unittest.cc b/content/browser/quota/mock_quota_manager_unittest.cc index e1885c4..c62cf6b 100644 --- a/content/browser/quota/mock_quota_manager_unittest.cc +++ b/content/browser/quota/mock_quota_manager_unittest.cc @@ -223,4 +223,4 @@ TEST_F(MockQuotaManagerTest, ModifiedOrigins) { EXPECT_EQ(0UL, origins().count(kOrigin1)); EXPECT_EQ(1UL, origins().count(kOrigin2)); } -} // Namespace content +} // AppCacheNamespace content diff --git a/content/browser/service_worker/service_worker_disk_cache.cc b/content/browser/service_worker/service_worker_disk_cache.cc index a8ca52a..d31f00c 100644 --- a/content/browser/service_worker/service_worker_disk_cache.cc +++ b/content/browser/service_worker/service_worker_disk_cache.cc @@ -8,15 +8,12 @@ namespace content { ServiceWorkerResponseReader::ServiceWorkerResponseReader( int64 response_id, ServiceWorkerDiskCache* disk_cache) - : appcache::AppCacheResponseReader(response_id, 0, disk_cache) { + : AppCacheResponseReader(response_id, 0, disk_cache) { } ServiceWorkerResponseWriter::ServiceWorkerResponseWriter( int64 response_id, ServiceWorkerDiskCache* disk_cache) - : appcache::AppCacheResponseWriter(response_id, 0, disk_cache) { -} - -HttpResponseInfoIOBuffer::~HttpResponseInfoIOBuffer() { + : AppCacheResponseWriter(response_id, 0, disk_cache) { } } // namespace content diff --git a/content/browser/service_worker/service_worker_disk_cache.h b/content/browser/service_worker/service_worker_disk_cache.h index 8385012..7fa51ee 100644 --- a/content/browser/service_worker/service_worker_disk_cache.h +++ b/content/browser/service_worker/service_worker_disk_cache.h @@ -5,8 +5,8 @@ #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISK_CACHE_H_ #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISK_CACHE_H_ +#include "content/browser/appcache/appcache_disk_cache.h" #include "content/common/content_export.h" -#include "webkit/browser/appcache/appcache_disk_cache.h" namespace content { @@ -17,11 +17,11 @@ namespace content { // resused classes to a more common location. class CONTENT_EXPORT ServiceWorkerDiskCache - : public appcache::AppCacheDiskCache { + : public AppCacheDiskCache { }; class CONTENT_EXPORT ServiceWorkerResponseReader - : public appcache::AppCacheResponseReader { + : public AppCacheResponseReader { protected: // Should only be constructed by the storage class. friend class ServiceWorkerStorage; @@ -31,7 +31,7 @@ class CONTENT_EXPORT ServiceWorkerResponseReader }; class CONTENT_EXPORT ServiceWorkerResponseWriter - : public appcache::AppCacheResponseWriter { + : public AppCacheResponseWriter { protected: // Should only be constructed by the storage class. friend class ServiceWorkerStorage; @@ -40,16 +40,6 @@ class CONTENT_EXPORT ServiceWorkerResponseWriter ServiceWorkerDiskCache* disk_cache); }; -struct CONTENT_EXPORT HttpResponseInfoIOBuffer - : public appcache::HttpResponseInfoIOBuffer { - public: - HttpResponseInfoIOBuffer() : appcache::HttpResponseInfoIOBuffer() {} - explicit HttpResponseInfoIOBuffer(net::HttpResponseInfo* info) - : appcache::HttpResponseInfoIOBuffer(info) {} - protected: - virtual ~HttpResponseInfoIOBuffer(); -}; - } // namespace content #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISK_CACHE_H_ diff --git a/content/browser/service_worker/service_worker_request_handler.cc b/content/browser/service_worker/service_worker_request_handler.cc index e3c5ae1..504a7a0d 100644 --- a/content/browser/service_worker/service_worker_request_handler.cc +++ b/content/browser/service_worker/service_worker_request_handler.cc @@ -40,13 +40,13 @@ class ServiceWorkerRequestInterceptor DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestInterceptor); }; -bool IsMethodSupported(const std::string& method) { +bool IsMethodSupportedForAppCache(const std::string& method) { return (method == "GET") || (method == "HEAD"); } -bool IsSchemeAndMethodSupported(const net::URLRequest* request) { +bool IsSchemeAndMethodSupportedForAppCache(const net::URLRequest* request) { return request->url().SchemeIsHTTPOrHTTPS() && - IsMethodSupported(request->method()); + IsMethodSupportedForAppCache(request->method()); } } // namespace @@ -58,7 +58,7 @@ void ServiceWorkerRequestHandler::InitializeHandler( int process_id, int provider_id, ResourceType::Type resource_type) { - if (!IsSchemeAndMethodSupported(request)) { + if (!IsSchemeAndMethodSupportedForAppCache(request)) { return; } diff --git a/content/browser/storage_partition_impl_map.cc b/content/browser/storage_partition_impl_map.cc index fdfb34e..d1d2a55 100644 --- a/content/browser/storage_partition_impl_map.cc +++ b/content/browser/storage_partition_impl_map.cc @@ -40,7 +40,6 @@ #include "webkit/browser/fileapi/file_system_url_request_job_factory.h" #include "webkit/common/blob/blob_data.h" -using appcache::AppCacheServiceImpl; using fileapi::FileSystemContext; using webkit_blob::BlobStorageContext; diff --git a/content/browser/transition_browsertest.cc b/content/browser/transition_browsertest.cc index 5a6ae9e..79a12a5 100644 --- a/content/browser/transition_browsertest.cc +++ b/content/browser/transition_browsertest.cc @@ -41,7 +41,7 @@ class TransitionBrowserTestObserver virtual void RequestBeginning( net::URLRequest* request, ResourceContext* resource_context, - appcache::AppCacheService* appcache_service, + content::AppCacheService* appcache_service, ResourceType::Type resource_type, int child_id, int route_id, diff --git a/content/browser/webui/url_data_manager_backend.cc b/content/browser/webui/url_data_manager_backend.cc index 9f661af..369a4e6 100644 --- a/content/browser/webui/url_data_manager_backend.cc +++ b/content/browser/webui/url_data_manager_backend.cc @@ -44,8 +44,6 @@ #include "net/url_request/url_request_job_factory.h" #include "url/url_util.h" -using appcache::AppCacheServiceImpl; - namespace content { namespace { diff --git a/content/browser/webui/url_data_manager_backend.h b/content/browser/webui/url_data_manager_backend.h index a307cdb..03b3d72 100644 --- a/content/browser/webui/url_data_manager_backend.h +++ b/content/browser/webui/url_data_manager_backend.h @@ -18,7 +18,7 @@ class GURL; -namespace appcache { +namespace content { class AppCacheServiceImpl; } @@ -48,7 +48,7 @@ class URLDataManagerBackend : public base::SupportsUserData::Data { static net::URLRequestJobFactory::ProtocolHandler* CreateProtocolHandler( content::ResourceContext* resource_context, bool is_incognito, - appcache::AppCacheServiceImpl* appcache_service, + AppCacheServiceImpl* appcache_service, ChromeBlobStorageContext* blob_storage_context); // Adds a DataSource to the collection of data sources. diff --git a/content/child/appcache/appcache_backend_proxy.cc b/content/child/appcache/appcache_backend_proxy.cc index e1d96d6..bf31494 100644 --- a/content/child/appcache/appcache_backend_proxy.cc +++ b/content/child/appcache/appcache_backend_proxy.cc @@ -54,8 +54,8 @@ void AppCacheBackendProxy::MarkAsForeignEntry( cache_document_was_loaded_from)); } -appcache::AppCacheStatus AppCacheBackendProxy::GetStatus(int host_id) { - appcache::AppCacheStatus status = appcache::APPCACHE_STATUS_UNCACHED; +AppCacheStatus AppCacheBackendProxy::GetStatus(int host_id) { + AppCacheStatus status = APPCACHE_STATUS_UNCACHED; sender_->Send(new AppCacheHostMsg_GetStatus(host_id, &status)); return status; } @@ -73,7 +73,7 @@ bool AppCacheBackendProxy::SwapCache(int host_id) { } void AppCacheBackendProxy::GetResourceList( - int host_id, std::vector<appcache::AppCacheResourceInfo>* resource_infos) { + int host_id, std::vector<AppCacheResourceInfo>* resource_infos) { sender_->Send(new AppCacheHostMsg_GetResourceList(host_id, resource_infos)); } diff --git a/content/child/appcache/appcache_backend_proxy.h b/content/child/appcache/appcache_backend_proxy.h index 389f08c..98eed36 100644 --- a/content/child/appcache/appcache_backend_proxy.h +++ b/content/child/appcache/appcache_backend_proxy.h @@ -7,13 +7,13 @@ #include <vector> +#include "content/common/appcache_interfaces.h" #include "ipc/ipc_sender.h" -#include "webkit/common/appcache/appcache_interfaces.h" namespace content { // Sends appcache related messages to the main process. -class AppCacheBackendProxy : public appcache::AppCacheBackend { +class AppCacheBackendProxy : public AppCacheBackend { public: explicit AppCacheBackendProxy(IPC::Sender* sender) : sender_(sender) {} @@ -38,12 +38,12 @@ class AppCacheBackendProxy : public appcache::AppCacheBackend { int host_id, const GURL& document_url, int64 cache_document_was_loaded_from) OVERRIDE; - virtual appcache::AppCacheStatus GetStatus(int host_id) OVERRIDE; + virtual AppCacheStatus GetStatus(int host_id) OVERRIDE; virtual bool StartUpdate(int host_id) OVERRIDE; virtual bool SwapCache(int host_id) OVERRIDE; virtual void GetResourceList( int host_id, - std::vector<appcache::AppCacheResourceInfo>* resource_infos) OVERRIDE; + std::vector<AppCacheResourceInfo>* resource_infos) OVERRIDE; private: IPC::Sender* sender_; diff --git a/content/child/appcache/appcache_dispatcher.cc b/content/child/appcache/appcache_dispatcher.cc index 11e5b9d..02986b1 100644 --- a/content/child/appcache/appcache_dispatcher.cc +++ b/content/child/appcache/appcache_dispatcher.cc @@ -10,7 +10,7 @@ namespace content { AppCacheDispatcher::AppCacheDispatcher( IPC::Sender* sender, - appcache::AppCacheFrontend* frontend) + AppCacheFrontend* frontend) : backend_proxy_(sender), frontend_(frontend) {} @@ -32,17 +32,17 @@ bool AppCacheDispatcher::OnMessageReceived(const IPC::Message& msg) { } void AppCacheDispatcher::OnCacheSelected( - int host_id, const appcache::AppCacheInfo& info) { + int host_id, const AppCacheInfo& info) { frontend_->OnCacheSelected(host_id, info); } void AppCacheDispatcher::OnStatusChanged(const std::vector<int>& host_ids, - appcache::AppCacheStatus status) { + AppCacheStatus status) { frontend_->OnStatusChanged(host_ids, status); } void AppCacheDispatcher::OnEventRaised(const std::vector<int>& host_ids, - appcache::AppCacheEventID event_id) { + AppCacheEventID event_id) { frontend_->OnEventRaised(host_ids, event_id); } @@ -54,14 +54,14 @@ void AppCacheDispatcher::OnProgressEventRaised( void AppCacheDispatcher::OnErrorEventRaised( const std::vector<int>& host_ids, - const appcache::AppCacheErrorDetails& details) { + const AppCacheErrorDetails& details) { frontend_->OnErrorEventRaised(host_ids, details); } void AppCacheDispatcher::OnLogMessage( int host_id, int log_level, const std::string& message) { frontend_->OnLogMessage( - host_id, static_cast<appcache::AppCacheLogLevel>(log_level), message); + host_id, static_cast<AppCacheLogLevel>(log_level), message); } void AppCacheDispatcher::OnContentBlocked(int host_id, diff --git a/content/child/appcache/appcache_dispatcher.h b/content/child/appcache/appcache_dispatcher.h index 6b62727..82f4711 100644 --- a/content/child/appcache/appcache_dispatcher.h +++ b/content/child/appcache/appcache_dispatcher.h @@ -10,8 +10,8 @@ #include "base/memory/scoped_ptr.h" #include "content/child/appcache/appcache_backend_proxy.h" +#include "content/common/appcache_interfaces.h" #include "ipc/ipc_listener.h" -#include "webkit/common/appcache/appcache_interfaces.h" namespace content { @@ -22,7 +22,7 @@ namespace content { class AppCacheDispatcher : public IPC::Listener { public: AppCacheDispatcher(IPC::Sender* sender, - appcache::AppCacheFrontend* frontend); + AppCacheFrontend* frontend); virtual ~AppCacheDispatcher(); AppCacheBackendProxy* backend_proxy() { return &backend_proxy_; } @@ -32,20 +32,20 @@ class AppCacheDispatcher : public IPC::Listener { private: // Ipc message handlers - void OnCacheSelected(int host_id, const appcache::AppCacheInfo& info); + void OnCacheSelected(int host_id, const AppCacheInfo& info); void OnStatusChanged(const std::vector<int>& host_ids, - appcache::AppCacheStatus status); + AppCacheStatus status); void OnEventRaised(const std::vector<int>& host_ids, - appcache::AppCacheEventID event_id); + AppCacheEventID event_id); void OnProgressEventRaised(const std::vector<int>& host_ids, const GURL& url, int num_total, int num_complete); void OnErrorEventRaised(const std::vector<int>& host_ids, - const appcache::AppCacheErrorDetails& details); + const AppCacheErrorDetails& details); void OnLogMessage(int host_id, int log_level, const std::string& message); void OnContentBlocked(int host_id, const GURL& manifest_url); AppCacheBackendProxy backend_proxy_; - scoped_ptr<appcache::AppCacheFrontend> frontend_; + scoped_ptr<AppCacheFrontend> frontend_; }; } // namespace content diff --git a/content/child/appcache/appcache_frontend_impl.cc b/content/child/appcache/appcache_frontend_impl.cc index 1a33e0d..8ede37a 100644 --- a/content/child/appcache/appcache_frontend_impl.cc +++ b/content/child/appcache/appcache_frontend_impl.cc @@ -19,14 +19,14 @@ inline WebApplicationCacheHostImpl* GetHost(int id) { } void AppCacheFrontendImpl::OnCacheSelected(int host_id, - const appcache::AppCacheInfo& info) { + const AppCacheInfo& info) { WebApplicationCacheHostImpl* host = GetHost(host_id); if (host) host->OnCacheSelected(info); } void AppCacheFrontendImpl::OnStatusChanged(const std::vector<int>& host_ids, - appcache::AppCacheStatus status) { + AppCacheStatus status) { for (std::vector<int>::const_iterator i = host_ids.begin(); i != host_ids.end(); ++i) { WebApplicationCacheHostImpl* host = GetHost(*i); @@ -36,10 +36,10 @@ void AppCacheFrontendImpl::OnStatusChanged(const std::vector<int>& host_ids, } void AppCacheFrontendImpl::OnEventRaised(const std::vector<int>& host_ids, - appcache::AppCacheEventID event_id) { + AppCacheEventID event_id) { DCHECK(event_id != - appcache::APPCACHE_PROGRESS_EVENT); // See OnProgressEventRaised. - DCHECK(event_id != appcache::APPCACHE_ERROR_EVENT); // See OnErrorEventRaised. + APPCACHE_PROGRESS_EVENT); // See OnProgressEventRaised. + DCHECK(event_id != APPCACHE_ERROR_EVENT); // See OnErrorEventRaised. for (std::vector<int>::const_iterator i = host_ids.begin(); i != host_ids.end(); ++i) { WebApplicationCacheHostImpl* host = GetHost(*i); @@ -63,7 +63,7 @@ void AppCacheFrontendImpl::OnProgressEventRaised( void AppCacheFrontendImpl::OnErrorEventRaised( const std::vector<int>& host_ids, - const appcache::AppCacheErrorDetails& details) { + const AppCacheErrorDetails& details) { for (std::vector<int>::const_iterator i = host_ids.begin(); i != host_ids.end(); ++i) { WebApplicationCacheHostImpl* host = GetHost(*i); @@ -73,7 +73,7 @@ void AppCacheFrontendImpl::OnErrorEventRaised( } void AppCacheFrontendImpl::OnLogMessage(int host_id, - appcache::AppCacheLogLevel log_level, + AppCacheLogLevel log_level, const std::string& message) { WebApplicationCacheHostImpl* host = GetHost(host_id); if (host) @@ -90,67 +90,67 @@ void AppCacheFrontendImpl::OnContentBlocked(int host_id, // Ensure that enum values never get out of sync with the // ones declared for use within the WebKit api COMPILE_ASSERT((int)WebApplicationCacheHost::Uncached == - (int)appcache::APPCACHE_STATUS_UNCACHED, Uncached); + (int)APPCACHE_STATUS_UNCACHED, Uncached); COMPILE_ASSERT((int)WebApplicationCacheHost::Idle == - (int)appcache::APPCACHE_STATUS_IDLE, Idle); + (int)APPCACHE_STATUS_IDLE, Idle); COMPILE_ASSERT((int)WebApplicationCacheHost::Checking == - (int)appcache::APPCACHE_STATUS_CHECKING, Checking); + (int)APPCACHE_STATUS_CHECKING, Checking); COMPILE_ASSERT((int)WebApplicationCacheHost::Downloading == - (int)appcache::APPCACHE_STATUS_DOWNLOADING, Downloading); + (int)APPCACHE_STATUS_DOWNLOADING, Downloading); COMPILE_ASSERT((int)WebApplicationCacheHost::UpdateReady == - (int)appcache::APPCACHE_STATUS_UPDATE_READY, UpdateReady); + (int)APPCACHE_STATUS_UPDATE_READY, UpdateReady); COMPILE_ASSERT((int)WebApplicationCacheHost::Obsolete == - (int)appcache::APPCACHE_STATUS_OBSOLETE, Obsolete); + (int)APPCACHE_STATUS_OBSOLETE, Obsolete); COMPILE_ASSERT((int)WebApplicationCacheHost::CheckingEvent == - (int)appcache::APPCACHE_CHECKING_EVENT, CheckingEvent); + (int)APPCACHE_CHECKING_EVENT, CheckingEvent); COMPILE_ASSERT((int)WebApplicationCacheHost::ErrorEvent == - (int)appcache::APPCACHE_ERROR_EVENT, ErrorEvent); + (int)APPCACHE_ERROR_EVENT, ErrorEvent); COMPILE_ASSERT((int)WebApplicationCacheHost::NoUpdateEvent == - (int)appcache::APPCACHE_NO_UPDATE_EVENT, NoUpdateEvent); + (int)APPCACHE_NO_UPDATE_EVENT, NoUpdateEvent); COMPILE_ASSERT((int)WebApplicationCacheHost::DownloadingEvent == - (int)appcache::APPCACHE_DOWNLOADING_EVENT, DownloadingEvent); + (int)APPCACHE_DOWNLOADING_EVENT, DownloadingEvent); COMPILE_ASSERT((int)WebApplicationCacheHost::ProgressEvent == - (int)appcache::APPCACHE_PROGRESS_EVENT, ProgressEvent); + (int)APPCACHE_PROGRESS_EVENT, ProgressEvent); COMPILE_ASSERT((int)WebApplicationCacheHost::UpdateReadyEvent == - (int)appcache::APPCACHE_UPDATE_READY_EVENT, UpdateReadyEvent); + (int)APPCACHE_UPDATE_READY_EVENT, UpdateReadyEvent); COMPILE_ASSERT((int)WebApplicationCacheHost::CachedEvent == - (int)appcache::APPCACHE_CACHED_EVENT, CachedEvent); + (int)APPCACHE_CACHED_EVENT, CachedEvent); COMPILE_ASSERT((int)WebApplicationCacheHost::ObsoleteEvent == - (int)appcache::APPCACHE_OBSOLETE_EVENT, ObsoleteEvent); + (int)APPCACHE_OBSOLETE_EVENT, ObsoleteEvent); COMPILE_ASSERT((int)WebConsoleMessage::LevelDebug == - (int)appcache::APPCACHE_LOG_DEBUG, LevelDebug); + (int)APPCACHE_LOG_DEBUG, LevelDebug); COMPILE_ASSERT((int)WebConsoleMessage::LevelLog == - (int)appcache::APPCACHE_LOG_INFO, LevelLog); + (int)APPCACHE_LOG_INFO, LevelLog); COMPILE_ASSERT((int)WebConsoleMessage::LevelWarning == - (int)appcache::APPCACHE_LOG_WARNING, LevelWarning); + (int)APPCACHE_LOG_WARNING, LevelWarning); COMPILE_ASSERT((int)WebConsoleMessage::LevelError == - (int)appcache::APPCACHE_LOG_ERROR, LevelError); + (int)APPCACHE_LOG_ERROR, LevelError); COMPILE_ASSERT((int)WebApplicationCacheHost::ManifestError == - (int)appcache::APPCACHE_MANIFEST_ERROR, + (int)APPCACHE_MANIFEST_ERROR, ManifestError); COMPILE_ASSERT((int)WebApplicationCacheHost::SignatureError == - (int)appcache::APPCACHE_SIGNATURE_ERROR, + (int)APPCACHE_SIGNATURE_ERROR, SignatureError); COMPILE_ASSERT((int)WebApplicationCacheHost::ResourceError == - (int)appcache::APPCACHE_RESOURCE_ERROR, + (int)APPCACHE_RESOURCE_ERROR, ResourceError); COMPILE_ASSERT((int)WebApplicationCacheHost::ChangedError == - (int)appcache::APPCACHE_CHANGED_ERROR, + (int)APPCACHE_CHANGED_ERROR, ChangedError); COMPILE_ASSERT((int)WebApplicationCacheHost::AbortError == - (int)appcache::APPCACHE_ABORT_ERROR, + (int)APPCACHE_ABORT_ERROR, AbortError); COMPILE_ASSERT((int)WebApplicationCacheHost::QuotaError == - (int)appcache::APPCACHE_QUOTA_ERROR, + (int)APPCACHE_QUOTA_ERROR, QuotaError); COMPILE_ASSERT((int)WebApplicationCacheHost::PolicyError == - (int)appcache::APPCACHE_POLICY_ERROR, + (int)APPCACHE_POLICY_ERROR, PolicyError); COMPILE_ASSERT((int)WebApplicationCacheHost::UnknownError == - (int)appcache::APPCACHE_UNKNOWN_ERROR, + (int)APPCACHE_UNKNOWN_ERROR, UnknownError); } // namespace content diff --git a/content/child/appcache/appcache_frontend_impl.h b/content/child/appcache/appcache_frontend_impl.h index 90ac4fe..161f661 100644 --- a/content/child/appcache/appcache_frontend_impl.h +++ b/content/child/appcache/appcache_frontend_impl.h @@ -5,27 +5,27 @@ #ifndef CONTENT_CHILD_APPCACHE_APPCACHE_FRONTEND_IMPL_H_ #define CONTENT_CHILD_APPCACHE_APPCACHE_FRONTEND_IMPL_H_ -#include "webkit/common/appcache/appcache_interfaces.h" +#include "content/common/appcache_interfaces.h" namespace content { -class AppCacheFrontendImpl : public appcache::AppCacheFrontend { +class AppCacheFrontendImpl : public AppCacheFrontend { public: virtual void OnCacheSelected(int host_id, - const appcache::AppCacheInfo& info) OVERRIDE; + const AppCacheInfo& info) OVERRIDE; virtual void OnStatusChanged(const std::vector<int>& host_ids, - appcache::AppCacheStatus status) OVERRIDE; + AppCacheStatus status) OVERRIDE; virtual void OnEventRaised(const std::vector<int>& host_ids, - appcache::AppCacheEventID event_id) OVERRIDE; + AppCacheEventID event_id) OVERRIDE; virtual void OnProgressEventRaised(const std::vector<int>& host_ids, const GURL& url, int num_total, int num_complete) OVERRIDE; virtual void OnErrorEventRaised(const std::vector<int>& host_ids, - const appcache::AppCacheErrorDetails& details) + const AppCacheErrorDetails& details) OVERRIDE; virtual void OnLogMessage(int host_id, - appcache::AppCacheLogLevel log_level, + AppCacheLogLevel log_level, const std::string& message) OVERRIDE; virtual void OnContentBlocked(int host_id, const GURL& manifest_url) OVERRIDE; }; diff --git a/content/child/appcache/web_application_cache_host_impl.cc b/content/child/appcache/web_application_cache_host_impl.cc index 427262e..321f467 100644 --- a/content/child/appcache/web_application_cache_host_impl.cc +++ b/content/child/appcache/web_application_cache_host_impl.cc @@ -20,8 +20,6 @@ using blink::WebURLRequest; using blink::WebURL; using blink::WebURLResponse; using blink::WebVector; -using appcache::AppCacheBackend; -using appcache::AppCacheResourceInfo; namespace content { @@ -61,12 +59,12 @@ WebApplicationCacheHostImpl::WebApplicationCacheHostImpl( : client_(client), backend_(backend), host_id_(all_hosts()->Add(this)), - status_(appcache::APPCACHE_STATUS_UNCACHED), + status_(APPCACHE_STATUS_UNCACHED), is_scheme_supported_(false), is_get_method_(false), is_new_master_entry_(MAYBE), was_select_cache_called_(false) { - DCHECK(client && backend && (host_id_ != appcache::kAppCacheNoHostId)); + DCHECK(client && backend && (host_id_ != kAppCacheNoHostId)); backend_->RegisterHost(host_id_); } @@ -77,45 +75,45 @@ WebApplicationCacheHostImpl::~WebApplicationCacheHostImpl() { } void WebApplicationCacheHostImpl::OnCacheSelected( - const appcache::AppCacheInfo& info) { + const AppCacheInfo& info) { cache_info_ = info; client_->didChangeCacheAssociation(); } void WebApplicationCacheHostImpl::OnStatusChanged( - appcache::AppCacheStatus status) { + AppCacheStatus status) { // TODO(michaeln): delete me, not used } void WebApplicationCacheHostImpl::OnEventRaised( - appcache::AppCacheEventID event_id) { + AppCacheEventID event_id) { DCHECK(event_id != - appcache::APPCACHE_PROGRESS_EVENT); // See OnProgressEventRaised. - DCHECK(event_id != appcache::APPCACHE_ERROR_EVENT); // See OnErrorEventRaised. + APPCACHE_PROGRESS_EVENT); // See OnProgressEventRaised. + DCHECK(event_id != APPCACHE_ERROR_EVENT); // See OnErrorEventRaised. // Emit logging output prior to calling out to script as we can get // deleted within the script event handler. const char* kFormatString = "Application Cache %s event"; std::string message = base::StringPrintf(kFormatString, kEventNames[event_id]); - OnLogMessage(appcache::APPCACHE_LOG_INFO, message); + OnLogMessage(APPCACHE_LOG_INFO, message); switch (event_id) { - case appcache::APPCACHE_CHECKING_EVENT: - status_ = appcache::APPCACHE_STATUS_CHECKING; + case APPCACHE_CHECKING_EVENT: + status_ = APPCACHE_STATUS_CHECKING; break; - case appcache::APPCACHE_DOWNLOADING_EVENT: - status_ = appcache::APPCACHE_STATUS_DOWNLOADING; + case APPCACHE_DOWNLOADING_EVENT: + status_ = APPCACHE_STATUS_DOWNLOADING; break; - case appcache::APPCACHE_UPDATE_READY_EVENT: - status_ = appcache::APPCACHE_STATUS_UPDATE_READY; + case APPCACHE_UPDATE_READY_EVENT: + status_ = APPCACHE_STATUS_UPDATE_READY; break; - case appcache::APPCACHE_CACHED_EVENT: - case appcache::APPCACHE_NO_UPDATE_EVENT: - status_ = appcache::APPCACHE_STATUS_IDLE; + case APPCACHE_CACHED_EVENT: + case APPCACHE_NO_UPDATE_EVENT: + status_ = APPCACHE_STATUS_IDLE; break; - case appcache::APPCACHE_OBSOLETE_EVENT: - status_ = appcache::APPCACHE_STATUS_OBSOLETE; + case APPCACHE_OBSOLETE_EVENT: + status_ = APPCACHE_STATUS_OBSOLETE; break; default: NOTREACHED(); @@ -132,25 +130,25 @@ void WebApplicationCacheHostImpl::OnProgressEventRaised( const char* kFormatString = "Application Cache Progress event (%d of %d) %s"; std::string message = base::StringPrintf(kFormatString, num_complete, num_total, url.spec().c_str()); - OnLogMessage(appcache::APPCACHE_LOG_INFO, message); - status_ = appcache::APPCACHE_STATUS_DOWNLOADING; + OnLogMessage(APPCACHE_LOG_INFO, message); + status_ = APPCACHE_STATUS_DOWNLOADING; client_->notifyProgressEventListener(url, num_total, num_complete); } void WebApplicationCacheHostImpl::OnErrorEventRaised( - const appcache::AppCacheErrorDetails& details) { + const AppCacheErrorDetails& details) { // Emit logging output prior to calling out to script as we can get // deleted within the script event handler. const char* kFormatString = "Application Cache Error event: %s"; std::string full_message = base::StringPrintf(kFormatString, details.message.c_str()); - OnLogMessage(appcache::APPCACHE_LOG_ERROR, full_message); + OnLogMessage(APPCACHE_LOG_ERROR, full_message); - status_ = cache_info_.is_complete ? appcache::APPCACHE_STATUS_IDLE : - appcache::APPCACHE_STATUS_UNCACHED; + status_ = cache_info_.is_complete ? APPCACHE_STATUS_IDLE : + APPCACHE_STATUS_UNCACHED; if (details.is_cross_origin) { // Don't leak detailed information to script for cross-origin resources. - DCHECK_EQ(appcache::APPCACHE_RESOURCE_ERROR, details.reason); + DCHECK_EQ(APPCACHE_RESOURCE_ERROR, details.reason); client_->notifyErrorEventListener( static_cast<ErrorReason>(details.reason), details.url, 0, WebString()); } else { @@ -168,13 +166,13 @@ void WebApplicationCacheHostImpl::willStartMainResourceRequest( original_main_resource_url_ = ClearUrlRef(request.url()); std::string method = request.httpMethod().utf8(); - is_get_method_ = (method == appcache::kHttpGETMethod); + is_get_method_ = (method == kHttpGETMethod); DCHECK(method == StringToUpperASCII(method)); const WebApplicationCacheHostImpl* spawning_host_impl = static_cast<const WebApplicationCacheHostImpl*>(spawning_host); if (spawning_host_impl && (spawning_host_impl != this) && - (spawning_host_impl->status_ != appcache::APPCACHE_STATUS_UNCACHED)) { + (spawning_host_impl->status_ != APPCACHE_STATUS_UNCACHED)) { backend_->SetSpawningHostId(host_id_, spawning_host_impl->host_id()); } } @@ -189,8 +187,8 @@ void WebApplicationCacheHostImpl::selectCacheWithoutManifest() { return; was_select_cache_called_ = true; - status_ = (document_response_.appCacheID() == appcache::kAppCacheNoCacheId) ? - appcache::APPCACHE_STATUS_UNCACHED : appcache::APPCACHE_STATUS_CHECKING; + status_ = (document_response_.appCacheID() == kAppCacheNoCacheId) ? + APPCACHE_STATUS_UNCACHED : APPCACHE_STATUS_CHECKING; is_new_master_entry_ = NO; backend_->SelectCache(host_id_, document_url_, document_response_.appCacheID(), @@ -207,18 +205,18 @@ bool WebApplicationCacheHostImpl::selectCacheWithManifest( // 6.9.6 The application cache selection algorithm // Check for new 'master' entries. - if (document_response_.appCacheID() == appcache::kAppCacheNoCacheId) { + if (document_response_.appCacheID() == kAppCacheNoCacheId) { if (is_scheme_supported_ && is_get_method_ && (manifest_gurl.GetOrigin() == document_url_.GetOrigin())) { - status_ = appcache::APPCACHE_STATUS_CHECKING; + status_ = APPCACHE_STATUS_CHECKING; is_new_master_entry_ = YES; } else { - status_ = appcache::APPCACHE_STATUS_UNCACHED; + status_ = APPCACHE_STATUS_UNCACHED; is_new_master_entry_ = NO; manifest_gurl = GURL(); } backend_->SelectCache( - host_id_, document_url_, appcache::kAppCacheNoCacheId, manifest_gurl); + host_id_, document_url_, kAppCacheNoCacheId, manifest_gurl); return true; } @@ -230,11 +228,11 @@ bool WebApplicationCacheHostImpl::selectCacheWithManifest( if (document_manifest_gurl != manifest_gurl) { backend_->MarkAsForeignEntry(host_id_, document_url_, document_response_.appCacheID()); - status_ = appcache::APPCACHE_STATUS_UNCACHED; + status_ = APPCACHE_STATUS_UNCACHED; return false; // the navigation will be restarted } - status_ = appcache::APPCACHE_STATUS_CHECKING; + status_ = APPCACHE_STATUS_CHECKING; // Its a 'master' entry thats already in the cache. backend_->SelectCache(host_id_, document_url_, @@ -251,8 +249,8 @@ void WebApplicationCacheHostImpl::didReceiveResponseForMainResource( is_get_method_ = true; // A redirect was involved. original_main_resource_url_ = GURL(); - is_scheme_supported_ = appcache::IsSchemeSupported(document_url_); - if ((document_response_.appCacheID() != appcache::kAppCacheNoCacheId) || + is_scheme_supported_ = IsSchemeSupportedForAppCache(document_url_); + if ((document_response_.appCacheID() != kAppCacheNoCacheId) || !is_scheme_supported_ || !is_get_method_) is_new_master_entry_ = NO; } @@ -277,9 +275,9 @@ WebApplicationCacheHost::Status WebApplicationCacheHostImpl::status() { bool WebApplicationCacheHostImpl::startUpdate() { if (!backend_->StartUpdate(host_id_)) return false; - if (status_ == appcache::APPCACHE_STATUS_IDLE || - status_ == appcache::APPCACHE_STATUS_UPDATE_READY) - status_ = appcache::APPCACHE_STATUS_CHECKING; + if (status_ == APPCACHE_STATUS_IDLE || + status_ == APPCACHE_STATUS_UPDATE_READY) + status_ = APPCACHE_STATUS_CHECKING; else status_ = backend_->GetStatus(host_id_); return true; diff --git a/content/child/appcache/web_application_cache_host_impl.h b/content/child/appcache/web_application_cache_host_impl.h index 07ec2db..fe27be2 100644 --- a/content/child/appcache/web_application_cache_host_impl.h +++ b/content/child/appcache/web_application_cache_host_impl.h @@ -7,12 +7,12 @@ #include <string> +#include "content/common/appcache_interfaces.h" #include "third_party/WebKit/public/platform/WebApplicationCacheHost.h" #include "third_party/WebKit/public/platform/WebApplicationCacheHostClient.h" #include "third_party/WebKit/public/platform/WebURLResponse.h" #include "third_party/WebKit/public/platform/WebVector.h" #include "url/gurl.h" -#include "webkit/common/appcache/appcache_interfaces.h" namespace content { @@ -23,19 +23,19 @@ class WebApplicationCacheHostImpl static WebApplicationCacheHostImpl* FromId(int id); WebApplicationCacheHostImpl(blink::WebApplicationCacheHostClient* client, - appcache::AppCacheBackend* backend); + AppCacheBackend* backend); virtual ~WebApplicationCacheHostImpl(); int host_id() const { return host_id_; } - appcache::AppCacheBackend* backend() const { return backend_; } + AppCacheBackend* backend() const { return backend_; } blink::WebApplicationCacheHostClient* client() const { return client_; } - virtual void OnCacheSelected(const appcache::AppCacheInfo& info); - void OnStatusChanged(appcache::AppCacheStatus); - void OnEventRaised(appcache::AppCacheEventID); + virtual void OnCacheSelected(const AppCacheInfo& info); + void OnStatusChanged(AppCacheStatus); + void OnEventRaised(AppCacheEventID); void OnProgressEventRaised(const GURL& url, int num_total, int num_complete); - void OnErrorEventRaised(const appcache::AppCacheErrorDetails& details); - virtual void OnLogMessage(appcache::AppCacheLogLevel log_level, + void OnErrorEventRaised(const AppCacheErrorDetails& details); + virtual void OnLogMessage(AppCacheLogLevel log_level, const std::string& message) {} virtual void OnContentBlocked(const GURL& manifest_url) {} @@ -62,15 +62,15 @@ class WebApplicationCacheHostImpl }; blink::WebApplicationCacheHostClient* client_; - appcache::AppCacheBackend* backend_; + AppCacheBackend* backend_; int host_id_; - appcache::AppCacheStatus status_; + AppCacheStatus status_; blink::WebURLResponse document_response_; GURL document_url_; bool is_scheme_supported_; bool is_get_method_; IsNewMasterEntry is_new_master_entry_; - appcache::AppCacheInfo cache_info_; + AppCacheInfo cache_info_; GURL original_main_resource_url_; // Used to detect redirection. bool was_select_cache_called_; }; diff --git a/content/child/resource_dispatcher_unittest.cc b/content/child/resource_dispatcher_unittest.cc index 86dc17f..3e427ca 100644 --- a/content/child/resource_dispatcher_unittest.cc +++ b/content/child/resource_dispatcher_unittest.cc @@ -16,6 +16,7 @@ #include "content/child/request_extra_data.h" #include "content/child/request_info.h" #include "content/child/resource_dispatcher.h" +#include "content/common/appcache_interfaces.h" #include "content/common/resource_messages.h" #include "content/common/service_worker/service_worker_types.h" #include "content/public/child/request_peer.h" @@ -24,7 +25,6 @@ #include "net/http/http_response_headers.h" #include "testing/gtest/include/gtest/gtest.h" #include "webkit/child/resource_loader_bridge.h" -#include "webkit/common/appcache/appcache_interfaces.h" using webkit_glue::ResourceLoaderBridge; @@ -331,7 +331,7 @@ class ResourceDispatcherTest : public testing::Test, public IPC::Sender { request_info.load_flags = 0; request_info.requestor_pid = 0; request_info.request_type = ResourceType::SUB_RESOURCE; - request_info.appcache_host_id = appcache::kAppCacheNoHostId; + request_info.appcache_host_id = kAppCacheNoHostId; request_info.routing_id = 0; request_info.download_to_file = download_to_file; RequestExtraData extra_data; diff --git a/webkit/common/appcache/appcache_interfaces.cc b/content/common/appcache_interfaces.cc index e89f550..f9f9a05 100644 --- a/webkit/common/appcache/appcache_interfaces.cc +++ b/content/common/appcache_interfaces.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/common/appcache/appcache_interfaces.h" +#include "content/common/appcache_interfaces.h" #include <set> @@ -10,7 +10,7 @@ #include "net/url_request/url_request.h" #include "url/gurl.h" -namespace appcache { +namespace content { const char kHttpScheme[] = "http"; const char kHttpsScheme[] = "https"; @@ -70,13 +70,13 @@ AppCacheErrorDetails::AppCacheErrorDetails( AppCacheErrorDetails::~AppCacheErrorDetails() {} -Namespace::Namespace() +AppCacheNamespace::AppCacheNamespace() : type(APPCACHE_FALLBACK_NAMESPACE), is_pattern(false), is_executable(false) { } -Namespace::Namespace( +AppCacheNamespace::AppCacheNamespace( AppCacheNamespaceType type, const GURL& url, const GURL& target, bool is_pattern) : type(type), @@ -86,7 +86,7 @@ Namespace::Namespace( is_executable(false) { } -Namespace::Namespace( +AppCacheNamespace::AppCacheNamespace( AppCacheNamespaceType type, const GURL& url, const GURL& target, bool is_pattern, bool is_executable) : type(type), @@ -96,10 +96,10 @@ Namespace::Namespace( is_executable(is_executable) { } -Namespace::~Namespace() { +AppCacheNamespace::~AppCacheNamespace() { } -bool Namespace::IsMatch(const GURL& url) const { +bool AppCacheNamespace::IsMatch(const GURL& url) const { if (is_pattern) { // We have to escape '?' characters since MatchPattern also treats those // as wildcards which we don't want here, we only do '*'s. @@ -111,7 +111,7 @@ bool Namespace::IsMatch(const GURL& url) const { return StartsWithASCII(url.spec(), namespace_url.spec(), true); } -bool IsSchemeSupported(const GURL& url) { +bool IsSchemeSupportedForAppCache(const GURL& url) { bool supported = url.SchemeIs(kHttpScheme) || url.SchemeIs(kHttpsScheme) || url.SchemeIs(kDevToolsScheme); @@ -127,13 +127,13 @@ bool IsSchemeSupported(const GURL& url) { return supported; } -bool IsMethodSupported(const std::string& method) { +bool IsMethodSupportedForAppCache(const std::string& method) { return (method == kHttpGETMethod) || (method == kHttpHEADMethod); } -bool IsSchemeAndMethodSupported(const net::URLRequest* request) { - return IsSchemeSupported(request->url()) && - IsMethodSupported(request->method()); +bool IsSchemeAndMethodSupportedForAppCache(const net::URLRequest* request) { + return IsSchemeSupportedForAppCache(request->url()) && + IsMethodSupportedForAppCache(request->method()); } -} // namespace appcache +} // namespace content diff --git a/webkit/common/appcache/appcache_interfaces.h b/content/common/appcache_interfaces.h index 558d6e2..7199fbb 100644 --- a/webkit/common/appcache/appcache_interfaces.h +++ b/content/common/appcache_interfaces.h @@ -2,42 +2,24 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ -#define WEBKIT_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ +#ifndef CONTENT_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ +#define CONTENT_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ #include <string> -#include <vector> #include "base/basictypes.h" #include "base/files/file_path.h" -#include "base/time/time.h" -#include "url/gurl.h" -#include "webkit/common/webkit_storage_common_export.h" +#include "content/public/common/appcache_info.h" namespace net { class URLRequest; } -namespace appcache { +namespace content { // Defines constants, types, and abstract classes used in the main // process and in child processes. -static const int kAppCacheNoHostId = 0; -static const int64 kAppCacheNoCacheId = 0; -static const int64 kAppCacheNoResponseId = 0; -static const int64 kAppCacheUnknownCacheId = -1; - -enum AppCacheStatus { - APPCACHE_STATUS_UNCACHED, - APPCACHE_STATUS_IDLE, - APPCACHE_STATUS_CHECKING, - APPCACHE_STATUS_DOWNLOADING, - APPCACHE_STATUS_UPDATE_READY, - APPCACHE_STATUS_OBSOLETE, - APPCACHE_STATUS_LAST = APPCACHE_STATUS_OBSOLETE -}; - enum AppCacheEventID { APPCACHE_CHECKING_EVENT, APPCACHE_ERROR_EVENT, @@ -76,25 +58,8 @@ enum AppCacheErrorReason { APPCACHE_ERROR_REASON_LAST = APPCACHE_UNKNOWN_ERROR }; -struct WEBKIT_STORAGE_COMMON_EXPORT AppCacheInfo { - AppCacheInfo(); - ~AppCacheInfo(); - - GURL manifest_url; - base::Time creation_time; - base::Time last_update_time; - base::Time last_access_time; - int64 cache_id; - int64 group_id; - AppCacheStatus status; - int64 size; - bool is_complete; -}; - -typedef std::vector<AppCacheInfo> AppCacheInfoVector; - // Type to hold information about a single appcache resource. -struct WEBKIT_STORAGE_COMMON_EXPORT AppCacheResourceInfo { +struct CONTENT_EXPORT AppCacheResourceInfo { AppCacheResourceInfo(); ~AppCacheResourceInfo(); @@ -109,7 +74,7 @@ struct WEBKIT_STORAGE_COMMON_EXPORT AppCacheResourceInfo { int64 response_id; }; -struct WEBKIT_STORAGE_COMMON_EXPORT AppCacheErrorDetails { +struct CONTENT_EXPORT AppCacheErrorDetails { AppCacheErrorDetails(); AppCacheErrorDetails(std::string message, AppCacheErrorReason reason, @@ -127,13 +92,13 @@ struct WEBKIT_STORAGE_COMMON_EXPORT AppCacheErrorDetails { typedef std::vector<AppCacheResourceInfo> AppCacheResourceInfoVector; -struct WEBKIT_STORAGE_COMMON_EXPORT Namespace { - Namespace(); // Type is set to APPCACHE_FALLBACK_NAMESPACE by default. - Namespace(AppCacheNamespaceType type, const GURL& url, const GURL& target, - bool is_pattern); - Namespace(AppCacheNamespaceType type, const GURL& url, const GURL& target, - bool is_pattern, bool is_executable); - ~Namespace(); +struct CONTENT_EXPORT AppCacheNamespace { + AppCacheNamespace(); // Type is APPCACHE_FALLBACK_NAMESPACE by default. + AppCacheNamespace(AppCacheNamespaceType type, const GURL& url, + const GURL& target, bool is_pattern); + AppCacheNamespace(AppCacheNamespaceType type, const GURL& url, + const GURL& target, bool is_pattern, bool is_executable); + ~AppCacheNamespace(); bool IsMatch(const GURL& url) const; @@ -144,13 +109,13 @@ struct WEBKIT_STORAGE_COMMON_EXPORT Namespace { bool is_executable; }; -typedef std::vector<Namespace> NamespaceVector; +typedef std::vector<AppCacheNamespace> AppCacheNamespaceVector; // Interface used by backend (browser-process) to talk to frontend (renderer). -class WEBKIT_STORAGE_COMMON_EXPORT AppCacheFrontend { +class CONTENT_EXPORT AppCacheFrontend { public: virtual void OnCacheSelected( - int host_id, const appcache::AppCacheInfo& info) = 0; + int host_id, const AppCacheInfo& info) = 0; virtual void OnStatusChanged(const std::vector<int>& host_ids, AppCacheStatus status) = 0; virtual void OnEventRaised(const std::vector<int>& host_ids, @@ -160,7 +125,7 @@ class WEBKIT_STORAGE_COMMON_EXPORT AppCacheFrontend { int num_total, int num_complete) = 0; virtual void OnErrorEventRaised( const std::vector<int>& host_ids, - const appcache::AppCacheErrorDetails& details) = 0; + const AppCacheErrorDetails& details) = 0; virtual void OnContentBlocked(int host_id, const GURL& manifest_url) = 0; virtual void OnLogMessage(int host_id, AppCacheLogLevel log_level, @@ -169,7 +134,7 @@ class WEBKIT_STORAGE_COMMON_EXPORT AppCacheFrontend { }; // Interface used by frontend (renderer) to talk to backend (browser-process). -class WEBKIT_STORAGE_COMMON_EXPORT AppCacheBackend { +class CONTENT_EXPORT AppCacheBackend { public: virtual void RegisterHost(int host_id) = 0; virtual void UnregisterHost(int host_id) = 0; @@ -199,24 +164,25 @@ class WEBKIT_STORAGE_COMMON_EXPORT AppCacheBackend { // Useful string constants. // Note: These are also defined elsewhere in the chrome code base in -// url_contants.h .cc, however the appcache library doesn't not have +// url_contants.h .cc, however the content library can not have // any dependencies on the chrome library, so we can't use them in here. -WEBKIT_STORAGE_COMMON_EXPORT extern const char kHttpScheme[]; -WEBKIT_STORAGE_COMMON_EXPORT extern const char kHttpsScheme[]; -WEBKIT_STORAGE_COMMON_EXPORT extern const char kHttpGETMethod[]; -WEBKIT_STORAGE_COMMON_EXPORT extern const char kHttpHEADMethod[]; +CONTENT_EXPORT extern const char kHttpScheme[]; +CONTENT_EXPORT extern const char kHttpsScheme[]; +CONTENT_EXPORT extern const char kHttpGETMethod[]; +CONTENT_EXPORT extern const char kHttpHEADMethod[]; // CommandLine flag to turn this experimental feature on. -WEBKIT_STORAGE_COMMON_EXPORT extern const char kEnableExecutableHandlers[]; +CONTENT_EXPORT extern const char kEnableExecutableHandlers[]; -WEBKIT_STORAGE_COMMON_EXPORT bool IsSchemeSupported(const GURL& url); -WEBKIT_STORAGE_COMMON_EXPORT bool IsMethodSupported(const std::string& method); -WEBKIT_STORAGE_COMMON_EXPORT bool IsSchemeAndMethodSupported( +CONTENT_EXPORT bool IsSchemeSupportedForAppCache(const GURL& url); +CONTENT_EXPORT bool IsMethodSupportedForAppCache( + const std::string& method); +CONTENT_EXPORT bool IsSchemeAndMethodSupportedForAppCache( const net::URLRequest* request); -WEBKIT_STORAGE_COMMON_EXPORT extern const base::FilePath::CharType +CONTENT_EXPORT extern const base::FilePath::CharType kAppCacheDatabaseName[]; } // namespace -#endif // WEBKIT_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ +#endif // CONTENT_COMMON_APPCACHE_APPCACHE_INTERFACES_H_ diff --git a/content/common/appcache_messages.h b/content/common/appcache_messages.h index 8ad8fd5..15d3758 100644 --- a/content/common/appcache_messages.h +++ b/content/common/appcache_messages.h @@ -5,18 +5,18 @@ // Multiply-included message file, hence no include guard. #include "ipc/ipc_message_macros.h" -#include "webkit/common/appcache/appcache_interfaces.h" +#include "content/common/appcache_interfaces.h" #define IPC_MESSAGE_START AppCacheMsgStart -IPC_ENUM_TRAITS_MAX_VALUE(appcache::AppCacheEventID, - appcache::APPCACHE_EVENT_ID_LAST) -IPC_ENUM_TRAITS_MAX_VALUE(appcache::AppCacheStatus, - appcache::APPCACHE_STATUS_LAST) -IPC_ENUM_TRAITS_MAX_VALUE(appcache::AppCacheErrorReason, - appcache::APPCACHE_ERROR_REASON_LAST) +IPC_ENUM_TRAITS_MAX_VALUE(content::AppCacheEventID, + content::APPCACHE_EVENT_ID_LAST) +IPC_ENUM_TRAITS_MAX_VALUE(content::AppCacheStatus, + content::APPCACHE_STATUS_LAST) +IPC_ENUM_TRAITS_MAX_VALUE(content::AppCacheErrorReason, + content::APPCACHE_ERROR_REASON_LAST) -IPC_STRUCT_TRAITS_BEGIN(appcache::AppCacheInfo) +IPC_STRUCT_TRAITS_BEGIN(content::AppCacheInfo) IPC_STRUCT_TRAITS_MEMBER(manifest_url) IPC_STRUCT_TRAITS_MEMBER(creation_time) IPC_STRUCT_TRAITS_MEMBER(last_update_time) @@ -28,7 +28,7 @@ IPC_STRUCT_TRAITS_BEGIN(appcache::AppCacheInfo) IPC_STRUCT_TRAITS_MEMBER(is_complete) IPC_STRUCT_TRAITS_END() -IPC_STRUCT_TRAITS_BEGIN(appcache::AppCacheResourceInfo) +IPC_STRUCT_TRAITS_BEGIN(content::AppCacheResourceInfo) IPC_STRUCT_TRAITS_MEMBER(url) IPC_STRUCT_TRAITS_MEMBER(size) IPC_STRUCT_TRAITS_MEMBER(is_master) @@ -38,7 +38,7 @@ IPC_STRUCT_TRAITS_BEGIN(appcache::AppCacheResourceInfo) IPC_STRUCT_TRAITS_MEMBER(is_explicit) IPC_STRUCT_TRAITS_END() -IPC_STRUCT_TRAITS_BEGIN(appcache::AppCacheErrorDetails) +IPC_STRUCT_TRAITS_BEGIN(content::AppCacheErrorDetails) IPC_STRUCT_TRAITS_MEMBER(message) IPC_STRUCT_TRAITS_MEMBER(reason) IPC_STRUCT_TRAITS_MEMBER(url) @@ -96,7 +96,7 @@ IPC_MESSAGE_CONTROL3(AppCacheHostMsg_MarkAsForeignEntry, // Returns the status of the appcache associated with host_id. IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheHostMsg_GetStatus, int /* host_id */, - appcache::AppCacheStatus) + content::AppCacheStatus) // Initiates an update of the appcache associated with host_id. IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheHostMsg_StartUpdate, @@ -111,7 +111,7 @@ IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheHostMsg_SwapCache, // Gets resource list from appcache synchronously. IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheHostMsg_GetResourceList, int /* host_id in*/, - std::vector<appcache::AppCacheResourceInfo> + std::vector<content::AppCacheResourceInfo> /* resources out */) @@ -121,18 +121,18 @@ IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheHostMsg_GetResourceList, // a particular host. This is sent in reply to AppCacheHostMsg_SelectCache. IPC_MESSAGE_CONTROL2(AppCacheMsg_CacheSelected, int /* host_id */, - appcache::AppCacheInfo) + content::AppCacheInfo) // Notifies the renderer of an AppCache status change. IPC_MESSAGE_CONTROL2(AppCacheMsg_StatusChanged, std::vector<int> /* host_ids */, - appcache::AppCacheStatus) + content::AppCacheStatus) // Notifies the renderer of an AppCache event other than the // progress event which has a seperate message. IPC_MESSAGE_CONTROL2(AppCacheMsg_EventRaised, std::vector<int> /* host_ids */, - appcache::AppCacheEventID) + content::AppCacheEventID) // Notifies the renderer of an AppCache progress event. IPC_MESSAGE_CONTROL4(AppCacheMsg_ProgressEventRaised, @@ -144,7 +144,7 @@ IPC_MESSAGE_CONTROL4(AppCacheMsg_ProgressEventRaised, // Notifies the renderer of an AppCache error event. IPC_MESSAGE_CONTROL2(AppCacheMsg_ErrorEventRaised, std::vector<int> /* host_ids */, - appcache::AppCacheErrorDetails) + content::AppCacheErrorDetails) // Notifies the renderer of an AppCache logging message. IPC_MESSAGE_CONTROL3(AppCacheMsg_LogMessage, diff --git a/content/content_browser.gypi b/content/content_browser.gypi index 66db276..a0d87b8 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi @@ -55,6 +55,7 @@ 'public/browser/android/synchronous_compositor.h', 'public/browser/android/ui_resource_client_android.h', 'public/browser/android/ui_resource_provider.h', + 'public/browser/appcache/appcache_service.h', 'public/browser/ax_event_notification_details.cc', 'public/browser/ax_event_notification_details.h', 'public/browser/blob_handle.h', @@ -312,16 +313,54 @@ 'browser/android/web_contents_observer_android.h', 'browser/android/ui_resource_provider_impl.cc', 'browser/android/ui_resource_provider_impl.h', + 'browser/appcache/appcache.cc', + 'browser/appcache/appcache.h', + 'browser/appcache/appcache_backend_impl.cc', + 'browser/appcache/appcache_backend_impl.h', + 'browser/appcache/appcache_database.cc', + 'browser/appcache/appcache_database.h', + 'browser/appcache/appcache_disk_cache.cc', + 'browser/appcache/appcache_disk_cache.h', 'browser/appcache/appcache_dispatcher_host.cc', 'browser/appcache/appcache_dispatcher_host.h', + 'browser/appcache/appcache_entry.h', + 'browser/appcache/appcache_executable_handler.h', 'browser/appcache/appcache_frontend_proxy.cc', 'browser/appcache/appcache_frontend_proxy.h', + 'browser/appcache/appcache_group.cc', + 'browser/appcache/appcache_group.h', + 'browser/appcache/appcache_histograms.cc', + 'browser/appcache/appcache_histograms.h', + 'browser/appcache/appcache_host.cc', + 'browser/appcache/appcache_host.h', 'browser/appcache/appcache_interceptor.cc', 'browser/appcache/appcache_interceptor.h', + 'browser/appcache/appcache_policy.h', + 'browser/appcache/appcache_quota_client.cc', + 'browser/appcache/appcache_quota_client.h', + 'browser/appcache/appcache_request_handler.cc', + 'browser/appcache/appcache_request_handler.h', + 'browser/appcache/appcache_response.cc', + 'browser/appcache/appcache_response.h', + 'browser/appcache/appcache_service_impl.cc', + 'browser/appcache/appcache_service_impl.h', + 'browser/appcache/appcache_storage.cc', + 'browser/appcache/appcache_storage.h', + 'browser/appcache/appcache_storage_impl.cc', + 'browser/appcache/appcache_storage_impl.h', + 'browser/appcache/appcache_update_job.cc', + 'browser/appcache/appcache_update_job.h', + 'browser/appcache/appcache_url_request_job.cc', + 'browser/appcache/appcache_url_request_job.h', + 'browser/appcache/appcache_working_set.cc', + 'browser/appcache/appcache_working_set.h', 'browser/appcache/chrome_appcache_service.cc', 'browser/appcache/chrome_appcache_service.h', - 'browser/appcache/view_appcache_internals_job.h', + 'browser/appcache/manifest_parser.cc', + 'browser/appcache/manifest_parser.h', 'browser/appcache/view_appcache_internals_job.cc', + 'browser/appcache/view_appcache_internals_job.h', + 'browser/battery_status/battery_status_manager_android.cc', 'browser/battery_status/battery_status_manager_default.cc', 'browser/battery_status/battery_status_manager.h', @@ -1652,6 +1691,10 @@ '../media/media.gyp:media', 'content.gyp:content_jni_headers', ], + 'defines': ['APPCACHE_USE_SIMPLE_CACHE'], + 'direct_dependent_settings': { + 'defines': ['APPCACHE_USE_SIMPLE_CACHE'], + }, 'link_settings': { 'libraries': [ '-ljnigraphics', diff --git a/content/content_common.gypi b/content/content_common.gypi index 7bc6b8ce..a67b53a 100644 --- a/content/content_common.gypi +++ b/content/content_common.gypi @@ -32,6 +32,7 @@ ], 'variables': { 'public_common_sources': [ + 'public/common/appcache_info.h', 'public/common/bindings_policy.h', 'public/common/child_process_host.h', 'public/common/child_process_host_delegate.cc', @@ -146,6 +147,8 @@ 'common/android/surface_texture_lookup.h', 'common/android/surface_texture_peer.cc', 'common/android/surface_texture_peer.h', + 'common/appcache_interfaces.cc', + 'common/appcache_interfaces.h', 'common/appcache_messages.h', 'common/battery_status_messages.h', 'common/browser_plugin/browser_plugin_constants.cc', diff --git a/webkit/browser/appcache/appcache_service.h b/content/public/browser/appcache_service.h index dc6e33b..7742abd 100644 --- a/webkit/browser/appcache/appcache_service.h +++ b/content/public/browser/appcache_service.h @@ -2,23 +2,24 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_SERVICE_H_ -#define WEBKIT_BROWSER_APPCACHE_APPCACHE_SERVICE_H_ +#ifndef CONTENT_PUBLIC_BROWSER_APPCACHE_SERVICE_H_ +#define CONTENT_PUBLIC_BROWSER_APPCACHE_SERVICE_H_ #include <map> #include <set> #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" -#include "webkit/browser/webkit_storage_browser_export.h" -#include "webkit/common/appcache/appcache_interfaces.h" +#include "content/common/content_export.h" +#include "content/public/common/appcache_info.h" +#include "net/base/completion_callback.h" -namespace appcache { +namespace content { class AppCacheStorage; // Refcounted container to avoid copying the collection in callbacks. -struct WEBKIT_STORAGE_BROWSER_EXPORT AppCacheInfoCollection +struct CONTENT_EXPORT AppCacheInfoCollection : public base::RefCountedThreadSafe<AppCacheInfoCollection> { AppCacheInfoCollection(); @@ -29,13 +30,10 @@ struct WEBKIT_STORAGE_BROWSER_EXPORT AppCacheInfoCollection virtual ~AppCacheInfoCollection(); }; -// Class that manages the application cache service. Sends notifications -// to many frontends. One instance per user-profile. Each instance has -// exclusive access to its cache_directory on disk. -class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheService { +// Exposes a limited interface to the AppCacheService. +// Call these methods only on the IO thread. +class CONTENT_EXPORT AppCacheService { public: - virtual ~AppCacheService() { } - // Determines if a request for 'url' can be satisfied while offline. // This method always completes asynchronously. virtual void CanHandleMainResourceOffline(const GURL& url, @@ -57,8 +55,11 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheService { // will fail. This method always completes asynchronously. virtual void DeleteAppCacheGroup(const GURL& manifest_url, const net::CompletionCallback& callback) = 0; + + protected: + virtual ~AppCacheService() {} }; -} // namespace appcache +} // namespace content -#endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_SERVICE_H_ +#endif // CONTENT_PUBLIC_BROWSER_APPCACHE_SERVICE_H_ diff --git a/content/public/browser/resource_context.h b/content/public/browser/resource_context.h index 58eb298..1c21de0 100644 --- a/content/public/browser/resource_context.h +++ b/content/public/browser/resource_context.h @@ -16,7 +16,7 @@ class GURL; -namespace appcache { +namespace content { class AppCacheService; } diff --git a/content/public/browser/resource_dispatcher_host_delegate.cc b/content/public/browser/resource_dispatcher_host_delegate.cc index b7b96c3..ceed430 100644 --- a/content/public/browser/resource_dispatcher_host_delegate.cc +++ b/content/public/browser/resource_dispatcher_host_delegate.cc @@ -21,7 +21,7 @@ bool ResourceDispatcherHostDelegate::ShouldBeginRequest( void ResourceDispatcherHostDelegate::RequestBeginning( net::URLRequest* request, ResourceContext* resource_context, - appcache::AppCacheService* appcache_service, + AppCacheService* appcache_service, ResourceType::Type resource_type, int child_id, int route_id, diff --git a/content/public/browser/resource_dispatcher_host_delegate.h b/content/public/browser/resource_dispatcher_host_delegate.h index 45796ba..d16a11f 100644 --- a/content/public/browser/resource_dispatcher_host_delegate.h +++ b/content/public/browser/resource_dispatcher_host_delegate.h @@ -15,7 +15,7 @@ class GURL; template <class T> class ScopedVector; -namespace appcache { +namespace content { class AppCacheService; } @@ -58,7 +58,7 @@ class CONTENT_EXPORT ResourceDispatcherHostDelegate { virtual void RequestBeginning( net::URLRequest* request, ResourceContext* resource_context, - appcache::AppCacheService* appcache_service, + AppCacheService* appcache_service, ResourceType::Type resource_type, int child_id, int route_id, diff --git a/content/public/browser/storage_partition.h b/content/public/browser/storage_partition.h index 3a4139d..ea8baa3 100644 --- a/content/public/browser/storage_partition.h +++ b/content/public/browser/storage_partition.h @@ -12,7 +12,7 @@ class GURL; -namespace appcache { +namespace content { class AppCacheService; } @@ -52,7 +52,7 @@ class StoragePartition { virtual net::URLRequestContextGetter* GetURLRequestContext() = 0; virtual net::URLRequestContextGetter* GetMediaURLRequestContext() = 0; virtual quota::QuotaManager* GetQuotaManager() = 0; - virtual appcache::AppCacheService* GetAppCacheService() = 0; + virtual AppCacheService* GetAppCacheService() = 0; virtual fileapi::FileSystemContext* GetFileSystemContext() = 0; virtual webkit_database::DatabaseTracker* GetDatabaseTracker() = 0; virtual DOMStorageContext* GetDOMStorageContext() = 0; diff --git a/content/public/common/appcache_info.h b/content/public/common/appcache_info.h new file mode 100644 index 0000000..f37e015 --- /dev/null +++ b/content/public/common/appcache_info.h @@ -0,0 +1,50 @@ +// Copyright (c) 2014 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 CONTENT_PUBLIC_COMMON_APPCACHE_INFO_H_ +#define CONTENT_PUBLIC_COMMON_APPCACHE_INFO_H_ + +#include <vector> + +#include "base/time/time.h" +#include "content/common/content_export.h" +#include "url/gurl.h" + +namespace content { + +static const int kAppCacheNoHostId = 0; +static const int64 kAppCacheNoCacheId = 0; +static const int64 kAppCacheNoResponseId = 0; +static const int64 kAppCacheUnknownCacheId = -1; + +enum AppCacheStatus { + APPCACHE_STATUS_UNCACHED, + APPCACHE_STATUS_IDLE, + APPCACHE_STATUS_CHECKING, + APPCACHE_STATUS_DOWNLOADING, + APPCACHE_STATUS_UPDATE_READY, + APPCACHE_STATUS_OBSOLETE, + APPCACHE_STATUS_LAST = APPCACHE_STATUS_OBSOLETE +}; + +struct CONTENT_EXPORT AppCacheInfo { + AppCacheInfo(); + ~AppCacheInfo(); + + GURL manifest_url; + base::Time creation_time; + base::Time last_update_time; + base::Time last_access_time; + int64 cache_id; + int64 group_id; + AppCacheStatus status; + int64 size; + bool is_complete; +}; + +typedef std::vector<AppCacheInfo> AppCacheInfoVector; + +} // namespace + +#endif // CONTENT_PUBLIC_COMMON_APPCACHE_INFO_H_ diff --git a/content/public/common/resource_response_info.cc b/content/public/common/resource_response_info.cc index 70dbc50..e827f3e 100644 --- a/content/public/common/resource_response_info.cc +++ b/content/public/common/resource_response_info.cc @@ -4,15 +4,15 @@ #include "content/public/common/resource_response_info.h" +#include "content/public/common/appcache_info.h" #include "net/http/http_response_headers.h" -#include "webkit/common/appcache/appcache_interfaces.h" namespace content { ResourceResponseInfo::ResourceResponseInfo() : content_length(-1), encoded_data_length(-1), - appcache_id(appcache::kAppCacheNoCacheId), + appcache_id(kAppCacheNoCacheId), was_fetched_via_spdy(false), was_npn_negotiated(false), was_alternate_protocol_available(false), diff --git a/content/renderer/renderer_webapplicationcachehost_impl.cc b/content/renderer/renderer_webapplicationcachehost_impl.cc index 5b781d4..42aae61 100644 --- a/content/renderer/renderer_webapplicationcachehost_impl.cc +++ b/content/renderer/renderer_webapplicationcachehost_impl.cc @@ -10,7 +10,6 @@ #include "third_party/WebKit/public/web/WebFrame.h" #include "third_party/WebKit/public/web/WebView.h" -using appcache::AppCacheBackend; using blink::WebApplicationCacheHostClient; using blink::WebConsoleMessage; @@ -25,7 +24,7 @@ RendererWebApplicationCacheHostImpl::RendererWebApplicationCacheHostImpl( } void RendererWebApplicationCacheHostImpl::OnLogMessage( - appcache::AppCacheLogLevel log_level, const std::string& message) { + AppCacheLogLevel log_level, const std::string& message) { if (RenderThreadImpl::current()->layout_test_mode()) return; @@ -47,7 +46,7 @@ void RendererWebApplicationCacheHostImpl::OnContentBlocked( } void RendererWebApplicationCacheHostImpl::OnCacheSelected( - const appcache::AppCacheInfo& info) { + const AppCacheInfo& info) { if (!info.manifest_url.is_empty()) { RenderThreadImpl::current()->Send(new ViewHostMsg_AppCacheAccessed( routing_id_, info.manifest_url, false)); diff --git a/content/renderer/renderer_webapplicationcachehost_impl.h b/content/renderer/renderer_webapplicationcachehost_impl.h index e7b2bc8..a752c08 100644 --- a/content/renderer/renderer_webapplicationcachehost_impl.h +++ b/content/renderer/renderer_webapplicationcachehost_impl.h @@ -15,13 +15,13 @@ class RendererWebApplicationCacheHostImpl : public WebApplicationCacheHostImpl { RendererWebApplicationCacheHostImpl( RenderViewImpl* render_view, blink::WebApplicationCacheHostClient* client, - appcache::AppCacheBackend* backend); + AppCacheBackend* backend); // WebApplicationCacheHostImpl: - virtual void OnLogMessage(appcache::AppCacheLogLevel log_level, + virtual void OnLogMessage(AppCacheLogLevel log_level, const std::string& message) OVERRIDE; virtual void OnContentBlocked(const GURL& manifest_url) OVERRIDE; - virtual void OnCacheSelected(const appcache::AppCacheInfo& info) OVERRIDE; + virtual void OnCacheSelected(const AppCacheInfo& info) OVERRIDE; private: RenderViewImpl* GetRenderView(); diff --git a/content/test/appcache_test_helper.cc b/content/test/appcache_test_helper.cc index 087c721..1a95c05 100644 --- a/content/test/appcache_test_helper.cc +++ b/content/test/appcache_test_helper.cc @@ -7,11 +7,11 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "base/message_loop/message_loop.h" +#include "content/browser/appcache/appcache.h" +#include "content/browser/appcache/appcache_entry.h" +#include "content/browser/appcache/appcache_group.h" +#include "content/browser/appcache/appcache_service_impl.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webkit/browser/appcache/appcache.h" -#include "webkit/browser/appcache/appcache_entry.h" -#include "webkit/browser/appcache/appcache_group.h" -#include "webkit/browser/appcache/appcache_service_impl.h" namespace content { @@ -24,23 +24,23 @@ AppCacheTestHelper::AppCacheTestHelper() AppCacheTestHelper::~AppCacheTestHelper() {} void AppCacheTestHelper::OnGroupAndNewestCacheStored( - appcache::AppCacheGroup* /*group*/, - appcache::AppCache* /*newest_cache*/, + AppCacheGroup* /*group*/, + AppCache* /*newest_cache*/, bool success, bool /*would_exceed_quota*/) { ASSERT_TRUE(success); base::MessageLoop::current()->Quit(); } -void AppCacheTestHelper::AddGroupAndCache(appcache::AppCacheServiceImpl* +void AppCacheTestHelper::AddGroupAndCache(AppCacheServiceImpl* appcache_service, const GURL& manifest_url) { - appcache::AppCacheGroup* appcache_group = - new appcache::AppCacheGroup(appcache_service->storage(), + AppCacheGroup* appcache_group = + new AppCacheGroup(appcache_service->storage(), manifest_url, ++group_id_); - appcache::AppCache* appcache = new appcache::AppCache( + AppCache* appcache = new AppCache( appcache_service->storage(), ++appcache_id_); - appcache::AppCacheEntry entry(appcache::AppCacheEntry::MANIFEST, + AppCacheEntry entry(AppCacheEntry::MANIFEST, ++response_id_); appcache->AddEntry(manifest_url, entry); appcache->set_complete(true); @@ -52,9 +52,9 @@ void AppCacheTestHelper::AddGroupAndCache(appcache::AppCacheServiceImpl* base::MessageLoop::current()->Run(); } -void AppCacheTestHelper::GetOriginsWithCaches(appcache::AppCacheServiceImpl* +void AppCacheTestHelper::GetOriginsWithCaches(AppCacheServiceImpl* appcache_service, std::set<GURL>* origins) { - appcache_info_ = new appcache::AppCacheInfoCollection; + appcache_info_ = new AppCacheInfoCollection; origins_ = origins; appcache_service->GetAllAppCacheInfo( appcache_info_.get(), @@ -66,7 +66,7 @@ void AppCacheTestHelper::GetOriginsWithCaches(appcache::AppCacheServiceImpl* } void AppCacheTestHelper::OnGotAppCacheInfo(int rv) { - typedef std::map<GURL, appcache::AppCacheInfoVector> InfoByOrigin; + typedef std::map<GURL, AppCacheInfoVector> InfoByOrigin; origins_->clear(); for (InfoByOrigin::const_iterator origin = diff --git a/content/test/appcache_test_helper.h b/content/test/appcache_test_helper.h index f93424b..3b6f6c9 100644 --- a/content/test/appcache_test_helper.h +++ b/content/test/appcache_test_helper.h @@ -7,9 +7,9 @@ #include <set> -#include "webkit/browser/appcache/appcache_storage.h" +#include "content/browser/appcache/appcache_storage.h" -namespace appcache { +namespace content { class AppCacheServiceImpl; } @@ -17,19 +17,19 @@ namespace content { // Helper class for inserting data into a ChromeAppCacheService and reading it // back. -class AppCacheTestHelper : public appcache::AppCacheStorage::Delegate { +class AppCacheTestHelper : public AppCacheStorage::Delegate { public: AppCacheTestHelper(); virtual ~AppCacheTestHelper(); - void AddGroupAndCache(appcache::AppCacheServiceImpl* appcache_service, + void AddGroupAndCache(AppCacheServiceImpl* appcache_service, const GURL& manifest_url); - void GetOriginsWithCaches(appcache::AppCacheServiceImpl* appcache_service, + void GetOriginsWithCaches(AppCacheServiceImpl* appcache_service, std::set<GURL>* origins); private: virtual void OnGroupAndNewestCacheStored( - appcache::AppCacheGroup* group, - appcache::AppCache* newest_cache, + AppCacheGroup* group, + AppCache* newest_cache, bool success, bool would_exceed_quota) OVERRIDE; void OnGotAppCacheInfo(int rv); @@ -37,7 +37,7 @@ class AppCacheTestHelper : public appcache::AppCacheStorage::Delegate { int group_id_; int appcache_id_; int response_id_; - scoped_refptr<appcache::AppCacheInfoCollection> appcache_info_; + scoped_refptr<AppCacheInfoCollection> appcache_info_; std::set<GURL>* origins_; // not owned DISALLOW_COPY_AND_ASSIGN(AppCacheTestHelper); diff --git a/webkit/browser/BUILD.gn b/webkit/browser/BUILD.gn index e06af088..81930bf 100644 --- a/webkit/browser/BUILD.gn +++ b/webkit/browser/BUILD.gn @@ -2,54 +2,10 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -config("storage_config") { - if (is_android) { - defines = [ "APPCACHE_USE_SIMPLE_CACHE" ] - } -} - component("storage") { output_name = "webkit_storage_browser" sources = [ "webkit_storage_browser_export.h", - "appcache/appcache.cc", - "appcache/appcache.h", - "appcache/appcache_backend_impl.cc", - "appcache/appcache_backend_impl.h", - "appcache/appcache_database.cc", - "appcache/appcache_database.h", - "appcache/appcache_disk_cache.cc", - "appcache/appcache_disk_cache.h", - "appcache/appcache_entry.h", - "appcache/appcache_executable_handler.h", - "appcache/appcache_group.cc", - "appcache/appcache_group.h", - "appcache/appcache_histograms.cc", - "appcache/appcache_histograms.h", - "appcache/appcache_host.cc", - "appcache/appcache_host.h", - "appcache/appcache_policy.h", - "appcache/appcache_quota_client.cc", - "appcache/appcache_quota_client.h", - "appcache/appcache_request_handler.cc", - "appcache/appcache_request_handler.h", - "appcache/appcache_response.cc", - "appcache/appcache_response.h", - "appcache/appcache_service_impl.cc", - "appcache/appcache_service_impl.h", - "appcache/appcache_service.h", - "appcache/appcache_storage.cc", - "appcache/appcache_storage.h", - "appcache/appcache_storage_impl.cc", - "appcache/appcache_storage_impl.h", - "appcache/appcache_working_set.cc", - "appcache/appcache_working_set.h", - "appcache/appcache_update_job.cc", - "appcache/appcache_update_job.h", - "appcache/appcache_url_request_job.cc", - "appcache/appcache_url_request_job.h", - "appcache/manifest_parser.cc", - "appcache/manifest_parser.h", "blob/blob_data_handle.cc", "blob/blob_data_handle.h", "blob/blob_storage_context.cc", @@ -198,7 +154,6 @@ component("storage") { defines = [ "WEBKIT_STORAGE_BROWSER_IMPLEMENTATION" ] configs += [ "//build/config/compiler:wexit_time_destructors" ] - direct_dependent_configs = [ ":storage_config" ] if (is_win) { cflags = [ "/wd4267" ] # TODO(jschuh): fix size_t to int truncations. } diff --git a/webkit/common/BUILD.gn b/webkit/common/BUILD.gn index 011a1eb..37f6634 100644 --- a/webkit/common/BUILD.gn +++ b/webkit/common/BUILD.gn @@ -42,8 +42,6 @@ component("storage") { output_name = "webkit_storage_common" sources = [ "webkit_storage_common_export.h", - "appcache/appcache_interfaces.cc", - "appcache/appcache_interfaces.h", "blob/blob_data.cc", "blob/blob_data.h", "blob/scoped_file.cc", diff --git a/webkit/storage_browser.gyp b/webkit/storage_browser.gyp index 6f510d9..f2a04ba 100644 --- a/webkit/storage_browser.gyp +++ b/webkit/storage_browser.gyp @@ -27,44 +27,6 @@ 'defines': ['WEBKIT_STORAGE_BROWSER_IMPLEMENTATION'], 'sources': [ 'browser/webkit_storage_browser_export.h', - 'browser/appcache/appcache.cc', - 'browser/appcache/appcache.h', - 'browser/appcache/appcache_backend_impl.cc', - 'browser/appcache/appcache_backend_impl.h', - 'browser/appcache/appcache_database.cc', - 'browser/appcache/appcache_database.h', - 'browser/appcache/appcache_disk_cache.cc', - 'browser/appcache/appcache_disk_cache.h', - 'browser/appcache/appcache_entry.h', - 'browser/appcache/appcache_executable_handler.h', - 'browser/appcache/appcache_group.cc', - 'browser/appcache/appcache_group.h', - 'browser/appcache/appcache_histograms.cc', - 'browser/appcache/appcache_histograms.h', - 'browser/appcache/appcache_host.cc', - 'browser/appcache/appcache_host.h', - 'browser/appcache/appcache_policy.h', - 'browser/appcache/appcache_quota_client.cc', - 'browser/appcache/appcache_quota_client.h', - 'browser/appcache/appcache_request_handler.cc', - 'browser/appcache/appcache_request_handler.h', - 'browser/appcache/appcache_response.cc', - 'browser/appcache/appcache_response.h', - 'browser/appcache/appcache_service.h', - 'browser/appcache/appcache_service_impl.cc', - 'browser/appcache/appcache_service_impl.h', - 'browser/appcache/appcache_storage.cc', - 'browser/appcache/appcache_storage.h', - 'browser/appcache/appcache_storage_impl.cc', - 'browser/appcache/appcache_storage_impl.h', - 'browser/appcache/appcache_working_set.cc', - 'browser/appcache/appcache_working_set.h', - 'browser/appcache/appcache_update_job.cc', - 'browser/appcache/appcache_update_job.h', - 'browser/appcache/appcache_url_request_job.cc', - 'browser/appcache/appcache_url_request_job.h', - 'browser/appcache/manifest_parser.cc', - 'browser/appcache/manifest_parser.h', 'browser/blob/blob_data_handle.cc', 'browser/blob/blob_data_handle.h', 'browser/blob/blob_storage_context.cc', @@ -219,12 +181,6 @@ '<(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/webkit/storage_common.gyp b/webkit/storage_common.gyp index f52af1e..27c9f37 100644 --- a/webkit/storage_common.gyp +++ b/webkit/storage_common.gyp @@ -22,8 +22,6 @@ 'defines': ['WEBKIT_STORAGE_COMMON_IMPLEMENTATION'], 'sources': [ 'common/webkit_storage_common_export.h', - 'common/appcache/appcache_interfaces.cc', - 'common/appcache/appcache_interfaces.h', 'common/blob/blob_data.cc', 'common/blob/blob_data.h', 'common/blob/scoped_file.cc', |