| OLD | NEW |
| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, | 67 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, |
| 68 int* buf_size, | 68 int* buf_size, |
| 69 int min_size) override; | 69 int min_size) override; |
| 70 bool OnReadCompleted(int bytes_read, bool* defer) override; | 70 bool OnReadCompleted(int bytes_read, bool* defer) override; |
| 71 void OnResponseCompleted(const net::URLRequestStatus& status, | 71 void OnResponseCompleted(const net::URLRequestStatus& status, |
| 72 bool* defer) override; | 72 bool* defer) override; |
| 73 void OnDataDownloaded(int bytes_downloaded) override; | 73 void OnDataDownloaded(int bytes_downloaded) override; |
| 74 | 74 |
| 75 // mojom::URLLoader implementation: | 75 // mojom::URLLoader implementation: |
| 76 void FollowRedirect() override; | 76 void FollowRedirect() override; |
| 77 void SetPriority(mojom::RequestPriority priority, |
| 78 int32_t intra_priority_value) override; |
| 77 | 79 |
| 78 void OnWritableForTesting(); | 80 void OnWritableForTesting(); |
| 79 static void SetAllocationSizeForTesting(size_t size); | 81 static void SetAllocationSizeForTesting(size_t size); |
| 80 static constexpr size_t kDefaultAllocationSize = 512 * 1024; | 82 static constexpr size_t kDefaultAllocationSize = 512 * 1024; |
| 81 | 83 |
| 82 protected: | 84 protected: |
| 83 // These functions can be overriden only for tests. | 85 // These functions can be overriden only for tests. |
| 84 virtual MojoResult BeginWrite(void** data, uint32_t* available); | 86 virtual MojoResult BeginWrite(void** data, uint32_t* available); |
| 85 virtual MojoResult EndWrite(uint32_t written); | 87 virtual MojoResult EndWrite(uint32_t written); |
| 86 virtual net::IOBufferWithSize* GetResponseMetadata(net::URLRequest* request); | 88 virtual net::IOBufferWithSize* GetResponseMetadata(net::URLRequest* request); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 141 |
| 140 std::unique_ptr<UploadProgressTracker> upload_progress_tracker_; | 142 std::unique_ptr<UploadProgressTracker> upload_progress_tracker_; |
| 141 | 143 |
| 142 base::WeakPtrFactory<MojoAsyncResourceHandler> weak_factory_; | 144 base::WeakPtrFactory<MojoAsyncResourceHandler> weak_factory_; |
| 143 DISALLOW_COPY_AND_ASSIGN(MojoAsyncResourceHandler); | 145 DISALLOW_COPY_AND_ASSIGN(MojoAsyncResourceHandler); |
| 144 }; | 146 }; |
| 145 | 147 |
| 146 } // namespace content | 148 } // namespace content |
| 147 | 149 |
| 148 #endif // CONTENT_BROWSER_LOADER_MOJO_ASYNC_RESOURCE_HANDLER_H_ | 150 #endif // CONTENT_BROWSER_LOADER_MOJO_ASYNC_RESOURCE_HANDLER_H_ |
| OLD | NEW |