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

Side by Side Diff: Source/bindings/core/v8/V8StringResource.h

Issue 1111163003: Replace v8::Handle<> with v8::Local<> in bindings/core/v8/* (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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
OLDNEW
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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 return reinterpret_cast<const char*>(m_plainString.impl()->characters8() ); 147 return reinterpret_cast<const char*>(m_plainString.impl()->characters8() );
148 } 148 }
149 }; 149 };
150 150
151 enum ExternalMode { 151 enum ExternalMode {
152 Externalize, 152 Externalize,
153 DoNotExternalize 153 DoNotExternalize
154 }; 154 };
155 155
156 template <typename StringType> 156 template <typename StringType>
157 CORE_EXPORT StringType v8StringToWebCoreString(v8::Handle<v8::String>, ExternalM ode); 157 CORE_EXPORT StringType v8StringToWebCoreString(v8::Local<v8::String>, ExternalMo de);
158 CORE_EXPORT String int32ToWebCoreString(int value); 158 CORE_EXPORT String int32ToWebCoreString(int value);
159 159
160 // V8StringResource is an adapter class that converts V8 values to Strings 160 // V8StringResource is an adapter class that converts V8 values to Strings
161 // or AtomicStrings as appropriate, using multiple typecast operators. 161 // or AtomicStrings as appropriate, using multiple typecast operators.
162 enum V8StringResourceMode { 162 enum V8StringResourceMode {
163 DefaultMode, 163 DefaultMode,
164 TreatNullAsEmptyString, 164 TreatNullAsEmptyString,
165 TreatNullAsNullString, 165 TreatNullAsNullString,
166 TreatNullAndUndefinedAsNullString 166 TreatNullAndUndefinedAsNullString
167 }; 167 };
168 168
169 template <V8StringResourceMode Mode = DefaultMode> 169 template <V8StringResourceMode Mode = DefaultMode>
170 class V8StringResource { 170 class V8StringResource {
171 public: 171 public:
172 V8StringResource() 172 V8StringResource()
173 : m_mode(Externalize) 173 : m_mode(Externalize)
174 { 174 {
175 } 175 }
176 176
177 V8StringResource(v8::Handle<v8::Value> object) 177 V8StringResource(v8::Local<v8::Value> object)
178 : m_v8Object(object) 178 : m_v8Object(object)
179 , m_mode(Externalize) 179 , m_mode(Externalize)
180 { 180 {
181 } 181 }
182 182
183 V8StringResource(const String& string) 183 V8StringResource(const String& string)
184 : m_mode(Externalize) 184 : m_mode(Externalize)
185 , m_string(string) 185 , m_string(string)
186 { 186 {
187 } 187 }
188 188
189 void operator=(v8::Handle<v8::Value> object) 189 void operator=(v8::Local<v8::Value> object)
190 { 190 {
191 m_v8Object = object; 191 m_v8Object = object;
192 } 192 }
193 193
194 void operator=(const String& string) 194 void operator=(const String& string)
195 { 195 {
196 setString(string); 196 setString(string);
197 } 197 }
198 198
199 void operator=(std::nullptr_t) 199 void operator=(std::nullptr_t)
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 } 314 }
315 315
316 template<> inline String V8StringResource<TreatNullAndUndefinedAsNullString>::fa llbackString() const 316 template<> inline String V8StringResource<TreatNullAndUndefinedAsNullString>::fa llbackString() const
317 { 317 {
318 return String(); 318 return String();
319 } 319 }
320 320
321 } // namespace blink 321 } // namespace blink
322 322
323 #endif // V8StringResource_h 323 #endif // V8StringResource_h
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8PerIsolateData.cpp ('k') | Source/bindings/core/v8/V8StringResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698