| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 template <V8StringResourceMode Mode = DefaultMode> | 171 template <V8StringResourceMode Mode = DefaultMode> |
| 172 class V8StringResource { | 172 class V8StringResource { |
| 173 STACK_ALLOCATED(); | 173 STACK_ALLOCATED(); |
| 174 | 174 |
| 175 public: | 175 public: |
| 176 V8StringResource() : m_mode(Externalize) {} | 176 V8StringResource() : m_mode(Externalize) {} |
| 177 | 177 |
| 178 V8StringResource(v8::Local<v8::Value> object) | 178 V8StringResource(v8::Local<v8::Value> object) |
| 179 : m_v8Object(object), m_mode(Externalize) {} | 179 : m_v8Object(object), m_mode(Externalize) {} |
| 180 | 180 |
| 181 V8StringResource(v8::Local<v8::String> object) |
| 182 : m_v8Object(object), m_mode(Externalize) {} |
| 183 |
| 181 V8StringResource(const String& string) | 184 V8StringResource(const String& string) |
| 182 : m_mode(Externalize), m_string(string) {} | 185 : m_mode(Externalize), m_string(string) {} |
| 183 | 186 |
| 184 void operator=(v8::Local<v8::Value> object) { m_v8Object = object; } | 187 void operator=(v8::Local<v8::Value> object) { m_v8Object = object; } |
| 185 | 188 |
| 186 void operator=(const String& string) { setString(string); } | 189 void operator=(const String& string) { setString(string); } |
| 187 | 190 |
| 188 void operator=(std::nullptr_t) { setString(String()); } | 191 void operator=(std::nullptr_t) { setString(String()); } |
| 189 | 192 |
| 190 bool prepare() { // DEPRECATED | 193 bool prepare() { // DEPRECATED |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 | 304 |
| 302 template <> | 305 template <> |
| 303 inline String | 306 inline String |
| 304 V8StringResource<TreatNullAndUndefinedAsNullString>::fallbackString() const { | 307 V8StringResource<TreatNullAndUndefinedAsNullString>::fallbackString() const { |
| 305 return String(); | 308 return String(); |
| 306 } | 309 } |
| 307 | 310 |
| 308 } // namespace blink | 311 } // namespace blink |
| 309 | 312 |
| 310 #endif // V8StringResource_h | 313 #endif // V8StringResource_h |
| OLD | NEW |