| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_NAVIGATION_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "content/browser/loader/mojo_stream_writer.h" |
| 9 #include "content/browser/loader/resource_handler.h" | 10 #include "content/browser/loader/resource_handler.h" |
| 10 #include "content/browser/loader/stream_writer.h" | |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 class NavigationURLLoaderImplCore; | 14 class NavigationURLLoaderImplCore; |
| 15 | 15 |
| 16 // PlzNavigate: The leaf ResourceHandler used with NavigationURLLoaderImplCore. | 16 // PlzNavigate: The leaf ResourceHandler used with NavigationURLLoaderImplCore. |
| 17 class NavigationResourceHandler : public ResourceHandler { | 17 class NavigationResourceHandler : public ResourceHandler { |
| 18 public: | 18 public: |
| 19 NavigationResourceHandler(net::URLRequest* request, | 19 NavigationResourceHandler(net::URLRequest* request, |
| 20 NavigationURLLoaderImplCore* core); | 20 NavigationURLLoaderImplCore* core); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 42 const std::string& security_info, | 42 const std::string& security_info, |
| 43 bool* defer) override; | 43 bool* defer) override; |
| 44 void OnDataDownloaded(int bytes_downloaded) override; | 44 void OnDataDownloaded(int bytes_downloaded) override; |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 // Clears |core_| and its reference to the resource handler. After calling | 47 // Clears |core_| and its reference to the resource handler. After calling |
| 48 // this, the lifetime of the request is no longer tied to |core_|. | 48 // this, the lifetime of the request is no longer tied to |core_|. |
| 49 void DetachFromCore(); | 49 void DetachFromCore(); |
| 50 | 50 |
| 51 NavigationURLLoaderImplCore* core_; | 51 NavigationURLLoaderImplCore* core_; |
| 52 StreamWriter writer_; | 52 MojoStreamWriter writer_; |
| 53 | 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(NavigationResourceHandler); | 54 DISALLOW_COPY_AND_ASSIGN(NavigationResourceHandler); |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } // namespace content | 57 } // namespace content |
| 58 | 58 |
| 59 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_ | 59 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_RESOURCE_HANDLER_H_ |
| OLD | NEW |