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 SKY_ENGINE_PLATFORM_FETCHER_MOJOFETCHER_H_ | 5 #ifndef SKY_ENGINE_PLATFORM_FETCHER_MOJOFETCHER_H_ |
6 #define SKY_ENGINE_PLATFORM_FETCHER_MOJOFETCHER_H_ | 6 #define SKY_ENGINE_PLATFORM_FETCHER_MOJOFETCHER_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" | 9 #include "mojo/services/authenticating_url_loader/public/interfaces/authenticati
ng_url_loader.mojom.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 class KURL; | 12 class KURL; |
13 | 13 |
14 class MojoFetcher { | 14 class MojoFetcher { |
15 public: | 15 public: |
16 class Client { | 16 class Client { |
17 public: | 17 public: |
18 virtual void OnReceivedResponse(mojo::URLResponsePtr) = 0; | 18 virtual void OnReceivedResponse(mojo::URLResponsePtr) = 0; |
19 | 19 |
20 protected: | 20 protected: |
21 virtual ~Client() { } | 21 virtual ~Client() { } |
22 }; | 22 }; |
23 | 23 |
24 MojoFetcher(Client*, const KURL&); | 24 MojoFetcher(Client*, const KURL&); |
25 ~MojoFetcher(); | 25 ~MojoFetcher(); |
26 | 26 |
27 private: | 27 private: |
28 void OnReceivedResponse(mojo::URLResponsePtr); | 28 void OnReceivedResponse(mojo::URLResponsePtr); |
29 | 29 |
30 Client* client_; | 30 Client* client_; |
31 mojo::URLLoaderPtr url_loader_; | 31 mojo::AuthenticatingURLLoaderPtr url_loader_; |
32 base::WeakPtrFactory<MojoFetcher> weak_factory_; | 32 base::WeakPtrFactory<MojoFetcher> weak_factory_; |
33 | 33 |
34 DISALLOW_COPY_AND_ASSIGN(MojoFetcher); | 34 DISALLOW_COPY_AND_ASSIGN(MojoFetcher); |
35 }; | 35 }; |
36 | 36 |
37 } // namespace blink | 37 } // namespace blink |
38 | 38 |
39 #endif // SKY_ENGINE_PLATFORM_FETCHER_MOJOFETCHER_H_ | 39 #endif // SKY_ENGINE_PLATFORM_FETCHER_MOJOFETCHER_H_ |
OLD | NEW |