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

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

Issue 7655002: Convert the pp::proxy namespace to the ppapi::proxy namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 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 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/ppp_messaging_proxy.h" 5 #include "ppapi/proxy/ppp_messaging_proxy.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ppapi/c/ppp_messaging.h" 9 #include "ppapi/c/ppp_messaging.h"
10 #include "ppapi/proxy/host_dispatcher.h" 10 #include "ppapi/proxy/host_dispatcher.h"
11 #include "ppapi/proxy/plugin_resource_tracker.h" 11 #include "ppapi/proxy/plugin_resource_tracker.h"
12 #include "ppapi/proxy/plugin_var_tracker.h" 12 #include "ppapi/proxy/plugin_var_tracker.h"
13 #include "ppapi/proxy/ppapi_messages.h" 13 #include "ppapi/proxy/ppapi_messages.h"
14 #include "ppapi/proxy/serialized_var.h" 14 #include "ppapi/proxy/serialized_var.h"
15 15
16 namespace pp { 16 namespace ppapi {
17 namespace proxy { 17 namespace proxy {
18 18
19 namespace { 19 namespace {
20 20
21 void HandleMessage(PP_Instance instance, PP_Var message_data) { 21 void HandleMessage(PP_Instance instance, PP_Var message_data) {
22 HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); 22 HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance);
23 if (!dispatcher || (message_data.type == PP_VARTYPE_OBJECT)) { 23 if (!dispatcher || (message_data.type == PP_VARTYPE_OBJECT)) {
24 // The dispatcher should always be valid, and the browser should never send 24 // The dispatcher should always be valid, and the browser should never send
25 // an 'object' var over PPP_Messaging. 25 // an 'object' var over PPP_Messaging.
26 NOTREACHED(); 26 NOTREACHED();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 void PPP_Messaging_Proxy::OnMsgHandleMessage( 77 void PPP_Messaging_Proxy::OnMsgHandleMessage(
78 PP_Instance instance, SerializedVarReceiveInput message_data) { 78 PP_Instance instance, SerializedVarReceiveInput message_data) {
79 PP_Var received_var(message_data.Get(dispatcher())); 79 PP_Var received_var(message_data.Get(dispatcher()));
80 // SerializedVarReceiveInput will decrement the reference count, but we want 80 // SerializedVarReceiveInput will decrement the reference count, but we want
81 // to give the recipient a reference. 81 // to give the recipient a reference.
82 PluginResourceTracker::GetInstance()->var_tracker().AddRefVar(received_var); 82 PluginResourceTracker::GetInstance()->var_tracker().AddRefVar(received_var);
83 ppp_messaging_target()->HandleMessage(instance, received_var); 83 ppp_messaging_target()->HandleMessage(instance, received_var);
84 } 84 }
85 85
86 } // namespace proxy 86 } // namespace proxy
87 } // namespace pp 87 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698