Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Side by Side Diff: net/url_request/view_cache_helper.h

Issue 6730034: Remove all "net::" prefixes under net/url_request for code that's (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed indentation Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | net/url_request/view_cache_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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
(...skipping 12 matching lines...) Expand all
23 class ViewCacheHelper { 23 class ViewCacheHelper {
24 public: 24 public:
25 ViewCacheHelper(); 25 ViewCacheHelper();
26 ~ViewCacheHelper(); 26 ~ViewCacheHelper();
27 27
28 // 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.
29 // 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
30 // operation completes. |out| must remain valid until this operation completes 30 // operation completes. |out| must remain valid until this operation completes
31 // or the object is destroyed. 31 // or the object is destroyed.
32 int GetEntryInfoHTML(const std::string& key, 32 int GetEntryInfoHTML(const std::string& key,
33 net::URLRequestContext* context, 33 URLRequestContext* context,
34 std::string* out, 34 std::string* out,
35 CompletionCallback* callback); 35 CompletionCallback* callback);
36 36
37 // Formats the cache contents as HTML. Returns a net error code. 37 // Formats the cache contents as HTML. Returns a net error code.
38 // If this method returns ERR_IO_PENDING, |callback| will be notified when the 38 // If this method returns ERR_IO_PENDING, |callback| will be notified when the
39 // operation completes. |out| must remain valid until this operation completes 39 // operation completes. |out| must remain valid until this operation completes
40 // or the object is destroyed. |url_prefix| will be prepended to each entry 40 // or the object is destroyed. |url_prefix| will be prepended to each entry
41 // key as a link to the entry. 41 // key as a link to the entry.
42 int GetContentsHTML(net::URLRequestContext* context, 42 int GetContentsHTML(URLRequestContext* context,
43 const std::string& url_prefix, 43 const std::string& url_prefix,
44 std::string* out, 44 std::string* out,
45 CompletionCallback* callback); 45 CompletionCallback* callback);
46 46
47 private: 47 private:
48 enum State { 48 enum State {
49 STATE_NONE, 49 STATE_NONE,
50 STATE_GET_BACKEND, 50 STATE_GET_BACKEND,
51 STATE_GET_BACKEND_COMPLETE, 51 STATE_GET_BACKEND_COMPLETE,
52 STATE_OPEN_NEXT_ENTRY, 52 STATE_OPEN_NEXT_ENTRY,
53 STATE_OPEN_NEXT_ENTRY_COMPLETE, 53 STATE_OPEN_NEXT_ENTRY_COMPLETE,
54 STATE_OPEN_ENTRY, 54 STATE_OPEN_ENTRY,
55 STATE_OPEN_ENTRY_COMPLETE, 55 STATE_OPEN_ENTRY_COMPLETE,
56 STATE_READ_RESPONSE, 56 STATE_READ_RESPONSE,
57 STATE_READ_RESPONSE_COMPLETE, 57 STATE_READ_RESPONSE_COMPLETE,
58 STATE_READ_DATA, 58 STATE_READ_DATA,
59 STATE_READ_DATA_COMPLETE 59 STATE_READ_DATA_COMPLETE
60 }; 60 };
61 61
62 // Implements GetEntryInfoHTML and GetContentsHTML. 62 // Implements GetEntryInfoHTML and GetContentsHTML.
63 int GetInfoHTML(const std::string& key, 63 int GetInfoHTML(const std::string& key,
64 net::URLRequestContext* context, 64 URLRequestContext* context,
65 const std::string& url_prefix, 65 const std::string& url_prefix,
66 std::string* out, 66 std::string* out,
67 CompletionCallback* callback); 67 CompletionCallback* callback);
68 68
69 // This is a helper function used to trigger a completion callback. It may 69 // This is a helper function used to trigger a completion callback. It may
70 // only be called if callback_ is non-null. 70 // only be called if callback_ is non-null.
71 void DoCallback(int rv); 71 void DoCallback(int rv);
72 72
73 // This will trigger the completion callback if appropriate. 73 // This will trigger the completion callback if appropriate.
74 void HandleResult(int rv); 74 void HandleResult(int rv);
(...skipping 11 matching lines...) Expand all
86 int DoOpenEntry(); 86 int DoOpenEntry();
87 int DoOpenEntryComplete(int result); 87 int DoOpenEntryComplete(int result);
88 int DoReadResponse(); 88 int DoReadResponse();
89 int DoReadResponseComplete(int result); 89 int DoReadResponseComplete(int result);
90 int DoReadData(); 90 int DoReadData();
91 int DoReadDataComplete(int result); 91 int DoReadDataComplete(int result);
92 92
93 // Called to signal completion of asynchronous IO. 93 // Called to signal completion of asynchronous IO.
94 void OnIOComplete(int result); 94 void OnIOComplete(int result);
95 95
96 scoped_refptr<net::URLRequestContext> context_; 96 scoped_refptr<URLRequestContext> context_;
97 disk_cache::Backend* disk_cache_; 97 disk_cache::Backend* disk_cache_;
98 disk_cache::Entry* entry_; 98 disk_cache::Entry* entry_;
99 void* iter_; 99 void* iter_;
100 scoped_refptr<net::IOBuffer> buf_; 100 scoped_refptr<IOBuffer> buf_;
101 int buf_len_; 101 int buf_len_;
102 int index_; 102 int index_;
103 103
104 std::string key_; 104 std::string key_;
105 std::string url_prefix_; 105 std::string url_prefix_;
106 std::string* data_; 106 std::string* data_;
107 CompletionCallback* callback_; 107 CompletionCallback* callback_;
108 108
109 State next_state_; 109 State next_state_;
110 110
111 CompletionCallbackImpl<ViewCacheHelper> cache_callback_; 111 CompletionCallbackImpl<ViewCacheHelper> cache_callback_;
112 scoped_refptr<CancelableCompletionCallback<ViewCacheHelper> > entry_callback_; 112 scoped_refptr<CancelableCompletionCallback<ViewCacheHelper> > entry_callback_;
113 113
114 DISALLOW_COPY_AND_ASSIGN(ViewCacheHelper); 114 DISALLOW_COPY_AND_ASSIGN(ViewCacheHelper);
115 }; 115 };
116 116
117 } // namespace net. 117 } // namespace net.
118 118
119 #endif // NET_URL_REQUEST_VIEW_CACHE_HELPER_H_ 119 #endif // NET_URL_REQUEST_VIEW_CACHE_HELPER_H_
OLDNEW
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | net/url_request/view_cache_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698