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

Side by Side Diff: ppapi/proxy/ppb_core_proxy.cc

Issue 6282007: First pass at making the proxy handle multiple renderers. This associates the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « ppapi/proxy/ppb_char_set_proxy.cc ('k') | ppapi/proxy/ppb_cursor_control_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "ppapi/proxy/ppb_core_proxy.h" 5 #include "ppapi/proxy/ppb_core_proxy.h"
6 6
7 #include <stdlib.h> // For malloc 7 #include <stdlib.h> // For malloc
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "base/message_loop_proxy.h" 11 #include "base/message_loop_proxy.h"
12 #include "base/time.h" 12 #include "base/time.h"
13 #include "ppapi/c/pp_completion_callback.h" 13 #include "ppapi/c/pp_completion_callback.h"
14 #include "ppapi/c/pp_resource.h" 14 #include "ppapi/c/pp_resource.h"
15 #include "ppapi/c/ppb_core.h" 15 #include "ppapi/c/ppb_core.h"
16 #include "ppapi/proxy/plugin_dispatcher.h" 16 #include "ppapi/proxy/plugin_dispatcher.h"
17 #include "ppapi/proxy/plugin_resource_tracker.h"
17 #include "ppapi/proxy/ppapi_messages.h" 18 #include "ppapi/proxy/ppapi_messages.h"
18 19
19 namespace pp { 20 namespace pp {
20 namespace proxy { 21 namespace proxy {
21 22
22 namespace { 23 namespace {
23 24
24 base::MessageLoopProxy* GetMainThreadMessageLoop() { 25 base::MessageLoopProxy* GetMainThreadMessageLoop() {
25 static scoped_refptr<base::MessageLoopProxy> proxy( 26 static scoped_refptr<base::MessageLoopProxy> proxy(
26 base::MessageLoopProxy::CreateForCurrentThread()); 27 base::MessageLoopProxy::CreateForCurrentThread());
27 return proxy.get(); 28 return proxy.get();
28 } 29 }
29 30
30 void AddRefResource(PP_Resource resource) { 31 void AddRefResource(PP_Resource resource) {
31 PluginDispatcher::Get()->plugin_resource_tracker()->AddRefResource(resource); 32 PluginResourceTracker::GetInstance()->AddRefResource(resource);
32 } 33 }
33 34
34 void ReleaseResource(PP_Resource resource) { 35 void ReleaseResource(PP_Resource resource) {
35 PluginDispatcher::Get()->plugin_resource_tracker()->ReleaseResource(resource); 36 PluginResourceTracker::GetInstance()->ReleaseResource(resource);
36 } 37 }
37 38
38 void* MemAlloc(size_t num_bytes) { 39 void* MemAlloc(size_t num_bytes) {
39 return malloc(num_bytes); 40 return malloc(num_bytes);
40 } 41 }
41 42
42 void MemFree(void* ptr) { 43 void MemFree(void* ptr) {
43 free(ptr); 44 free(ptr);
44 } 45 }
45 46
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 void PPB_Core_Proxy::OnMsgAddRefResource(PP_Resource resource) { 113 void PPB_Core_Proxy::OnMsgAddRefResource(PP_Resource resource) {
113 ppb_core_target()->AddRefResource(resource); 114 ppb_core_target()->AddRefResource(resource);
114 } 115 }
115 116
116 void PPB_Core_Proxy::OnMsgReleaseResource(PP_Resource resource) { 117 void PPB_Core_Proxy::OnMsgReleaseResource(PP_Resource resource) {
117 ppb_core_target()->ReleaseResource(resource); 118 ppb_core_target()->ReleaseResource(resource);
118 } 119 }
119 120
120 } // namespace proxy 121 } // namespace proxy
121 } // namespace pp 122 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_char_set_proxy.cc ('k') | ppapi/proxy/ppb_cursor_control_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698