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

Side by Side Diff: content/browser/loader/mojo_async_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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_MOJO_ASYNC_RESOURCE_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_LOADER_MOJO_ASYNC_RESOURCE_HANDLER_H_
6 #define CONTENT_BROWSER_LOADER_MOJO_ASYNC_RESOURCE_HANDLER_H_ 6 #define CONTENT_BROWSER_LOADER_MOJO_ASYNC_RESOURCE_HANDLER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 public NON_EXPORTED_BASE(mojom::URLLoader) { 42 public NON_EXPORTED_BASE(mojom::URLLoader) {
43 public: 43 public:
44 MojoAsyncResourceHandler( 44 MojoAsyncResourceHandler(
45 net::URLRequest* request, 45 net::URLRequest* request,
46 ResourceDispatcherHostImpl* rdh, 46 ResourceDispatcherHostImpl* rdh,
47 mojom::URLLoaderAssociatedRequest mojo_request, 47 mojom::URLLoaderAssociatedRequest mojo_request,
48 mojom::URLLoaderClientAssociatedPtr url_loader_client); 48 mojom::URLLoaderClientAssociatedPtr url_loader_client);
49 ~MojoAsyncResourceHandler() override; 49 ~MojoAsyncResourceHandler() override;
50 50
51 // ResourceHandler implementation: 51 // ResourceHandler implementation:
52 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, 52 void OnRequestRedirected(const net::RedirectInfo& redirect_info,
53 ResourceResponse* response, 53 ResourceResponse* response,
54 bool* defer) override; 54 bool* defer_or_cancel) override;
55 bool OnResponseStarted(ResourceResponse* response, bool* defer) override; 55 void OnResponseStarted(ResourceResponse* response,
56 bool OnWillStart(const GURL& url, bool* defer) override; 56 bool* defer_or_cancel) override;
57 void OnWillStart(const GURL& url, bool* defer_or_cancel) override;
57 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, 58 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf,
58 int* buf_size, 59 int* buf_size,
59 int min_size) override; 60 int min_size) override;
60 bool OnReadCompleted(int bytes_read, bool* defer) override; 61 void OnReadCompleted(int bytes_read, bool* defer_or_cancel) override;
61 void OnResponseCompleted(const net::URLRequestStatus& status, 62 void OnResponseCompleted(const net::URLRequestStatus& status,
62 bool* defer) override; 63 bool* defer) override;
63 void OnDataDownloaded(int bytes_downloaded) override; 64 void OnDataDownloaded(int bytes_downloaded) override;
64 65
65 // mojom::URLLoader implementation 66 // mojom::URLLoader implementation
66 void FollowRedirect() override; 67 void FollowRedirect() override;
67 68
68 void OnWritableForTesting(); 69 void OnWritableForTesting();
69 static void SetAllocationSizeForTesting(size_t size); 70 static void SetAllocationSizeForTesting(size_t size);
70 static constexpr size_t kDefaultAllocationSize = 512 * 1024; 71 static constexpr size_t kDefaultAllocationSize = 512 * 1024;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 size_t buffer_offset_ = 0; 112 size_t buffer_offset_ = 0;
112 size_t buffer_bytes_read_ = 0; 113 size_t buffer_bytes_read_ = 0;
113 scoped_refptr<SharedWriter> shared_writer_; 114 scoped_refptr<SharedWriter> shared_writer_;
114 115
115 DISALLOW_COPY_AND_ASSIGN(MojoAsyncResourceHandler); 116 DISALLOW_COPY_AND_ASSIGN(MojoAsyncResourceHandler);
116 }; 117 };
117 118
118 } // namespace content 119 } // namespace content
119 120
120 #endif // CONTENT_BROWSER_LOADER_MOJO_ASYNC_RESOURCE_HANDLER_H_ 121 #endif // CONTENT_BROWSER_LOADER_MOJO_ASYNC_RESOURCE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698