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

Side by Side Diff: mojo/shell/ui_service_loader_android.h

Issue 399663002: Have mojo_shell run in its custom thread on android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « mojo/shell/task_runners.cc ('k') | mojo/shell/ui_service_loader_android.cc » ('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 MOJO_SHELL_UI_SERVICE_LOADER_ANDROID_H_
6 #define MOJO_SHELL_UI_SERVICE_LOADER_ANDROID_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "mojo/service_manager/service_loader.h"
10
11 namespace mojo {
12
13 class ServiceManager;
14
15 namespace shell {
16 class Context;
17 }
18
19 // ServiceLoader implementation that creates a background thread and issues load
20 // requests there.
21 class UIServiceLoader : public ServiceLoader {
22 public:
23 UIServiceLoader(scoped_ptr<ServiceLoader> real_loader,
24 shell::Context* context);
25 virtual ~UIServiceLoader();
26
27 // ServiceLoader overrides:
28 virtual void LoadService(ServiceManager* manager,
29 const GURL& url,
30 ScopedMessagePipeHandle shell_handle) OVERRIDE;
31 virtual void OnServiceError(ServiceManager* manager,
32 const GURL& url) OVERRIDE;
33
34 private:
35 class UILoader;
36
37 // These functions are exected on the background thread. They call through
38 // to |background_loader_| to do the actual loading.
39 // TODO: having this code take a |manager| is fragile (as ServiceManager isn't
40 // thread safe).
41 void LoadServiceOnUIThread(ServiceManager* manager,
42 const GURL& url,
43 ScopedMessagePipeHandle* shell_handle);
44 void OnServiceErrorOnUIThread(ServiceManager* manager, const GURL& url);
45 void ShutdownOnUIThread();
46
47 scoped_ptr<ServiceLoader> loader_;
48 shell::Context* context_;
49
50 // Lives on the UI thread. Trivial interface that calls through to |loader_|.
51 UILoader* ui_loader_;
52
53 DISALLOW_COPY_AND_ASSIGN(UIServiceLoader);
54 };
55
56 } // namespace mojo
57
58 #endif // MOJO_SHELL_UI_SERVICE_LOADER_ANDROID_H_
OLDNEW
« no previous file with comments | « mojo/shell/task_runners.cc ('k') | mojo/shell/ui_service_loader_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698