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

Side by Side 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: More style fixes, ran git cl format Created 5 years, 6 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 unified diff | Download patch
OLDNEW
(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;
abarth-chromium 2015/05/29 23:04:10 I wonder if we should use the "On" pattern of nami
jackson 2015/05/29 23:35:43 Acknowledged.
21
22 protected:
23 NewImageLoaderClient() {}
24 };
25
26 class NewImageLoader : public MojoFetcher::Client,
27 public mojo::common::DataPipeDrainer::Client {
28 public:
29 static PassOwnPtr<NewImageLoader> create(NewImageLoaderClient* client) {
30 return adoptPtr(new NewImageLoader(client));
31 }
abarth-chromium 2015/05/29 23:04:10 Is there a reason to have a |create| function? Wh
jackson 2015/05/29 23:35:44 Acknowledged.
32 virtual ~NewImageLoader() {}
abarth-chromium 2015/05/29 23:04:10 Implementations of virtual functions should be out
jackson 2015/05/29 23:35:44 Acknowledged.
33
34 void Load(const KURL& src);
35
36 void OnReceivedResponse(mojo::URLResponsePtr);
37 void OnDataAvailable(const void*, size_t);
38 void OnDataComplete();
abarth-chromium 2015/05/29 23:04:10 Please put the |override| keyword on these virtual
jackson 2015/05/29 23:35:44 Acknowledged.
39
40 protected:
abarth-chromium 2015/05/29 23:04:10 Remove?
jackson 2015/05/29 23:35:44 Acknowledged.
41 private:
42 explicit NewImageLoader(NewImageLoaderClient* client) : client_(client) {}
43
44 NewImageLoaderClient* client_;
45 OwnPtr<MojoFetcher> fetcher_;
46 OwnPtr<mojo::common::DataPipeDrainer> drainer_;
47 RefPtr<SharedBuffer> buffer_;
48 };
49 }
abarth-chromium 2015/05/29 23:04:10 } // namespace blink Also, once you make that ch
jackson 2015/05/29 23:35:44 Acknowledged.
50
51 #endif // SKY_ENGINE_CORE_LOADER_NEWIMAGELOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698