| OLD | NEW |
| 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_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ | 5 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
| 6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ | 6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 const ProxyInfo& proxy_info() const; | 73 const ProxyInfo& proxy_info() const; |
| 74 | 74 |
| 75 // Indicates whether or not this job is performing a preconnect. | 75 // Indicates whether or not this job is performing a preconnect. |
| 76 bool IsPreconnecting() const; | 76 bool IsPreconnecting() const; |
| 77 | 77 |
| 78 // Indicates whether or not this Job has been orphaned by a Request. | 78 // Indicates whether or not this Job has been orphaned by a Request. |
| 79 bool IsOrphaned() const; | 79 bool IsOrphaned() const; |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 enum State { | 82 enum State { |
| 83 STATE_START, |
| 83 STATE_RESOLVE_PROXY, | 84 STATE_RESOLVE_PROXY, |
| 84 STATE_RESOLVE_PROXY_COMPLETE, | 85 STATE_RESOLVE_PROXY_COMPLETE, |
| 85 | 86 |
| 86 // Note that when Alternate-Protocol says we can connect to an alternate | 87 // Note that when Alternate-Protocol says we can connect to an alternate |
| 87 // port using a different protocol, we have the choice of communicating over | 88 // port using a different protocol, we have the choice of communicating over |
| 88 // the original protocol, or speaking the alternate protocol (currently, | 89 // the original protocol, or speaking the alternate protocol (currently, |
| 89 // only npn-spdy) over an alternate port. For a cold page load, the http | 90 // only npn-spdy) over an alternate port. For a cold page load, the http |
| 90 // connection that delivers the http response that has the | 91 // connection that delivers the http response that has the |
| 91 // Alternate-Protocol header will already be warm. So, blocking the next | 92 // Alternate-Protocol header will already be warm. So, blocking the next |
| 92 // http request on establishing a new npn-spdy connection would incur extra | 93 // http request on establishing a new npn-spdy connection would incur extra |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 128 |
| 128 void OnIOComplete(int result); | 129 void OnIOComplete(int result); |
| 129 int RunLoop(int result); | 130 int RunLoop(int result); |
| 130 int DoLoop(int result); | 131 int DoLoop(int result); |
| 131 int StartInternal(); | 132 int StartInternal(); |
| 132 | 133 |
| 133 // Each of these methods corresponds to a State value. Those with an input | 134 // Each of these methods corresponds to a State value. Those with an input |
| 134 // argument receive the result from the previous state. If a method returns | 135 // argument receive the result from the previous state. If a method returns |
| 135 // ERR_IO_PENDING, then the result from OnIOComplete will be passed to the | 136 // ERR_IO_PENDING, then the result from OnIOComplete will be passed to the |
| 136 // next state method as the result arg. | 137 // next state method as the result arg. |
| 138 int DoStart(); |
| 137 int DoResolveProxy(); | 139 int DoResolveProxy(); |
| 138 int DoResolveProxyComplete(int result); | 140 int DoResolveProxyComplete(int result); |
| 139 int DoWaitForJob(); | 141 int DoWaitForJob(); |
| 140 int DoWaitForJobComplete(int result); | 142 int DoWaitForJobComplete(int result); |
| 141 int DoInitConnection(); | 143 int DoInitConnection(); |
| 142 int DoInitConnectionComplete(int result); | 144 int DoInitConnectionComplete(int result); |
| 143 int DoWaitingUserAction(int result); | 145 int DoWaitingUserAction(int result); |
| 144 int DoCreateStream(); | 146 int DoCreateStream(); |
| 145 int DoCreateStreamComplete(int result); | 147 int DoCreateStreamComplete(int result); |
| 146 int DoRestartTunnelAuth(); | 148 int DoRestartTunnelAuth(); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 bool existing_available_pipeline_; | 277 bool existing_available_pipeline_; |
| 276 | 278 |
| 277 base::WeakPtrFactory<Job> ptr_factory_; | 279 base::WeakPtrFactory<Job> ptr_factory_; |
| 278 | 280 |
| 279 DISALLOW_COPY_AND_ASSIGN(Job); | 281 DISALLOW_COPY_AND_ASSIGN(Job); |
| 280 }; | 282 }; |
| 281 | 283 |
| 282 } // namespace net | 284 } // namespace net |
| 283 | 285 |
| 284 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ | 286 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
| OLD | NEW |