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

Side by Side Diff: WebCore/bindings/v8/IDBBindingUtilities.cpp

Issue 5800002: Merge 73697 - 2010-12-10 Hans Wennborg <hans@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 10 years 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
« no previous file with comments | « WebCore/ChangeLog ('k') | WebCore/bindings/v8/custom/V8IDBKeyCustom.cpp » ('j') | 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 23 matching lines...) Expand all
34 #include "SerializedScriptValue.h" 34 #include "SerializedScriptValue.h"
35 #include "V8Binding.h" 35 #include "V8Binding.h"
36 #include <wtf/Vector.h> 36 #include <wtf/Vector.h>
37 37
38 namespace WebCore { 38 namespace WebCore {
39 39
40 PassRefPtr<IDBKey> createIDBKeyFromValue(v8::Handle<v8::Value> value) 40 PassRefPtr<IDBKey> createIDBKeyFromValue(v8::Handle<v8::Value> value)
41 { 41 {
42 if (value->IsNull()) 42 if (value->IsNull())
43 return IDBKey::create(); 43 return IDBKey::create();
44 if (value->IsInt32()) 44 if (value->IsNumber())
45 return IDBKey::create(value->Int32Value()); 45 return IDBKey::create(value->NumberValue());
46 if (value->IsString()) 46 if (value->IsString())
47 return IDBKey::create(v8ValueToWebCoreString(value)); 47 return IDBKey::create(v8ValueToWebCoreString(value));
48 if (value->IsDate()) 48 if (value->IsDate())
49 return 0; // Signals type error. FIXME: Implement dates. 49 return 0; // Signals type error. FIXME: Implement dates.
50 50
51 return 0; // Signals type error. 51 return 0; // Signals type error.
52 } 52 }
53 53
54 template<typename T> 54 template<typename T>
55 bool getValueFrom(T indexOrName, v8::Handle<v8::Value>& v8Value) 55 bool getValueFrom(T indexOrName, v8::Handle<v8::Value>& v8Value)
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 default: 97 default:
98 ASSERT_NOT_REACHED(); 98 ASSERT_NOT_REACHED();
99 } 99 }
100 } 100 }
101 return createIDBKeyFromValue(v8Value); 101 return createIDBKeyFromValue(v8Value);
102 } 102 }
103 103
104 } // namespace WebCore 104 } // namespace WebCore
105 105
106 #endif 106 #endif
OLDNEW
« no previous file with comments | « WebCore/ChangeLog ('k') | WebCore/bindings/v8/custom/V8IDBKeyCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698