OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef SKY_ENGINE_CORE_LOADER_NEWIMAGELOADER_H_ | |
6 #define SKY_ENGINE_CORE_LOADER_NEWIMAGELOADER_H_ | |
7 | |
8 #include "mojo/common/data_pipe_drainer.h" | |
9 #include "sky/engine/platform/SharedBuffer.h" | |
10 #include "sky/engine/platform/fetcher/MojoFetcher.h" | |
11 #include "sky/engine/wtf/OwnPtr.h" | |
12 #include "sky/engine/wtf/PassOwnPtr.h" | |
13 #include "sky/engine/wtf/text/AtomicString.h" | |
14 #include "third_party/skia/include/core/SkBitmap.h" | |
15 | |
16 namespace blink { | |
17 | |
18 class NewImageLoaderClient { | |
19 public: | |
20 virtual void notifyLoadFinished(const SkBitmap& result) = 0; | |
21 protected: | |
22 NewImageLoaderClient() { } | |
23 }; | |
24 | |
25 class NewImageLoader : public MojoFetcher::Client, | |
26 public mojo::common::DataPipeDrainer::Client { | |
27 public: | |
28 static PassOwnPtr<NewImageLoader> create(NewImageLoaderClient* client) | |
29 { | |
30 return adoptPtr(new NewImageLoader(client)); | |
31 } | |
32 virtual ~NewImageLoader(); | |
33 | |
34 void load(const KURL& src); | |
eseidel
2015/05/29 22:13:51
Load(const GURL& src)? New code should be chromiu
jackson
2015/05/29 22:54:33
Load yes, will punt the GURL stuff for now since M
| |
35 | |
36 void OnReceivedResponse(mojo::URLResponsePtr); | |
37 void OnDataAvailable(const void*, size_t); | |
38 void OnDataComplete(); | |
39 protected: | |
40 | |
41 private: | |
42 explicit NewImageLoader(NewImageLoaderClient*); | |
43 | |
44 NewImageLoaderClient* m_client; | |
eseidel
2015/05/29 22:13:50
Strange indent change here. Also not sure if you
jackson
2015/05/29 22:54:33
Acknowledged.
| |
45 | |
46 OwnPtr<MojoFetcher> m_fetcher; | |
eseidel
2015/05/29 22:13:51
Chromium style is fetcher_;
jackson
2015/05/29 22:54:33
Acknowledged.
| |
47 | |
48 OwnPtr<mojo::common::DataPipeDrainer> m_drainer; | |
49 | |
50 RefPtr<SharedBuffer> m_buffer; | |
51 }; | |
52 | |
53 } | |
54 | |
55 #endif // SKY_ENGINE_CORE_LOADER_NEWIMAGELOADER_H_ | |
OLD | NEW |