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

Side by Side Diff: content/browser/loader/resource_loader.h

Issue 25772002: Allows prefetch requests to live beyond the renderer by delaying (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added DetachableType function for generality. Created 7 years, 2 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_ 5 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_
6 #define CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_ 6 #define CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.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"
11 #include "base/timer/timer.h"
11 #include "content/browser/loader/resource_handler.h" 12 #include "content/browser/loader/resource_handler.h"
12 #include "content/browser/ssl/ssl_error_handler.h" 13 #include "content/browser/ssl/ssl_error_handler.h"
13 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
14 #include "content/public/browser/resource_controller.h" 15 #include "content/public/browser/resource_controller.h"
15 #include "net/url_request/url_request.h" 16 #include "net/url_request/url_request.h"
16 17
17 namespace net { 18 namespace net {
18 class ClientCertStore; 19 class ClientCertStore;
19 } 20 }
20 21
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 virtual void ContinueSSLRequest(const GlobalRequestID& id) OVERRIDE; 91 virtual void ContinueSSLRequest(const GlobalRequestID& id) OVERRIDE;
91 92
92 // ResourceController implementation: 93 // ResourceController implementation:
93 virtual void Resume() OVERRIDE; 94 virtual void Resume() OVERRIDE;
94 virtual void Cancel() OVERRIDE; 95 virtual void Cancel() OVERRIDE;
95 virtual void CancelAndIgnore() OVERRIDE; 96 virtual void CancelAndIgnore() OVERRIDE;
96 virtual void CancelWithError(int error_code) OVERRIDE; 97 virtual void CancelWithError(int error_code) OVERRIDE;
97 98
98 void StartRequestInternal(); 99 void StartRequestInternal();
99 void CancelRequestInternal(int error, bool from_renderer); 100 void CancelRequestInternal(int error, bool from_renderer);
101 bool DelayCancelForPrefetch(const ResourceRequestInfoImpl& info,
102 bool from_renderer);
100 void CompleteResponseStarted(); 103 void CompleteResponseStarted();
101 void StartReading(bool is_continuation); 104 void StartReading(bool is_continuation);
102 void ResumeReading(); 105 void ResumeReading();
103 void ReadMore(int* bytes_read); 106 void ReadMore(int* bytes_read);
104 void CompleteRead(int bytes_read); 107 void CompleteRead(int bytes_read);
105 void ResponseCompleted(); 108 void ResponseCompleted();
106 void CallDidFinishLoading(); 109 void CallDidFinishLoading();
107 110
108 bool is_deferred() const { return deferred_stage_ != DEFERRED_NONE; } 111 bool is_deferred() const { return deferred_stage_ != DEFERRED_NONE; }
109 112
(...skipping 16 matching lines...) Expand all
126 uint64 last_upload_position_; 129 uint64 last_upload_position_;
127 bool waiting_for_upload_progress_ack_; 130 bool waiting_for_upload_progress_ack_;
128 base::TimeTicks last_upload_ticks_; 131 base::TimeTicks last_upload_ticks_;
129 base::TimeTicks read_deferral_start_time_; 132 base::TimeTicks read_deferral_start_time_;
130 133
131 // Indicates that we are in a state of being transferred to a new downstream 134 // Indicates that we are in a state of being transferred to a new downstream
132 // consumer. We are waiting for a notification to complete the transfer, at 135 // consumer. We are waiting for a notification to complete the transfer, at
133 // which point we'll receive a new ResourceHandler. 136 // which point we'll receive a new ResourceHandler.
134 bool is_transferring_; 137 bool is_transferring_;
135 138
139 scoped_ptr<base::OneShotTimer<ResourceLoader> > prefetch_timer_;
140
136 scoped_ptr<net::ClientCertStore> client_cert_store_; 141 scoped_ptr<net::ClientCertStore> client_cert_store_;
137 142
143 // The time in ms to delay a cancel of a prefetch unless otherwise specified
144 // by a flag.
145 static int default_delay_prefetch_cancel_ms_;
mmenke 2013/10/11 16:39:07 This doesn't need to be in the header, and should
jkarlin2 2013/10/11 18:37:04 Done. Ah right, I changed the meaning of this. Th
146
138 base::WeakPtrFactory<ResourceLoader> weak_ptr_factory_; 147 base::WeakPtrFactory<ResourceLoader> weak_ptr_factory_;
139 148
140 DISALLOW_COPY_AND_ASSIGN(ResourceLoader); 149 DISALLOW_COPY_AND_ASSIGN(ResourceLoader);
141 }; 150 };
142 151
143 } // namespace content 152 } // namespace content
144 153
145 #endif // CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_ 154 #endif // CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698