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

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

Issue 2574063003: Move ResourceHandler deferred actions ahead of external protocol handling. (Closed)
Patch Set: Adds external protocol handling tests for sync and async cases. Created 3 years, 12 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 <memory> 8 #include <memory>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "content/browser/loader/resource_controller.h" 14 #include "content/browser/loader/resource_controller.h"
15 #include "content/browser/ssl/ssl_client_auth_handler.h" 15 #include "content/browser/ssl/ssl_client_auth_handler.h"
16 #include "content/browser/ssl/ssl_error_handler.h" 16 #include "content/browser/ssl/ssl_error_handler.h"
17 #include "content/common/content_export.h" 17 #include "content/common/content_export.h"
18 #include "net/url_request/url_request.h" 18 #include "net/url_request/url_request.h"
19 #include "url/gurl.h"
19 20
20 namespace net { 21 namespace net {
21 class X509Certificate; 22 class X509Certificate;
22 } 23 }
23 24
24 namespace content { 25 namespace content {
25 class ResourceDispatcherHostLoginDelegate; 26 class ResourceDispatcherHostLoginDelegate;
26 class ResourceHandler; 27 class ResourceHandler;
27 class ResourceLoaderDelegate; 28 class ResourceLoaderDelegate;
28 class ResourceRequestInfoImpl; 29 class ResourceRequestInfoImpl;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 void CancelCertificateSelection() override; 77 void CancelCertificateSelection() override;
77 78
78 // ResourceController implementation: 79 // ResourceController implementation:
79 void Resume() override; 80 void Resume() override;
80 void Cancel() override; 81 void Cancel() override;
81 void CancelAndIgnore() override; 82 void CancelAndIgnore() override;
82 void CancelWithError(int error_code) override; 83 void CancelWithError(int error_code) override;
83 84
84 void StartRequestInternal(); 85 void StartRequestInternal();
85 void CancelRequestInternal(int error, bool from_renderer); 86 void CancelRequestInternal(int error, bool from_renderer);
87 void FollowDeferredRedirectInternal();
86 void CompleteResponseStarted(); 88 void CompleteResponseStarted();
87 void ReadMore(bool is_continuation); 89 void ReadMore(bool is_continuation);
88 void ResumeReading(); 90 void ResumeReading();
89 // Passes a read result to the handler. 91 // Passes a read result to the handler.
90 void CompleteRead(int bytes_read); 92 void CompleteRead(int bytes_read);
91 void ResponseCompleted(); 93 void ResponseCompleted();
92 void CallDidFinishLoading(); 94 void CallDidFinishLoading();
93 void RecordHistograms(); 95 void RecordHistograms();
94 96
95 bool is_deferred() const { return deferred_stage_ != DEFERRED_NONE; } 97 bool is_deferred() const { return deferred_stage_ != DEFERRED_NONE; }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 134
133 // Called when a navigation has finished transfer. 135 // Called when a navigation has finished transfer.
134 base::Closure on_transfer_complete_callback_; 136 base::Closure on_transfer_complete_callback_;
135 137
136 // Instrumentation add to investigate http://crbug.com/503306. 138 // Instrumentation add to investigate http://crbug.com/503306.
137 // TODO(mmenke): Remove once bug is fixed. 139 // TODO(mmenke): Remove once bug is fixed.
138 int times_cancelled_before_request_start_; 140 int times_cancelled_before_request_start_;
139 bool started_request_; 141 bool started_request_;
140 int times_cancelled_after_request_start_; 142 int times_cancelled_after_request_start_;
141 143
144 // Stores the URL from a deferred redirect.
145 GURL deferred_redirect_url_;
146
142 base::WeakPtrFactory<ResourceLoader> weak_ptr_factory_; 147 base::WeakPtrFactory<ResourceLoader> weak_ptr_factory_;
143 148
144 DISALLOW_COPY_AND_ASSIGN(ResourceLoader); 149 DISALLOW_COPY_AND_ASSIGN(ResourceLoader);
145 }; 150 };
146 151
147 } // namespace content 152 } // namespace content
148 153
149 #endif // CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_ 154 #endif // CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/loader/resource_loader.cc » ('j') | content/browser/loader/resource_loader_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698