diff options
author | kkanetkar@chromium.org <kkanetkar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-27 01:36:43 +0000 |
---|---|---|
committer | kkanetkar@chromium.org <kkanetkar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-27 01:36:43 +0000 |
commit | 042ecea347c6984c3263671f45ebec79e9fbb26f (patch) | |
tree | bfedface274ededad945b9c7d7871a19941d56ee /webkit/appcache/view_appcache_internals_job.h | |
parent | 43929df205159d29c8e968e93c8572b05c92de17 (diff) | |
download | chromium_src-042ecea347c6984c3263671f45ebec79e9fbb26f.zip chromium_src-042ecea347c6984c3263671f45ebec79e9fbb26f.tar.gz chromium_src-042ecea347c6984c3263671f45ebec79e9fbb26f.tar.bz2 |
A basic implementation of information about appcache. Lists manifest files, time and size information.
BUG=38463
TEST=Run chrome, navigate to about:appcache-internals.
Review URL: http://codereview.chromium.org/1109009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42888 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/view_appcache_internals_job.h')
-rw-r--r-- | webkit/appcache/view_appcache_internals_job.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/webkit/appcache/view_appcache_internals_job.h b/webkit/appcache/view_appcache_internals_job.h new file mode 100644 index 0000000..dd5c9cf --- /dev/null +++ b/webkit/appcache/view_appcache_internals_job.h @@ -0,0 +1,54 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WEBKIT_APPCACHE_VIEW_APPCACHE_INTERNALS_JOB_H_ +#define WEBKIT_APPCACHE_VIEW_APPCACHE_INTERNALS_JOB_H_ + +#include <string> + +#include "net/url_request/url_request_simple_job.h" +#include "webkit/appcache/appcache_service.h" + +class URLRequest; + +namespace appcache { + +// A job subclass that implements a protocol to inspect the internal +// state of appcache service. +class ViewAppCacheInternalsJob : public URLRequestSimpleJob { + public: + // Stores handle to appcache service for getting information. + ViewAppCacheInternalsJob(URLRequest* request, AppCacheService* service); + + // Fetches the AppCache Info and calls StartAsync after it is done. + virtual void Start(); + + // URLRequestSimpleJob methods: + virtual bool GetData(std::string* mime_type, + std::string* charset, + std::string* data) const; + + // Callback after asynchronously fetching contents for appcache service. + void OnGotAppCacheInfo(int rv); + + private: + ~ViewAppCacheInternalsJob(); + + // Adds HTML from appcache information to out. + void GenerateHTMLAppCacheInfo(std::string* out) const; + + // Callback for post-processing. + scoped_refptr<net::CancelableCompletionCallback<ViewAppCacheInternalsJob> > + appcache_info_callback_; + // Store appcache information. + scoped_refptr<AppCacheInfoCollection> info_collection_; + // Not owned. + AppCacheService* appcache_service_; + + DISALLOW_COPY_AND_ASSIGN(ViewAppCacheInternalsJob); +}; + +} // namespace appcache + +#endif // WEBKIT_APPCACHE_VIEW_APPCACHE_INTERNALS_JOB_H_ |