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

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: Run git cl format once more 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
« no previous file with comments | « sky/engine/core/core.gni ('k') | sky/engine/core/loader/NewImageLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d2bacca69badaeba8d92b0abd37efbce3106aafa
--- /dev/null
+++ b/sky/engine/core/loader/NewImageLoader.h
@@ -0,0 +1,49 @@
+// 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/text/AtomicString.h"
+#include "third_party/skia/include/core/SkBitmap.h"
+
+namespace blink {
+
+class NewImageLoaderClient {
+ public:
+ virtual void OnLoadFinished(const SkBitmap& result) = 0;
+
+ protected:
+ NewImageLoaderClient() {}
+};
+
+class NewImageLoader : public MojoFetcher::Client,
+ public mojo::common::DataPipeDrainer::Client {
+ public:
+ explicit NewImageLoader(NewImageLoaderClient* client);
+ virtual ~NewImageLoader();
+
+ void Load(const KURL& src);
+
+ // MojoFetcher::Client
+ void OnReceivedResponse(mojo::URLResponsePtr) override;
+
+ // mojo::common::DataPipeDrainer::Client
+ void OnDataAvailable(const void*, size_t) override;
+ void OnDataComplete() override;
+
+ private:
+ NewImageLoaderClient* client_;
+ OwnPtr<MojoFetcher> fetcher_;
+ OwnPtr<mojo::common::DataPipeDrainer> drainer_;
+ RefPtr<SharedBuffer> buffer_;
+};
+
+} // namespace blink
+
+#endif // SKY_ENGINE_CORE_LOADER_NEWIMAGELOADER_H_
« no previous file with comments | « sky/engine/core/core.gni ('k') | sky/engine/core/loader/NewImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698