| 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 #include "content/browser/loader/mojo_async_resource_handler.h" | 5 #include "content/browser/loader/mojo_async_resource_handler.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 // This member is for keeping the writer alive. | 97 // This member is for keeping the writer alive. |
| 98 scoped_refptr<SharedWriter> writer_; | 98 scoped_refptr<SharedWriter> writer_; |
| 99 | 99 |
| 100 DISALLOW_COPY_AND_ASSIGN(WriterIOBuffer); | 100 DISALLOW_COPY_AND_ASSIGN(WriterIOBuffer); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 MojoAsyncResourceHandler::MojoAsyncResourceHandler( | 103 MojoAsyncResourceHandler::MojoAsyncResourceHandler( |
| 104 net::URLRequest* request, | 104 net::URLRequest* request, |
| 105 ResourceDispatcherHostImpl* rdh, | 105 ResourceDispatcherHostImpl* rdh, |
| 106 mojo::InterfaceRequest<mojom::URLLoader> mojo_request, | 106 mojom::URLLoaderAssociatedRequest mojo_request, |
| 107 mojom::URLLoaderClientPtr url_loader_client) | 107 mojom::URLLoaderClientAssociatedPtr url_loader_client) |
| 108 : ResourceHandler(request), | 108 : ResourceHandler(request), |
| 109 rdh_(rdh), | 109 rdh_(rdh), |
| 110 binding_(this, std::move(mojo_request)), | 110 binding_(this, std::move(mojo_request)), |
| 111 url_loader_client_(std::move(url_loader_client)) { | 111 url_loader_client_(std::move(url_loader_client)) { |
| 112 DCHECK(url_loader_client_); | 112 DCHECK(url_loader_client_); |
| 113 InitializeResourceBufferConstants(); | 113 InitializeResourceBufferConstants(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 MojoAsyncResourceHandler::~MojoAsyncResourceHandler() { | 116 MojoAsyncResourceHandler::~MojoAsyncResourceHandler() { |
| 117 if (has_checked_for_sufficient_resources_) | 117 if (has_checked_for_sufficient_resources_) |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 388 |
| 389 controller()->CancelWithError(net::ERR_INSUFFICIENT_RESOURCES); | 389 controller()->CancelWithError(net::ERR_INSUFFICIENT_RESOURCES); |
| 390 return false; | 390 return false; |
| 391 } | 391 } |
| 392 | 392 |
| 393 void MojoAsyncResourceHandler::OnWritable(MojoResult unused) { | 393 void MojoAsyncResourceHandler::OnWritable(MojoResult unused) { |
| 394 Resume(); | 394 Resume(); |
| 395 } | 395 } |
| 396 | 396 |
| 397 } // namespace content | 397 } // namespace content |
| OLD | NEW |