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

Side by Side Diff: third_party/WebKit/Source/bindings/modules/v8/ToV8ForModules.h

Issue 1535943005: Initial implementation of bindings and basic classes for worklets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address (most) comments. Created 4 years, 11 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 // 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*);
35 37
36 } // namespace blink 38 } // namespace blink
37 39
38 #endif // ToV8ForModules_h 40 #endif // ToV8ForModules_h
39 41
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698