| OLD | NEW |
| 1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_URL_REQUEST_VIEW_CACHE_HELPER_H_ | 5 #ifndef NET_URL_REQUEST_VIEW_CACHE_HELPER_H_ |
| 6 #define NET_URL_REQUEST_VIEW_CACHE_HELPER_H_ | 6 #define NET_URL_REQUEST_VIEW_CACHE_HELPER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "net/base/completion_callback.h" | 11 #include "net/base/completion_callback.h" |
| 12 #include "net/base/io_buffer.h" | 12 #include "net/base/io_buffer.h" |
| 13 | 13 |
| 14 class URLRequestContext; | 14 class URLRequestContext; |
| 15 | 15 |
| 16 namespace disk_cache { | 16 namespace disk_cache { |
| 17 class Backend; | 17 class Backend; |
| 18 class Entry; | 18 class Entry; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace net { | 21 namespace net { |
| 22 | 22 |
| 23 class ViewCacheHelper { | 23 class ViewCacheHelper { |
| 24 public: | 24 public: |
| 25 ViewCacheHelper() | 25 ViewCacheHelper(); |
| 26 : disk_cache_(NULL), entry_(NULL), iter_(NULL), buf_len_(0), index_(0), | |
| 27 data_(NULL), callback_(NULL), next_state_(STATE_NONE), | |
| 28 ALLOW_THIS_IN_INITIALIZER_LIST( | |
| 29 cache_callback_(this, &ViewCacheHelper::OnIOComplete)), | |
| 30 ALLOW_THIS_IN_INITIALIZER_LIST( | |
| 31 entry_callback_(new CancelableCompletionCallback<ViewCacheHelper>( | |
| 32 this, &ViewCacheHelper::OnIOComplete))) {} | |
| 33 ~ViewCacheHelper(); | 26 ~ViewCacheHelper(); |
| 34 | 27 |
| 35 // Formats the cache information for |key| as HTML. Returns a net error code. | 28 // Formats the cache information for |key| as HTML. Returns a net error code. |
| 36 // If this method returns ERR_IO_PENDING, |callback| will be notified when the | 29 // If this method returns ERR_IO_PENDING, |callback| will be notified when the |
| 37 // operation completes. |out| must remain valid until this operation completes | 30 // operation completes. |out| must remain valid until this operation completes |
| 38 // or the object is destroyed. | 31 // or the object is destroyed. |
| 39 int GetEntryInfoHTML(const std::string& key, URLRequestContext* context, | 32 int GetEntryInfoHTML(const std::string& key, URLRequestContext* context, |
| 40 std::string* out, CompletionCallback* callback); | 33 std::string* out, CompletionCallback* callback); |
| 41 | 34 |
| 42 // Formats the cache contents as HTML. Returns a net error code. | 35 // Formats the cache contents as HTML. Returns a net error code. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 104 |
| 112 CompletionCallbackImpl<ViewCacheHelper> cache_callback_; | 105 CompletionCallbackImpl<ViewCacheHelper> cache_callback_; |
| 113 scoped_refptr<CancelableCompletionCallback<ViewCacheHelper> > entry_callback_; | 106 scoped_refptr<CancelableCompletionCallback<ViewCacheHelper> > entry_callback_; |
| 114 | 107 |
| 115 DISALLOW_COPY_AND_ASSIGN(ViewCacheHelper); | 108 DISALLOW_COPY_AND_ASSIGN(ViewCacheHelper); |
| 116 }; | 109 }; |
| 117 | 110 |
| 118 } // namespace net. | 111 } // namespace net. |
| 119 | 112 |
| 120 #endif // NET_URL_REQUEST_VIEW_CACHE_HELPER_H_ | 113 #endif // NET_URL_REQUEST_VIEW_CACHE_HELPER_H_ |
| OLD | NEW |