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

Side by Side Diff: ppapi/shared_impl/ppp_instance_combined.cc

Issue 10543029: PPAPI/NaCl: Reinitialize some stuff when the ipc proxy starts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: enforce ordering of events, make previous view emptyenforce ordering of events, make previous view … 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 #include "ppapi/shared_impl/ppp_instance_combined.h" 5 #include "ppapi/shared_impl/ppp_instance_combined.h"
6 #include "ppapi/shared_impl/proxy_lock.h" 6 #include "ppapi/shared_impl/proxy_lock.h"
7 7
8 namespace ppapi { 8 namespace ppapi {
9 9
10 // static
11 PPP_Instance_Combined* PPP_Instance_Combined::Create(
12 base::Callback<const void*(const char*)> get_interface_func) {
13 // Try 1.1.
14 const void* ppp_instance = get_interface_func.Run(PPP_INSTANCE_INTERFACE_1_1);
15 if (ppp_instance) {
16 const PPP_Instance_1_1* ppp_instance_1_1 =
17 static_cast<const PPP_Instance_1_1*>(ppp_instance);
18 return new PPP_Instance_Combined(*ppp_instance_1_1);
19 }
20 // Failing that, try 1.0.
21 ppp_instance = get_interface_func.Run(PPP_INSTANCE_INTERFACE_1_0);
22 if (ppp_instance) {
23 const PPP_Instance_1_0* ppp_instance_1_0 =
24 static_cast<const PPP_Instance_1_0*>(ppp_instance);
25 return new PPP_Instance_Combined(*ppp_instance_1_0);
26 }
27 // No supported PPP_Instance version found.
28 return NULL;
29 }
30
10 PPP_Instance_Combined::PPP_Instance_Combined( 31 PPP_Instance_Combined::PPP_Instance_Combined(
11 const PPP_Instance_1_0& instance_if) 32 const PPP_Instance_1_0& instance_if)
12 : did_change_view_1_0_(instance_if.DidChangeView) { 33 : did_change_view_1_0_(instance_if.DidChangeView) {
13 instance_1_1_.DidCreate = instance_if.DidCreate; 34 instance_1_1_.DidCreate = instance_if.DidCreate;
14 instance_1_1_.DidDestroy = instance_if.DidDestroy; 35 instance_1_1_.DidDestroy = instance_if.DidDestroy;
15 instance_1_1_.DidChangeView = NULL; 36 instance_1_1_.DidChangeView = NULL;
16 instance_1_1_.DidChangeFocus = instance_if.DidChangeFocus; 37 instance_1_1_.DidChangeFocus = instance_if.DidChangeFocus;
17 instance_1_1_.HandleDocumentLoad = instance_if.HandleDocumentLoad; 38 instance_1_1_.HandleDocumentLoad = instance_if.HandleDocumentLoad;
18 } 39 }
19 40
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 75
55 PP_Bool PPP_Instance_Combined::HandleDocumentLoad(PP_Instance instance, 76 PP_Bool PPP_Instance_Combined::HandleDocumentLoad(PP_Instance instance,
56 PP_Resource url_loader) { 77 PP_Resource url_loader) {
57 return CallWhileUnlocked(instance_1_1_.HandleDocumentLoad, 78 return CallWhileUnlocked(instance_1_1_.HandleDocumentLoad,
58 instance, 79 instance,
59 url_loader); 80 url_loader);
60 } 81 }
61 82
62 } // namespace ppapi 83 } // namespace ppapi
63 84
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698