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

Side by Side Diff: sky/engine/core/loader/CanvasImageLoader.h

Issue 1165753004: Implement a simple image cache for Sky in Dart (no eviction) (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase origin/master 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
« no previous file with comments | « no previous file | sky/engine/core/loader/CanvasImageLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // SKY_ENGINE_CORE_PAINTING_CANVASIMAGE_H_ 1 // SKY_ENGINE_CORE_PAINTING_CANVASIMAGE_H_
2 // Copyright 2015 The Chromium Authors. All rights reserved. 2 // Copyright 2015 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
6 #ifndef SKY_ENGINE_CORE_LOADER_CANVASIMAGELOADER_H_ 6 #ifndef SKY_ENGINE_CORE_LOADER_CANVASIMAGELOADER_H_
7 #define SKY_ENGINE_CORE_LOADER_CANVASIMAGELOADER_H_ 7 #define SKY_ENGINE_CORE_LOADER_CANVASIMAGELOADER_H_
8 8
9 #include "mojo/common/data_pipe_drainer.h" 9 #include "mojo/common/data_pipe_drainer.h"
10 #include "sky/engine/core/loader/ImageLoaderCallback.h" 10 #include "sky/engine/core/loader/ImageLoaderCallback.h"
(...skipping 10 matching lines...) Expand all
21 public RefCounted<CanvasImageLoader>, 21 public RefCounted<CanvasImageLoader>,
22 public DartWrappable { 22 public DartWrappable {
23 DEFINE_WRAPPERTYPEINFO(); 23 DEFINE_WRAPPERTYPEINFO();
24 public: 24 public:
25 static PassRefPtr<CanvasImageLoader> create(const String& src, PassOwnPtr<Imag eLoaderCallback> callback) 25 static PassRefPtr<CanvasImageLoader> create(const String& src, PassOwnPtr<Imag eLoaderCallback> callback)
26 { 26 {
27 return adoptRef(new CanvasImageLoader(src, callback)); 27 return adoptRef(new CanvasImageLoader(src, callback));
28 } 28 }
29 virtual ~CanvasImageLoader(); 29 virtual ~CanvasImageLoader();
30 30
31 void load();
32
33 // MojoFetcher::Client 31 // MojoFetcher::Client
34 void OnReceivedResponse(mojo::URLResponsePtr) override; 32 void OnReceivedResponse(mojo::URLResponsePtr) override;
35 33
36 // mojo::common::DataPipeDrainer::Client 34 // mojo::common::DataPipeDrainer::Client
37 void OnDataAvailable(const void*, size_t) override; 35 void OnDataAvailable(const void*, size_t) override;
38 void OnDataComplete() override; 36 void OnDataComplete() override;
39 37
40 private: 38 private:
41 explicit CanvasImageLoader(const String& src, PassOwnPtr<ImageLoaderCallback> callback); 39 explicit CanvasImageLoader(const String& src, PassOwnPtr<ImageLoaderCallback> callback);
42 40
43 OwnPtr<MojoFetcher> fetcher_; 41 OwnPtr<MojoFetcher> fetcher_;
44 OwnPtr<mojo::common::DataPipeDrainer> drainer_; 42 OwnPtr<mojo::common::DataPipeDrainer> drainer_;
45 RefPtr<SharedBuffer> buffer_; 43 RefPtr<SharedBuffer> buffer_;
46
47 KURL url_;
48 OwnPtr<ImageLoaderCallback> callback_; 44 OwnPtr<ImageLoaderCallback> callback_;
49 }; 45 };
50 46
51 } // namespace blink 47 } // namespace blink
52 48
53 #endif // SKY_ENGINE_CORE_LOADER_CANVASIMAGELOADER_H_ 49 #endif // SKY_ENGINE_CORE_LOADER_CANVASIMAGELOADER_H_
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/loader/CanvasImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698