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

Side by Side Diff: Source/modules/indexeddb/IDBKeyRange.cpp

Issue 337343002: IDL: make optional arguments (without default) explicit sometimes Base URL: https://chromium.googlesource.com/chromium/blink.git@idl-default-arguments-next
Patch Set: Created 6 years, 4 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
« no previous file with comments | « Source/modules/indexeddb/IDBIndex.idl ('k') | Source/modules/indexeddb/IDBObjectStore.h » ('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 17 matching lines...) Expand all
28 28
29 #include "bindings/core/v8/ExceptionState.h" 29 #include "bindings/core/v8/ExceptionState.h"
30 #include "bindings/modules/v8/IDBBindingUtilities.h" 30 #include "bindings/modules/v8/IDBBindingUtilities.h"
31 #include "core/dom/ExceptionCode.h" 31 #include "core/dom/ExceptionCode.h"
32 #include "modules/indexeddb/IDBDatabase.h" 32 #include "modules/indexeddb/IDBDatabase.h"
33 33
34 namespace blink { 34 namespace blink {
35 35
36 IDBKeyRange* IDBKeyRange::fromScriptValue(ExecutionContext* context, const Scrip tValue& value, ExceptionState& exceptionState) 36 IDBKeyRange* IDBKeyRange::fromScriptValue(ExecutionContext* context, const Scrip tValue& value, ExceptionState& exceptionState)
37 { 37 {
38 if (value.isUndefined() || value.isNull()) 38 if (value.isEmpty() || value.isUndefined() || value.isNull())
39 return 0; 39 return 0;
40 40
41 IDBKeyRange* range = scriptValueToIDBKeyRange(toIsolate(context), value); 41 IDBKeyRange* range = scriptValueToIDBKeyRange(toIsolate(context), value);
42 if (range) 42 if (range)
43 return range; 43 return range;
44 44
45 IDBKey* key = scriptValueToIDBKey(toIsolate(context), value); 45 IDBKey* key = scriptValueToIDBKey(toIsolate(context), value);
46 if (!key || !key->isValid()) { 46 if (!key || !key->isValid()) {
47 exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErro rMessage); 47 exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErro rMessage);
48 return 0; 48 return 0;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 if (upper->isEqual(lower) && (lowerOpen || upperOpen)) { 135 if (upper->isEqual(lower) && (lowerOpen || upperOpen)) {
136 exceptionState.throwDOMException(DataError, "The lower key and upper key are equal and one of the bounds is open."); 136 exceptionState.throwDOMException(DataError, "The lower key and upper key are equal and one of the bounds is open.");
137 return 0; 137 return 0;
138 } 138 }
139 139
140 return IDBKeyRange::create(lower, upper, lowerOpen ? LowerBoundOpen : LowerB oundClosed, upperOpen ? UpperBoundOpen : UpperBoundClosed); 140 return IDBKeyRange::create(lower, upper, lowerOpen ? LowerBoundOpen : LowerB oundClosed, upperOpen ? UpperBoundOpen : UpperBoundClosed);
141 } 141 }
142 142
143 } // namespace blink 143 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/indexeddb/IDBIndex.idl ('k') | Source/modules/indexeddb/IDBObjectStore.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698