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

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

Issue 2919313004: Get rid of URLLoaderFactory in browser-side case (Closed)
Patch Set: . Created 3 years, 6 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 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 protected: 91 protected:
92 // These functions can be overriden only for tests. 92 // These functions can be overriden only for tests.
93 virtual MojoResult BeginWrite(void** data, uint32_t* available); 93 virtual MojoResult BeginWrite(void** data, uint32_t* available);
94 virtual MojoResult EndWrite(uint32_t written); 94 virtual MojoResult EndWrite(uint32_t written);
95 virtual net::IOBufferWithSize* GetResponseMetadata(net::URLRequest* request); 95 virtual net::IOBufferWithSize* GetResponseMetadata(net::URLRequest* request);
96 96
97 private: 97 private:
98 class SharedWriter; 98 class SharedWriter;
99 class WriterIOBuffer; 99 class WriterIOBuffer;
100 100
101 // mojom::URLLoader implementation:
102 void Start(mojom::URLLoaderAssociatedRequest mojo_request,
103 mojom::URLLoaderClientPtr url_loader_client) override;
104
101 // This funcion copies data stored in |buffer_| to |shared_writer_| and 105 // This funcion copies data stored in |buffer_| to |shared_writer_| and
102 // resets |buffer_| to a WriterIOBuffer when all bytes are copied. Returns 106 // resets |buffer_| to a WriterIOBuffer when all bytes are copied. Returns
103 // true when done successfully. 107 // true when done successfully.
104 bool CopyReadDataToDataPipe(bool* defer); 108 bool CopyReadDataToDataPipe(bool* defer);
105 // Allocates a WriterIOBuffer and set it to |*buf|. Returns true when done 109 // Allocates a WriterIOBuffer and set it to |*buf|. Returns true when done
106 // successfully. 110 // successfully.
107 bool AllocateWriterIOBuffer(scoped_refptr<net::IOBufferWithSize>* buf, 111 bool AllocateWriterIOBuffer(scoped_refptr<net::IOBufferWithSize>* buf,
108 bool* defer); 112 bool* defer);
109 113
110 bool CheckForSufficientResource(); 114 bool CheckForSufficientResource();
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 161
158 std::unique_ptr<UploadProgressTracker> upload_progress_tracker_; 162 std::unique_ptr<UploadProgressTracker> upload_progress_tracker_;
159 163
160 base::WeakPtrFactory<MojoAsyncResourceHandler> weak_factory_; 164 base::WeakPtrFactory<MojoAsyncResourceHandler> weak_factory_;
161 DISALLOW_COPY_AND_ASSIGN(MojoAsyncResourceHandler); 165 DISALLOW_COPY_AND_ASSIGN(MojoAsyncResourceHandler);
162 }; 166 };
163 167
164 } // namespace content 168 } // namespace content
165 169
166 #endif // CONTENT_BROWSER_LOADER_MOJO_ASYNC_RESOURCE_HANDLER_H_ 170 #endif // CONTENT_BROWSER_LOADER_MOJO_ASYNC_RESOURCE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698