Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Unified Diff: sky/engine/core/loader/NewImageLoader.h

Issue 1151753009: Add Sky framework support for drawing images (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698