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

Side by Side Diff: sky/engine/core/app/ModuleLoader.h

Issue 922893002: Merge the Sky Engine changes from the SkyDart branch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/engine/core/app/Module.idl ('k') | sky/engine/core/app/ModuleLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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_APP_MODULELOADER_H_
6 #define SKY_ENGINE_CORE_APP_MODULELOADER_H_
7
8 #include "base/memory/weak_ptr.h"
9 #include "sky/engine/platform/fetcher/MojoFetcher.h"
10 #include "sky/engine/wtf/OwnPtr.h"
11 #include "sky/engine/wtf/RefCounted.h"
12 #include "sky/engine/wtf/RefPtr.h"
13
14 namespace blink {
15 class Application;
16 class Document;
17 class Module;
18
19 class ModuleLoader : public MojoFetcher::Client {
20 public:
21 class Client {
22 public:
23 virtual void OnModuleLoadComplete(ModuleLoader*, Module*) = 0;
24
25 protected:
26 virtual ~Client();
27 };
28
29 enum State {
30 LOADING,
31 COMPLETE,
32 };
33
34 ModuleLoader(Client*, Application*, const KURL&);
35 ~ModuleLoader();
36
37 State state() const { return state_; }
38 Module* module() const { return module_.get(); }
39
40 private:
41 // MojoFetcher::Client
42 void OnReceivedResponse(mojo::URLResponsePtr) override;
43
44 void OnParsingComplete();
45
46 State state_;
47 Client* client_;
48 Application* application_;
49 OwnPtr<MojoFetcher> fetcher_;
50 RefPtr<Module> module_;
51
52 base::WeakPtrFactory<ModuleLoader> weak_factory_;
53 };
54
55 } // namespace blink
56
57 #endif // SKY_ENGINE_CORE_APP_MODULELOADER_H_
OLDNEW
« no previous file with comments | « sky/engine/core/app/Module.idl ('k') | sky/engine/core/app/ModuleLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698