| 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 COMPONENTS_HTML_VIEWER_WEB_URL_LOADER_IMPL_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_WEB_URL_LOADER_IMPL_H_ |
| 6 #define COMPONENTS_HTML_VIEWER_WEB_URL_LOADER_IMPL_H_ | 6 #define COMPONENTS_HTML_VIEWER_WEB_URL_LOADER_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "components/html_viewer/mock_web_blob_registry_impl.h" | 10 #include "components/html_viewer/mock_web_blob_registry_impl.h" |
| 11 #include "mojo/common/handle_watcher.h" | 11 #include "mojo/common/handle_watcher.h" |
| 12 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" | 12 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" |
| 13 #include "third_party/WebKit/public/platform/WebBlobData.h" | 13 #include "third_party/WebKit/public/platform/WebBlobData.h" |
| 14 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" | 14 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" |
| 15 #include "third_party/WebKit/public/platform/WebURLLoader.h" | 15 #include "third_party/WebKit/public/platform/WebURLLoader.h" |
| 16 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 16 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 17 | 17 |
| 18 namespace mojo { | 18 namespace mojo { |
| 19 class NetworkService; | 19 class URLLoaderFactory; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace html_viewer { | 22 namespace html_viewer { |
| 23 | 23 |
| 24 // The concrete type of WebURLRequest::ExtraData. | 24 // The concrete type of WebURLRequest::ExtraData. |
| 25 class WebURLRequestExtraData : public blink::WebURLRequest::ExtraData { | 25 class WebURLRequestExtraData : public blink::WebURLRequest::ExtraData { |
| 26 public: | 26 public: |
| 27 WebURLRequestExtraData(); | 27 WebURLRequestExtraData(); |
| 28 virtual ~WebURLRequestExtraData(); | 28 virtual ~WebURLRequestExtraData(); |
| 29 | 29 |
| 30 mojo::URLResponsePtr synthetic_response; | 30 mojo::URLResponsePtr synthetic_response; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 class WebURLLoaderImpl : public blink::WebURLLoader { | 33 class WebURLLoaderImpl : public blink::WebURLLoader { |
| 34 public: | 34 public: |
| 35 explicit WebURLLoaderImpl(mojo::NetworkService* network_service, | 35 explicit WebURLLoaderImpl(mojo::URLLoaderFactory* url_loader_factory, |
| 36 MockWebBlobRegistryImpl* web_blob_registry); | 36 MockWebBlobRegistryImpl* web_blob_registry); |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 virtual ~WebURLLoaderImpl(); | 39 virtual ~WebURLLoaderImpl(); |
| 40 | 40 |
| 41 // blink::WebURLLoader methods: | 41 // blink::WebURLLoader methods: |
| 42 virtual void loadSynchronously(const blink::WebURLRequest& request, | 42 virtual void loadSynchronously(const blink::WebURLRequest& request, |
| 43 blink::WebURLResponse& response, | 43 blink::WebURLResponse& response, |
| 44 blink::WebURLError& error, | 44 blink::WebURLError& error, |
| 45 blink::WebData& data); | 45 blink::WebData& data); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 69 mojo::common::HandleWatcher handle_watcher_; | 69 mojo::common::HandleWatcher handle_watcher_; |
| 70 | 70 |
| 71 base::WeakPtrFactory<WebURLLoaderImpl> weak_factory_; | 71 base::WeakPtrFactory<WebURLLoaderImpl> weak_factory_; |
| 72 | 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderImpl); | 73 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderImpl); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace html_viewer | 76 } // namespace html_viewer |
| 77 | 77 |
| 78 #endif // COMPONENTS_HTML_VIEWER_WEB_URL_LOADER_IMPL_H_ | 78 #endif // COMPONENTS_HTML_VIEWER_WEB_URL_LOADER_IMPL_H_ |
| OLD | NEW |