OLD | NEW |
---|---|
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 #ifndef ToV8ForModules_h | 5 #ifndef ToV8ForModules_h |
6 #define ToV8ForModules_h | 6 #define ToV8ForModules_h |
7 | 7 |
8 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
9 #include "modules/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
10 #include "modules/webdatabase/sqlite/SQLValue.h" | 10 #include "modules/webdatabase/sqlite/SQLValue.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class IDBAny; | 14 class IDBAny; |
15 class IDBKey; | 15 class IDBKey; |
16 class IDBKeyPath; | 16 class IDBKeyPath; |
17 class WorkletGlobalScope; | |
17 | 18 |
18 inline v8::Local<v8::Value> toV8(const SQLValue& sqlValue, v8::Local<v8::Object> creationContext, v8::Isolate* isolate) | 19 inline v8::Local<v8::Value> toV8(const SQLValue& sqlValue, v8::Local<v8::Object> creationContext, v8::Isolate* isolate) |
19 { | 20 { |
20 switch (sqlValue.type()) { | 21 switch (sqlValue.type()) { |
21 case SQLValue::NullValue: | 22 case SQLValue::NullValue: |
22 return v8::Null(isolate); | 23 return v8::Null(isolate); |
23 case SQLValue::NumberValue: | 24 case SQLValue::NumberValue: |
24 return v8::Number::New(isolate, sqlValue.number()); | 25 return v8::Number::New(isolate, sqlValue.number()); |
25 case SQLValue::StringValue: | 26 case SQLValue::StringValue: |
26 return v8String(isolate, sqlValue.string()); | 27 return v8String(isolate, sqlValue.string()); |
27 } | 28 } |
28 ASSERT_NOT_REACHED(); | 29 ASSERT_NOT_REACHED(); |
29 return v8::Local<v8::Value>(); | 30 return v8::Local<v8::Value>(); |
30 } | 31 } |
31 | 32 |
32 v8::Local<v8::Value> toV8(const IDBKeyPath&, v8::Local<v8::Object> creationConte xt, v8::Isolate*); | 33 v8::Local<v8::Value> toV8(const IDBKeyPath&, v8::Local<v8::Object> creationConte xt, v8::Isolate*); |
33 MODULES_EXPORT v8::Local<v8::Value> toV8(const IDBKey*, v8::Local<v8::Object> cr eationContext, v8::Isolate*); | 34 MODULES_EXPORT v8::Local<v8::Value> toV8(const IDBKey*, v8::Local<v8::Object> cr eationContext, v8::Isolate*); |
34 v8::Local<v8::Value> toV8(const IDBAny*, v8::Local<v8::Object> creationContext, v8::Isolate*); | 35 v8::Local<v8::Value> toV8(const IDBAny*, v8::Local<v8::Object> creationContext, v8::Isolate*); |
36 v8::Local<v8::Value> toV8(WorkletGlobalScope*, v8::Local<v8::Object> creationCon text, v8::Isolate*); | |
haraken
2016/01/05 06:08:06
Can we remove this method by changing toV8(WorkerG
ikilpatrick
2016/01/07 22:47:35
Currently WorkerGlobalScope and WorkletGlobalScope
haraken
2016/01/08 04:59:07
Yeah, I think it's better to introduce WorkerOrWor
ikilpatrick
2016/01/11 04:13:19
Done.
| |
35 | 37 |
36 } // namespace blink | 38 } // namespace blink |
37 | 39 |
38 #endif // ToV8ForModules_h | 40 #endif // ToV8ForModules_h |
39 | 41 |
OLD | NEW |