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

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

Issue 877443002: Naming and refactoring changes to SdchDictionaryFetcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync'd to p313032. Created 5 years, 11 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // TODO(rdsmith): This class needs to delegate URLRequest::Delegate methods 5 // TODO(rdsmith): This class needs to delegate URLRequest::Delegate methods
6 // to the net/ embedder for correct implementation of authentication. 6 // to the net/ embedder for correct implementation of authentication.
7 // Specifically, this class needs the embedder to provide functionality 7 // Specifically, this class needs the embedder to provide functionality
8 // corresponding to 8 // corresponding to
9 // URLRequest::Delegate::{OnAuthRequired,OnCertificateRequested}. 9 // URLRequest::Delegate::{OnAuthRequired,OnCertificateRequested}.
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // Cancel any in-progress requests. 54 // Cancel any in-progress requests.
55 void Cancel(); 55 void Cancel();
56 56
57 // Implementation of URLRequest::Delegate methods. 57 // Implementation of URLRequest::Delegate methods.
58 void OnResponseStarted(URLRequest* request) override; 58 void OnResponseStarted(URLRequest* request) override;
59 void OnReadCompleted(URLRequest* request, int bytes_read) override; 59 void OnReadCompleted(URLRequest* request, int bytes_read) override;
60 60
61 private: 61 private:
62 enum State { 62 enum State {
63 STATE_NONE, 63 STATE_NONE,
64 STATE_IDLE, 64 STATE_SEND_REQUEST,
65 STATE_REQUEST_STARTED, 65 STATE_SEND_REQUEST_COMPLETE,
66 STATE_REQUEST_READING, 66 STATE_READ_BODY,
67 STATE_READ_BODY_COMPLETE,
67 STATE_REQUEST_COMPLETE, 68 STATE_REQUEST_COMPLETE,
68 }; 69 };
69 70
71 // Figure out and return proper error code based on request status
72 // and bytes read, and do state transition if the request is complete.
73 int HandleReadCompletion(int bytes_read);
74
70 // State machine implementation. 75 // State machine implementation.
71 int DoLoop(int rv); 76 int DoLoop(int rv);
72 int DoDispatchRequest(int rv); 77 int DoSendRequest(int rv);
73 int DoRequestStarted(int rv); 78 int DoSendRequestComplete(int rv);
74 int DoRead(int rv); 79 int DoReadBody(int rv);
80 int DoReadBodyComplete(int rv);
75 int DoCompleteRequest(int rv); 81 int DoCompleteRequest(int rv);
76 82
77 State next_state_; 83 State next_state_;
78 bool in_loop_; 84 bool in_loop_;
79 85
80 // A queue of URLs that are being used to download dictionaries. 86 // A queue of URLs that are being used to download dictionaries.
81 std::queue<GURL> fetch_queue_; 87 std::queue<GURL> fetch_queue_;
82 88
83 // The request and buffer used for getting the current dictionary 89 // The request and buffer used for getting the current dictionary
84 // Both are null when a fetch is not in progress. 90 // Both are null when a fetch is not in progress.
(...skipping 25 matching lines...) Expand all
110 const OnDictionaryFetchedCallback dictionary_fetched_callback_; 116 const OnDictionaryFetchedCallback dictionary_fetched_callback_;
111 117
112 base::WeakPtrFactory<SdchDictionaryFetcher> weak_factory_; 118 base::WeakPtrFactory<SdchDictionaryFetcher> weak_factory_;
113 119
114 DISALLOW_COPY_AND_ASSIGN(SdchDictionaryFetcher); 120 DISALLOW_COPY_AND_ASSIGN(SdchDictionaryFetcher);
115 }; 121 };
116 122
117 } // namespace net 123 } // namespace net
118 124
119 #endif // NET_URL_REQUEST_SDCH_DICTIONARY_FETCHER_H_ 125 #endif // NET_URL_REQUEST_SDCH_DICTIONARY_FETCHER_H_
OLDNEW
« no previous file with comments | « no previous file | net/url_request/sdch_dictionary_fetcher.cc » ('j') | net/url_request/sdch_dictionary_fetcher.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698