diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-09 10:30:25 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-09 10:30:25 +0000 |
commit | 80d42818b9f89df2089de425ebfb6784a5592581 (patch) | |
tree | 20caab18c7df619142a5958353aac06610a5b30f /webkit/appcache/appcache_storage.h | |
parent | 3dfc5dc39fa4c3f9bf9b31be5958c5e8221a1830 (diff) | |
download | chromium_src-80d42818b9f89df2089de425ebfb6784a5592581.zip chromium_src-80d42818b9f89df2089de425ebfb6784a5592581.tar.gz chromium_src-80d42818b9f89df2089de425ebfb6784a5592581.tar.bz2 |
[GTTF] Reduce header dependencies in webkit
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/582015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38461 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_storage.h')
-rw-r--r-- | webkit/appcache/appcache_storage.h | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/webkit/appcache/appcache_storage.h b/webkit/appcache/appcache_storage.h index cfa27a5..4c51e39 100644 --- a/webkit/appcache/appcache_storage.h +++ b/webkit/appcache/appcache_storage.h @@ -11,9 +11,9 @@ #include "base/compiler_specific.h" #include "base/basictypes.h" #include "base/ref_counted.h" -#include "net/base/net_errors.h" +#include "base/scoped_ptr.h" +#include "net/base/completion_callback.h" #include "testing/gtest/include/gtest/gtest_prod.h" -#include "webkit/appcache/appcache_response.h" #include "webkit/appcache/appcache_working_set.h" class GURL; @@ -23,7 +23,10 @@ namespace appcache { class AppCache; class AppCacheEntry; class AppCacheGroup; +class AppCacheResponseReader; +class AppCacheResponseWriter; class AppCacheService; +struct HttpResponseInfoIOBuffer; class AppCacheStorage { public: @@ -216,16 +219,7 @@ class AppCacheStorage { class ResponseInfoLoadTask { public: ResponseInfoLoadTask(const GURL& manifest_url, int64 response_id, - AppCacheStorage* storage) - : storage_(storage), - manifest_url_(manifest_url), - response_id_(response_id), - info_buffer_(new HttpResponseInfoIOBuffer), - ALLOW_THIS_IN_INITIALIZER_LIST(read_callback_( - this, &ResponseInfoLoadTask::OnReadComplete)) { - storage_->pending_info_loads_.insert( - PendingResponseInfoLoads::value_type(response_id, this)); - } + AppCacheStorage* storage); int64 response_id() const { return response_id_; } const GURL& manifest_url() const { return manifest_url_; } @@ -234,27 +228,10 @@ class AppCacheStorage { delegates_.push_back(delegate_reference); } - void StartIfNeeded() { - if (reader_.get()) - return; - reader_.reset( - storage_->CreateResponseReader(manifest_url_, response_id_)); - reader_->ReadInfo(info_buffer_, &read_callback_); - } + void StartIfNeeded(); private: - void OnReadComplete(int result) { - storage_->pending_info_loads_.erase(response_id_); - scoped_refptr<AppCacheResponseInfo> info; - if (result >= 0) { - info = new AppCacheResponseInfo( - storage_->service(), manifest_url_, response_id_, - info_buffer_->http_info.release()); - } - FOR_EACH_DELEGATE( - delegates_, OnResponseInfoLoaded(info.get(), response_id_)); - delete this; - } + void OnReadComplete(int result); AppCacheStorage* storage_; GURL manifest_url_; |