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

Side by Side Diff: remoting/client/plugin/chromoting_instance.h

Issue 10440107: Replace ScopedThreadProxy with MessageLoopProxy & WeakPtrs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // TODO(ajwong): We need to come up with a better description of the 5 // TODO(ajwong): We need to come up with a better description of the
6 // responsibilities for each thread. 6 // responsibilities for each thread.
7 7
8 #ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ 8 #ifndef REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_
9 #define REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ 9 #define REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_
10 10
11 #include <string> 11 #include <string>
12 12
13 #include "base/gtest_prod_util.h" 13 #include "base/gtest_prod_util.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "ppapi/c/pp_instance.h" 16 #include "ppapi/c/pp_instance.h"
17 #include "ppapi/c/pp_rect.h" 17 #include "ppapi/c/pp_rect.h"
18 #include "ppapi/c/pp_resource.h" 18 #include "ppapi/c/pp_resource.h"
19 #include "ppapi/cpp/var.h" 19 #include "ppapi/cpp/var.h"
20 20
21 // Windows defines 'PostMessage', so we have to undef it before we 21 // Windows defines 'PostMessage', so we have to undef it before we
22 // include instance_private.h 22 // include instance_private.h
23 #if defined(PostMessage) 23 #if defined(PostMessage)
24 #undef PostMessage 24 #undef PostMessage
25 #endif 25 #endif
26 26
27 #include "ppapi/cpp/private/instance_private.h" 27 #include "ppapi/cpp/private/instance_private.h"
28 #include "remoting/base/scoped_thread_proxy.h"
29 #include "remoting/client/client_context.h" 28 #include "remoting/client/client_context.h"
30 #include "remoting/client/key_event_mapper.h" 29 #include "remoting/client/key_event_mapper.h"
31 #include "remoting/client/plugin/mac_key_event_processor.h" 30 #include "remoting/client/plugin/mac_key_event_processor.h"
32 #include "remoting/client/plugin/pepper_plugin_thread_delegate.h" 31 #include "remoting/client/plugin/pepper_plugin_thread_delegate.h"
33 #include "remoting/proto/event.pb.h" 32 #include "remoting/proto/event.pb.h"
34 #include "remoting/protocol/clipboard_stub.h" 33 #include "remoting/protocol/clipboard_stub.h"
35 #include "remoting/protocol/connection_to_host.h" 34 #include "remoting/protocol/connection_to_host.h"
36 35
37 namespace base { 36 namespace base {
38 class DictionaryValue; 37 class DictionaryValue;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 // XmppProxy is a refcounted interface used to perform thread-switching and 217 // XmppProxy is a refcounted interface used to perform thread-switching and
219 // detaching between objects whose lifetimes are controlled by pepper, and 218 // detaching between objects whose lifetimes are controlled by pepper, and
220 // jingle_glue objects. This is used when if we start a sandboxed jingle 219 // jingle_glue objects. This is used when if we start a sandboxed jingle
221 // connection. 220 // connection.
222 scoped_refptr<PepperXmppProxy> xmpp_proxy_; 221 scoped_refptr<PepperXmppProxy> xmpp_proxy_;
223 222
224 // JavaScript interface to control this instance. 223 // JavaScript interface to control this instance.
225 // This wraps a ChromotingScriptableObject in a pp::Var. 224 // This wraps a ChromotingScriptableObject in a pp::Var.
226 pp::Var instance_object_; 225 pp::Var instance_object_;
227 226
228 scoped_ptr<ScopedThreadProxy> thread_proxy_; 227 base::WeakPtrFactory<ChromotingInstance> weak_factory_;
229 228
230 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance); 229 DISALLOW_COPY_AND_ASSIGN(ChromotingInstance);
231 }; 230 };
232 231
233 } // namespace remoting 232 } // namespace remoting
234 233
235 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_ 234 #endif // REMOTING_CLIENT_PLUGIN_CHROMOTING_INSTANCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698