| 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> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "content/browser/loader/resource_handler.h" | 16 #include "content/browser/loader/resource_handler.h" |
| 17 #include "content/browser/loader/upload_progress_tracker.h" | 17 #include "content/browser/loader/upload_progress_tracker.h" |
| 18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
| 19 #include "content/common/url_loader.mojom.h" | 19 #include "content/common/url_loader.mojom.h" |
| 20 #include "content/public/common/resource_type.h" | |
| 21 #include "mojo/public/cpp/bindings/associated_binding.h" | 20 #include "mojo/public/cpp/bindings/associated_binding.h" |
| 22 #include "mojo/public/cpp/system/data_pipe.h" | 21 #include "mojo/public/cpp/system/data_pipe.h" |
| 23 #include "mojo/public/cpp/system/watcher.h" | 22 #include "mojo/public/cpp/system/watcher.h" |
| 24 #include "net/base/io_buffer.h" | 23 #include "net/base/io_buffer.h" |
| 25 | 24 |
| 26 class GURL; | 25 class GURL; |
| 27 | 26 |
| 28 namespace tracked_objects { | 27 namespace tracked_objects { |
| 29 class Location; | 28 class Location; |
| 30 } | 29 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 47 // | 46 // |
| 48 // This class can be inherited only for tests. | 47 // This class can be inherited only for tests. |
| 49 class CONTENT_EXPORT MojoAsyncResourceHandler | 48 class CONTENT_EXPORT MojoAsyncResourceHandler |
| 50 : public ResourceHandler, | 49 : public ResourceHandler, |
| 51 public NON_EXPORTED_BASE(mojom::URLLoader) { | 50 public NON_EXPORTED_BASE(mojom::URLLoader) { |
| 52 public: | 51 public: |
| 53 MojoAsyncResourceHandler( | 52 MojoAsyncResourceHandler( |
| 54 net::URLRequest* request, | 53 net::URLRequest* request, |
| 55 ResourceDispatcherHostImpl* rdh, | 54 ResourceDispatcherHostImpl* rdh, |
| 56 mojom::URLLoaderAssociatedRequest mojo_request, | 55 mojom::URLLoaderAssociatedRequest mojo_request, |
| 57 mojom::URLLoaderClientAssociatedPtr url_loader_client, | 56 mojom::URLLoaderClientAssociatedPtr url_loader_client); |
| 58 ResourceType resource_type); | |
| 59 ~MojoAsyncResourceHandler() override; | 57 ~MojoAsyncResourceHandler() override; |
| 60 | 58 |
| 61 // ResourceHandler implementation: | 59 // ResourceHandler implementation: |
| 62 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, | 60 bool OnRequestRedirected(const net::RedirectInfo& redirect_info, |
| 63 ResourceResponse* response, | 61 ResourceResponse* response, |
| 64 bool* defer) override; | 62 bool* defer) override; |
| 65 bool OnResponseStarted(ResourceResponse* response, bool* defer) override; | 63 bool OnResponseStarted(ResourceResponse* response, bool* defer) override; |
| 66 bool OnWillStart(const GURL& url, bool* defer) override; | 64 bool OnWillStart(const GURL& url, bool* defer) override; |
| 67 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, | 65 bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, |
| 68 int* buf_size, | 66 int* buf_size, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 137 |
| 140 std::unique_ptr<UploadProgressTracker> upload_progress_tracker_; | 138 std::unique_ptr<UploadProgressTracker> upload_progress_tracker_; |
| 141 | 139 |
| 142 base::WeakPtrFactory<MojoAsyncResourceHandler> weak_factory_; | 140 base::WeakPtrFactory<MojoAsyncResourceHandler> weak_factory_; |
| 143 DISALLOW_COPY_AND_ASSIGN(MojoAsyncResourceHandler); | 141 DISALLOW_COPY_AND_ASSIGN(MojoAsyncResourceHandler); |
| 144 }; | 142 }; |
| 145 | 143 |
| 146 } // namespace content | 144 } // namespace content |
| 147 | 145 |
| 148 #endif // CONTENT_BROWSER_LOADER_MOJO_ASYNC_RESOURCE_HANDLER_H_ | 146 #endif // CONTENT_BROWSER_LOADER_MOJO_ASYNC_RESOURCE_HANDLER_H_ |
| OLD | NEW |