| OLD | NEW |
| 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 "webkit/plugins/ppapi/message_channel.h" | 5 #include "webkit/plugins/ppapi/message_channel.h" |
| 6 | 6 |
| 7 #include <cstdlib> | 7 #include <cstdlib> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // structure. The details and PPAPI changes for this are TBD. | 104 // structure. The details and PPAPI changes for this are TBD. |
| 105 PP_Var CopyPPVar(const PP_Var& var) { | 105 PP_Var CopyPPVar(const PP_Var& var) { |
| 106 if (var.type == PP_VARTYPE_OBJECT) { | 106 if (var.type == PP_VARTYPE_OBJECT) { |
| 107 // Objects are not currently supported. | 107 // Objects are not currently supported. |
| 108 NOTIMPLEMENTED(); | 108 NOTIMPLEMENTED(); |
| 109 return PP_MakeUndefined(); | 109 return PP_MakeUndefined(); |
| 110 } else if (var.type == PP_VARTYPE_STRING) { | 110 } else if (var.type == PP_VARTYPE_STRING) { |
| 111 StringVar* string = StringVar::FromPPVar(var); | 111 StringVar* string = StringVar::FromPPVar(var); |
| 112 if (!string) | 112 if (!string) |
| 113 return PP_MakeUndefined(); | 113 return PP_MakeUndefined(); |
| 114 return StringVar::StringToPPVar(string->pp_module(), string->value()); | 114 return StringVar::StringToPPVar(string->value()); |
| 115 } else { | 115 } else { |
| 116 return var; | 116 return var; |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 | 119 |
| 120 //------------------------------------------------------------------------------ | 120 //------------------------------------------------------------------------------ |
| 121 // Implementations of NPClass functions. These are here to: | 121 // Implementations of NPClass functions. These are here to: |
| 122 // - Implement postMessage behavior. | 122 // - Implement postMessage behavior. |
| 123 // - Forward calls to the 'passthrough' object to allow backwards-compatibility | 123 // - Forward calls to the 'passthrough' object to allow backwards-compatibility |
| 124 // with GetInstanceObject() objects. | 124 // with GetInstanceObject() objects. |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 // SetPassthroughObject(passthrough_object()); | 381 // SetPassthroughObject(passthrough_object()); |
| 382 if (passthrough_object_) | 382 if (passthrough_object_) |
| 383 WebBindings::releaseObject(passthrough_object_); | 383 WebBindings::releaseObject(passthrough_object_); |
| 384 | 384 |
| 385 passthrough_object_ = passthrough; | 385 passthrough_object_ = passthrough; |
| 386 } | 386 } |
| 387 | 387 |
| 388 } // namespace ppapi | 388 } // namespace ppapi |
| 389 } // namespace webkit | 389 } // namespace webkit |
| 390 | 390 |
| OLD | NEW |