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

Side by Side Diff: content/browser/plugin_loader.h

Issue 8243010: Queue callbacks in PluginService::GetPlugins. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 years, 2 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 | « no previous file | content/browser/plugin_loader.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 (c) 2011 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 CONTENT_BROWSER_PLUGIN_LOADER_H_
6 #define CONTENT_BROWSER_PLUGIN_LOADER_H_
7
8 #include <vector>
9
10 #include "base/memory/ref_counted.h"
11 #include "content/browser/plugin_service.h"
12 #include "content/browser/utility_process_host.h"
13
14 namespace base {
15 class MessageLoopProxy;
16 }
17
18 namespace webkit {
19 struct WebPluginInfo;
20 }
21
22 // Utility child process client that manages the IPC for loading plugins out of
23 // process.
24 class PluginLoader : public UtilityProcessHost::Client {
25 public:
26 PluginLoader();
27 virtual ~PluginLoader() OVERRIDE;
28
29 // Meant to be called on the IO thread. Will invoke the callback on the target
30 // loop when the plugins have been loaded.
31 void LoadPlugins(base::MessageLoopProxy* target_loop,
32 const PluginService::GetPluginsCallback& callback);
33
34 // UtilityProcessHost::Client implementation:
35 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
36 virtual void OnProcessCrashed(int exit_code) OVERRIDE;
37
38 private:
39 struct PendingCallback {
40 PendingCallback(scoped_refptr<base::MessageLoopProxy> loop,
41 const PluginService::GetPluginsCallback& callback);
42 ~PendingCallback();
43
44 scoped_refptr<base::MessageLoopProxy> target_loop;
45 PluginService::GetPluginsCallback callback;
46 };
47
48 void StartLoadingIfNecessary();
49
50 void OnGotPlugins(const std::vector<webkit::WebPluginInfo>& plugins);
51
52 UtilityProcessHost* process_host_;
53 std::vector<PendingCallback> callbacks_;
54
55 DISALLOW_COPY_AND_ASSIGN(PluginLoader);
56 };
57
58 #endif // CONTENT_BROWSER_PLUGIN_LOADER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/plugin_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698