Chromium Code Reviews| Index: sky/engine/core/loader/NewImageLoader.h |
| diff --git a/sky/engine/core/loader/NewImageLoader.h b/sky/engine/core/loader/NewImageLoader.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a8f3b188fb8fd084aa9e4e9d900006535dd13781 |
| --- /dev/null |
| +++ b/sky/engine/core/loader/NewImageLoader.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef SKY_ENGINE_CORE_LOADER_NEWIMAGELOADER_H_ |
| +#define SKY_ENGINE_CORE_LOADER_NEWIMAGELOADER_H_ |
| + |
| +#include "mojo/common/data_pipe_drainer.h" |
| +#include "sky/engine/platform/SharedBuffer.h" |
| +#include "sky/engine/platform/fetcher/MojoFetcher.h" |
| +#include "sky/engine/wtf/OwnPtr.h" |
| +#include "sky/engine/wtf/PassOwnPtr.h" |
| +#include "sky/engine/wtf/text/AtomicString.h" |
| +#include "third_party/skia/include/core/SkBitmap.h" |
| + |
| +namespace blink { |
| + |
| +class NewImageLoaderClient { |
| +public: |
| + virtual void notifyLoadFinished(const SkBitmap& result) = 0; |
| +protected: |
| + NewImageLoaderClient() { } |
| +}; |
| + |
| +class NewImageLoader : public MojoFetcher::Client, |
| + public mojo::common::DataPipeDrainer::Client { |
| +public: |
| + static PassOwnPtr<NewImageLoader> create(NewImageLoaderClient* client) |
| + { |
| + return adoptPtr(new NewImageLoader(client)); |
| + } |
| + virtual ~NewImageLoader(); |
| + |
| + 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
|
| + |
| + void OnReceivedResponse(mojo::URLResponsePtr); |
| + void OnDataAvailable(const void*, size_t); |
| + void OnDataComplete(); |
| +protected: |
| + |
| +private: |
| + explicit NewImageLoader(NewImageLoaderClient*); |
| + |
| + 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.
|
| + |
| + OwnPtr<MojoFetcher> m_fetcher; |
|
eseidel
2015/05/29 22:13:51
Chromium style is fetcher_;
jackson
2015/05/29 22:54:33
Acknowledged.
|
| + |
| + OwnPtr<mojo::common::DataPipeDrainer> m_drainer; |
| + |
| + RefPtr<SharedBuffer> m_buffer; |
| +}; |
| + |
| +} |
| + |
| +#endif // SKY_ENGINE_CORE_LOADER_NEWIMAGELOADER_H_ |