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

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

Issue 2476163003: Refactor ResourceHandler API. (Closed)
Patch Set: Minor cleanups, one real fix Created 4 years, 1 month 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 #ifndef CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_
6 #define CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_ 6 #define CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "content/browser/loader/resource_handler.h" 9 #include "content/browser/loader/resource_handler.h"
10 #include "content/browser/loader/stream_writer.h" 10 #include "content/browser/loader/stream_writer.h"
(...skipping 25 matching lines...) Expand all
36 void Cancel(); 36 void Cancel();
37 37
38 // Called to the loader to resume a paused redirect. 38 // Called to the loader to resume a paused redirect.
39 void FollowRedirect(); 39 void FollowRedirect();
40 40
41 // Called to proceed with the response. 41 // Called to proceed with the response.
42 void ProceedWithResponse(); 42 void ProceedWithResponse();
43 43
44 // ResourceHandler implementation. 44 // ResourceHandler implementation.
45 void SetController(ResourceController* controller) override; 45 void SetController(ResourceController* controller) override;
46 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, 46 void OnRequestRedirected(const net::RedirectInfo& redirect_info,
47 ResourceResponse* response, 47 ResourceResponse* response,
48 bool* defer) override; 48 bool* defer_or_cancel) override;
49 bool OnResponseStarted(ResourceResponse* response, bool* defer) override; 49 void OnResponseStarted(ResourceResponse* response,
50 bool OnWillStart(const GURL& url, bool* defer) override; 50 bool* defer_or_cancel) override;
51 void OnWillStart(const GURL& url, bool* defer_or_cancel) override;
51 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, 52 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf,
52 int* buf_size, 53 int* buf_size,
53 int min_size) override; 54 int min_size) override;
54 bool OnReadCompleted(int bytes_read, bool* defer) override; 55 void OnReadCompleted(int bytes_read, bool* defer_or_cancel) override;
55 void OnResponseCompleted(const net::URLRequestStatus& status, 56 void OnResponseCompleted(const net::URLRequestStatus& status,
56 bool* defer) override; 57 bool* defer) override;
57 void OnDataDownloaded(int bytes_downloaded) override; 58 void OnDataDownloaded(int bytes_downloaded) override;
58 59
59 private: 60 private:
60 // Clears |core_| and its reference to the resource handler. After calling 61 // Clears |core_| and its reference to the resource handler. After calling
61 // this, the lifetime of the request is no longer tied to |core_|. 62 // this, the lifetime of the request is no longer tied to |core_|.
62 void DetachFromCore(); 63 void DetachFromCore();
63 64
64 NavigationURLLoaderImplCore* core_; 65 NavigationURLLoaderImplCore* core_;
65 StreamWriter writer_; 66 StreamWriter writer_;
66 ResourceDispatcherHostDelegate* resource_dispatcher_host_delegate_; 67 ResourceDispatcherHostDelegate* resource_dispatcher_host_delegate_;
67 68
68 DISALLOW_COPY_AND_ASSIGN(NavigationResourceHandler); 69 DISALLOW_COPY_AND_ASSIGN(NavigationResourceHandler);
69 }; 70 };
70 71
71 } // namespace content 72 } // namespace content
72 73
73 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_ 74 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_
OLDNEW
« no previous file with comments | « content/browser/loader/mojo_async_resource_handler_unittest.cc ('k') | content/browser/loader/navigation_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698