OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_ | |
6 #define CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "content/browser/loader/resource_handler.h" | |
10 #include "content/browser/loader/stream_writer.h" | |
11 | |
12 namespace content { | |
13 | |
14 class NavigationURLLoaderImplCore; | |
15 | |
16 // PlzNavigate: The leaf ResourceHandler used with NavigationURLLoaderImplCore. | |
17 class NavigationResourceHandler : public ResourceHandler { | |
18 public: | |
19 NavigationResourceHandler(net::URLRequest* request, | |
20 NavigationURLLoaderImplCore* core); | |
21 ~NavigationResourceHandler() override; | |
22 | |
23 // Called by the loader the cancel the request. | |
24 void Cancel(); | |
25 | |
26 // Called to the loader to resume a paused redirect. | |
27 void FollowRedirect(); | |
28 | |
29 // ResourceHandler implementation. | |
30 void SetController(ResourceController* controller) override; | |
31 | |
nasko
2014/10/23 22:36:16
nit: No empty lines between methods from the same
davidben
2014/10/27 20:46:04
Done.
| |
32 bool OnUploadProgress(uint64 position, uint64 size) override; | |
33 | |
34 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, | |
35 ResourceResponse* response, | |
36 bool* defer) override; | |
37 | |
38 bool OnResponseStarted(ResourceResponse* response, | |
39 bool* defer) override; | |
nasko
2014/10/23 22:36:16
nit: this should fit on previous line.
davidben
2014/10/27 20:46:04
Done.
| |
40 | |
41 bool OnWillStart(const GURL& url, bool* defer) override; | |
42 | |
43 bool OnBeforeNetworkStart(const GURL& url, bool* defer) override; | |
44 | |
45 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, | |
46 int* buf_size, | |
47 int min_size) override; | |
48 | |
49 bool OnReadCompleted(int bytes_read, bool* defer) override; | |
50 | |
51 void OnResponseCompleted(const net::URLRequestStatus& status, | |
52 const std::string& security_info, | |
53 bool* defer) override; | |
54 | |
55 void OnDataDownloaded(int bytes_downloaded) override; | |
56 | |
57 private: | |
58 // Clears |core_| and its reference to the resource handler. After calling | |
59 // this, the lifetime of the request is no longer tied to |core_|. | |
60 void DetachFromCore(); | |
61 | |
62 NavigationURLLoaderImplCore* core_; | |
63 StreamWriter writer_; | |
64 | |
65 DISALLOW_COPY_AND_ASSIGN(NavigationResourceHandler); | |
66 }; | |
67 | |
68 } // namespace content | |
69 | |
70 #endif // CONTENT_BROWSER_LOADER_CERTIFICATE_RESOURCE_HANDLER_H_ | |
OLD | NEW |