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

Side by Side Diff: Source/bindings/v8/V8ScriptValue.h

Issue 289083003: [dartium] Dart half of ScriptValue refactoring. (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/1916
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/dart/scripts/dart_types.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 bool operator==(const V8ScriptValue& value) const 94 bool operator==(const V8ScriptValue& value) const
95 { 95 {
96 if (hasNoValue()) 96 if (hasNoValue())
97 return value.hasNoValue(); 97 return value.hasNoValue();
98 if (value.hasNoValue()) 98 if (value.hasNoValue())
99 return false; 99 return false;
100 return *m_value == *value.m_value; 100 return *m_value == *value.m_value;
101 } 101 }
102 102
103 bool isEqual(ScriptState*, const V8ScriptValue& value) const
104 {
105 return operator==(value);
106 }
107
108 // Note: This creates a new local Handle; not to be used in cases where is 103 // Note: This creates a new local Handle; not to be used in cases where is
109 // is an efficiency problem. 104 // is an efficiency problem.
110 bool isFunction() const 105 bool isFunction() const
111 { 106 {
112 ASSERT(!hasNoValue()); 107 ASSERT(!hasNoValue());
113 v8::Handle<v8::Value> value = v8Value(); 108 v8::Handle<v8::Value> value = v8Value();
114 return !value.IsEmpty() && value->IsFunction(); 109 return !value.IsEmpty() && value->IsFunction();
115 } 110 }
116 111
117 bool operator!=(const V8ScriptValue& value) const 112 bool operator!=(const V8ScriptValue& value) const
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 : m_isolate(isolate) 174 : m_isolate(isolate)
180 , m_value(value.IsEmpty() ? nullptr : SharedPersistent<v8::Value>::creat e(value, isolate)) 175 , m_value(value.IsEmpty() ? nullptr : SharedPersistent<v8::Value>::creat e(value, isolate))
181 { 176 {
182 } 177 }
183 178
184 }; 179 };
185 180
186 } // namespace WebCore 181 } // namespace WebCore
187 182
188 #endif // V8ScriptValue_h 183 #endif // V8ScriptValue_h
OLDNEW
« no previous file with comments | « Source/bindings/dart/scripts/dart_types.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698