Provide a profile.GetAppCacheService() accessor and add two helper methods to ChromeAppCacheService to override the default quota for an origin.

BUG=49993
TESTS=existing tests apply

Review URL: http://codereview.chromium.org/2819091

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55773 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 7b3f7d27..26392e88 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -168,6 +168,19 @@
     return profile_;
   }
 
+  virtual ChromeAppCacheService* GetAppCacheService() {
+    if (!appcache_service_) {
+      appcache_service_ = new ChromeAppCacheService;
+      ChromeThread::PostTask(
+          ChromeThread::IO, FROM_HERE,
+          NewRunnableMethod(appcache_service_.get(),
+                            &ChromeAppCacheService::InitializeOnIOThread,
+                            GetPath(), IsOffTheRecord(),
+                            make_scoped_refptr(GetHostContentSettingsMap())));
+    }
+    return appcache_service_;
+  }
+
   virtual webkit_database::DatabaseTracker* GetDatabaseTracker() {
     if (!db_tracker_) {
       db_tracker_ = new webkit_database::DatabaseTracker(
@@ -531,6 +544,8 @@
   // Time we were started.
   Time start_time_;
 
+  scoped_refptr<ChromeAppCacheService> appcache_service_;
+
   // The main database tracker for this profile.
   // Should be used only on the file thread.
   scoped_refptr<webkit_database::DatabaseTracker> db_tracker_;