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

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

Issue 7578001: Unify var tracking between webkit and the proxy. (Closed) Base URL: svn://chrome-svn/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/resource_creation_proxy.h" 5 #include "ppapi/proxy/resource_creation_proxy.h"
6 6
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/pp_size.h" 8 #include "ppapi/c/pp_size.h"
9 #include "ppapi/proxy/host_resource.h" 9 #include "ppapi/proxy/host_resource.h"
10 #include "ppapi/proxy/interface_id.h" 10 #include "ppapi/proxy/interface_id.h"
(...skipping 17 matching lines...) Expand all
28 #include "ppapi/proxy/ppb_graphics_3d_proxy.h" 28 #include "ppapi/proxy/ppb_graphics_3d_proxy.h"
29 #include "ppapi/proxy/ppb_image_data_proxy.h" 29 #include "ppapi/proxy/ppb_image_data_proxy.h"
30 #include "ppapi/proxy/ppb_input_event_proxy.h" 30 #include "ppapi/proxy/ppb_input_event_proxy.h"
31 #include "ppapi/proxy/ppb_surface_3d_proxy.h" 31 #include "ppapi/proxy/ppb_surface_3d_proxy.h"
32 #include "ppapi/proxy/ppb_url_loader_proxy.h" 32 #include "ppapi/proxy/ppb_url_loader_proxy.h"
33 #include "ppapi/proxy/ppb_url_request_info_proxy.h" 33 #include "ppapi/proxy/ppb_url_request_info_proxy.h"
34 #include "ppapi/proxy/ppb_video_decoder_proxy.h" 34 #include "ppapi/proxy/ppb_video_decoder_proxy.h"
35 #include "ppapi/shared_impl/font_impl.h" 35 #include "ppapi/shared_impl/font_impl.h"
36 #include "ppapi/shared_impl/function_group_base.h" 36 #include "ppapi/shared_impl/function_group_base.h"
37 #include "ppapi/shared_impl/input_event_impl.h" 37 #include "ppapi/shared_impl/input_event_impl.h"
38 #include "ppapi/shared_impl/var.h"
38 #include "ppapi/thunk/enter.h" 39 #include "ppapi/thunk/enter.h"
39 #include "ppapi/thunk/ppb_image_data_api.h" 40 #include "ppapi/thunk/ppb_image_data_api.h"
40 41
41 using ppapi::InputEventData; 42 using ppapi::InputEventData;
43 using ppapi::StringVar;
42 using ppapi::thunk::ResourceCreationAPI; 44 using ppapi::thunk::ResourceCreationAPI;
43 45
44 namespace pp { 46 namespace pp {
45 namespace proxy { 47 namespace proxy {
46 48
47 ResourceCreationProxy::ResourceCreationProxy(Dispatcher* dispatcher) 49 ResourceCreationProxy::ResourceCreationProxy(Dispatcher* dispatcher)
48 : dispatcher_(dispatcher) { 50 : dispatcher_(dispatcher) {
49 } 51 }
50 52
51 ResourceCreationProxy::~ResourceCreationProxy() { 53 ResourceCreationProxy::~ResourceCreationProxy() {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 PP_InputEvent_Type type, 200 PP_InputEvent_Type type,
199 PP_TimeTicks time_stamp, 201 PP_TimeTicks time_stamp,
200 uint32_t modifiers, 202 uint32_t modifiers,
201 uint32_t key_code, 203 uint32_t key_code,
202 struct PP_Var character_text) { 204 struct PP_Var character_text) {
203 if (type != PP_INPUTEVENT_TYPE_RAWKEYDOWN && 205 if (type != PP_INPUTEVENT_TYPE_RAWKEYDOWN &&
204 type != PP_INPUTEVENT_TYPE_KEYDOWN && 206 type != PP_INPUTEVENT_TYPE_KEYDOWN &&
205 type != PP_INPUTEVENT_TYPE_KEYUP && 207 type != PP_INPUTEVENT_TYPE_KEYUP &&
206 type != PP_INPUTEVENT_TYPE_CHAR) 208 type != PP_INPUTEVENT_TYPE_CHAR)
207 return 0; 209 return 0;
208 PluginVarTracker* tracker = PluginVarTracker::GetInstance();
209
210 ppapi::InputEventData data; 210 ppapi::InputEventData data;
211 data.event_type = type; 211 data.event_type = type;
212 data.event_time_stamp = time_stamp; 212 data.event_time_stamp = time_stamp;
213 data.event_modifiers = modifiers; 213 data.event_modifiers = modifiers;
214 data.key_code = key_code; 214 data.key_code = key_code;
215 if (character_text.type == PP_VARTYPE_STRING) 215 if (character_text.type == PP_VARTYPE_STRING) {
216 data.character_text = *tracker->GetExistingString(character_text); 216 scoped_refptr<StringVar> text_str(StringVar::FromPPVar(character_text));
217 if (!text_str)
218 return 0;
219 data.character_text = text_str->value();
220 }
217 221
218 return PPB_InputEvent_Proxy::CreateProxyResource(instance, data); 222 return PPB_InputEvent_Proxy::CreateProxyResource(instance, data);
219 } 223 }
220 224
221 PP_Resource ResourceCreationProxy::CreateMouseInputEvent( 225 PP_Resource ResourceCreationProxy::CreateMouseInputEvent(
222 PP_Instance instance, 226 PP_Instance instance,
223 PP_InputEvent_Type type, 227 PP_InputEvent_Type type,
224 PP_TimeTicks time_stamp, 228 PP_TimeTicks time_stamp,
225 uint32_t modifiers, 229 uint32_t modifiers,
226 PP_InputEvent_MouseButton mouse_button, 230 PP_InputEvent_MouseButton mouse_button,
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 *result_image_handle = dispatcher_->ShareHandleWithRemote(ih, false); 403 *result_image_handle = dispatcher_->ShareHandleWithRemote(ih, false);
400 #else 404 #else
401 *result_image_handle = ImageData::HandleFromInt(handle); 405 *result_image_handle = ImageData::HandleFromInt(handle);
402 #endif 406 #endif
403 } 407 }
404 } 408 }
405 } 409 }
406 410
407 } // namespace proxy 411 } // namespace proxy
408 } // namespace pp 412 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698