| OLD | NEW |
| 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 // This file contains definitions for CppVariant. | 5 #include "content/renderer/cpp_variant.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 |
| 8 #include "base/logging.h" | 9 #include "base/logging.h" |
| 9 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 10 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 12 #include "third_party/WebKit/public/web/WebBindings.h" | 13 #include "third_party/WebKit/public/web/WebBindings.h" |
| 13 #include "webkit/renderer/cpp_variant.h" | |
| 14 | 14 |
| 15 using WebKit::WebBindings; | 15 using WebKit::WebBindings; |
| 16 | 16 |
| 17 namespace webkit_glue { | 17 namespace content { |
| 18 | 18 |
| 19 CppVariant::CppVariant() { | 19 CppVariant::CppVariant() { |
| 20 type = NPVariantType_Null; | 20 type = NPVariantType_Null; |
| 21 } | 21 } |
| 22 | 22 |
| 23 // Note that Set() performs a deep copy, which is necessary to safely | 23 // Note that Set() performs a deep copy, which is necessary to safely |
| 24 // call FreeData() on the value in the destructor. | 24 // call FreeData() on the value in the destructor. |
| 25 CppVariant::CppVariant(const CppVariant& original) { | 25 CppVariant::CppVariant(const CppVariant& original) { |
| 26 type = NPVariantType_Null; | 26 type = NPVariantType_Null; |
| 27 Set(original); | 27 Set(original); |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 NPVariant r; | 258 NPVariant r; |
| 259 bool status = | 259 bool status = |
| 260 WebBindings::invoke(NULL, np_object, method_name, args, arg_count, &r); | 260 WebBindings::invoke(NULL, np_object, method_name, args, arg_count, &r); |
| 261 result.Set(r); | 261 result.Set(r); |
| 262 return status; | 262 return status; |
| 263 } else { | 263 } else { |
| 264 return false; | 264 return false; |
| 265 } | 265 } |
| 266 } | 266 } |
| 267 | 267 |
| 268 } // namespace webkit_glue | 268 } // namespace content |
| OLD | NEW |