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

Side by Side Diff: ppapi/shared_impl/ppb_message_loop_shared.h

Issue 10910099: PPAPI: Make CompletionCallbacks work right on background threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 1 month 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 | « ppapi/shared_impl/ppapi_globals.cc ('k') | ppapi/shared_impl/ppb_message_loop_shared.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) 2012 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 PPAPI_SHARED_IMPL_PPB_MESSAGE_LOOP_SHARED_H_
6 #define PPAPI_SHARED_IMPL_PPB_MESSAGE_LOOP_SHARED_H_
7
8 #include "base/basictypes.h"
9 #include "base/callback_forward.h"
10 #include "base/location.h"
11 #include "ppapi/c/pp_instance.h"
12 #include "ppapi/shared_impl/ppapi_shared_export.h"
13 #include "ppapi/shared_impl/resource.h"
14 #include "ppapi/thunk/ppb_message_loop_api.h"
15
16 namespace tracked_objects {
17 class Location;
18 }
19
20 namespace ppapi {
21
22 // MessageLoopShared doesn't really do anything interesting. It exists so that
23 // shared code (in particular, TrackedCallback) can keep a pointer to a
24 // MessageLoop resource. In the host side, there is not a concrete class that
25 // implements this. So pointers to MessageLoopShared can only really be valid
26 // on the plugin side.
27 class PPAPI_SHARED_EXPORT MessageLoopShared
28 : public Resource,
29 public thunk::PPB_MessageLoop_API {
30 public:
31 explicit MessageLoopShared(PP_Instance instance);
32 // Construct the one MessageLoopShared for the main thread. This must be
33 // invoked on the main thread.
34 struct ForMainThread {};
35 explicit MessageLoopShared(ForMainThread);
36 virtual ~MessageLoopShared();
37
38 // Handles posting to the message loop if there is one, or the pending queue
39 // if there isn't.
40 // NOTE: The given closure will be run *WITHOUT* acquiring the Proxy lock.
41 // This only makes sense for user code and completely thread-safe
42 // proxy operations (e.g., MessageLoop::QuitClosure).
43 virtual void PostClosure(const tracked_objects::Location& from_here,
44 const base::Closure& closure,
45 int64 delay_ms) = 0;
46
47 DISALLOW_COPY_AND_ASSIGN(MessageLoopShared);
48 };
49
50 } // namespace ppapi
51
52 #endif // PPAPI_SHARED_IMPL_PPB_MESSAGE_LOOP_SHARED_H_
OLDNEW
« no previous file with comments | « ppapi/shared_impl/ppapi_globals.cc ('k') | ppapi/shared_impl/ppb_message_loop_shared.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698