Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / webkit / browser / appcache / appcache_update_job.h
index 0b88be6..3207fad 100644 (file)
@@ -35,6 +35,13 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheUpdateJob
       public AppCacheHost::Observer,
       public AppCacheService::Observer {
  public:
+  // Used for uma stats only for now, so new values are append only.
+  enum ResultType {
+    UPDATE_OK, DB_ERROR, DISKCACHE_ERROR, QUOTA_ERROR, REDIRECT_ERROR,
+    MANIFEST_ERROR, NETWORK_ERROR, SERVER_ERROR,
+    NUM_UPDATE_JOB_RESULT_TYPES
+  };
+
   AppCacheUpdateJob(AppCacheService* service, AppCacheGroup* group);
   virtual ~AppCacheUpdateJob();
 
@@ -118,6 +125,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheUpdateJob
     void set_existing_entry(const AppCacheEntry& entry) {
       existing_entry_ = entry;
     }
+    ResultType result() const { return result_; }
 
    private:
     // URLRequest::Delegate overrides
@@ -144,6 +152,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheUpdateJob
     AppCacheEntry existing_entry_;
     scoped_refptr<net::HttpResponseHeaders> existing_response_headers_;
     std::string manifest_data_;
+    ResultType result_;
     scoped_ptr<AppCacheResponseWriter> response_writer_;
   };  // class URLFetcher
 
@@ -166,7 +175,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheUpdateJob
   virtual void OnServiceReinitialized(
       AppCacheStorageReference* old_storage) OVERRIDE;
 
-  void HandleCacheFailure(const std::string& error_message);
+  void HandleCacheFailure(const std::string& error_message, ResultType result);
 
   void FetchManifest(bool is_first_fetch);
   void HandleManifestFetchCompleted(URLFetcher* fetcher);