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

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

Issue 236783002: Pass NewScriptState to idbAnyToScriptValue() and idbKeyToScriptValue() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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/modules/indexeddb/IDBKeyRange.h ('k') | Source/modules/indexeddb/IDBKeyRange.idl » ('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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 IDBKeyRange::IDBKeyRange(PassRefPtr<IDBKey> lower, PassRefPtr<IDBKey> upper, Low erBoundType lowerType, UpperBoundType upperType) 56 IDBKeyRange::IDBKeyRange(PassRefPtr<IDBKey> lower, PassRefPtr<IDBKey> upper, Low erBoundType lowerType, UpperBoundType upperType)
57 : m_lower(lower) 57 : m_lower(lower)
58 , m_upper(upper) 58 , m_upper(upper)
59 , m_lowerType(lowerType) 59 , m_lowerType(lowerType)
60 , m_upperType(upperType) 60 , m_upperType(upperType)
61 { 61 {
62 ScriptWrappable::init(this); 62 ScriptWrappable::init(this);
63 } 63 }
64 64
65 ScriptValue IDBKeyRange::lowerValue(ExecutionContext* context) const 65 ScriptValue IDBKeyRange::lowerValue(NewScriptState* scriptState) const
66 { 66 {
67 DOMRequestState requestState(toIsolate(context)); 67 return idbKeyToScriptValue(scriptState, m_lower);
68 return idbKeyToScriptValue(&requestState, m_lower);
69 } 68 }
70 69
71 ScriptValue IDBKeyRange::upperValue(ExecutionContext* context) const 70 ScriptValue IDBKeyRange::upperValue(NewScriptState* scriptState) const
72 { 71 {
73 DOMRequestState requestState(toIsolate(context)); 72 return idbKeyToScriptValue(scriptState, m_upper);
74 return idbKeyToScriptValue(&requestState, m_upper);
75 } 73 }
76 74
77 PassRefPtr<IDBKeyRange> IDBKeyRange::only(PassRefPtr<IDBKey> prpKey, ExceptionSt ate& exceptionState) 75 PassRefPtr<IDBKeyRange> IDBKeyRange::only(PassRefPtr<IDBKey> prpKey, ExceptionSt ate& exceptionState)
78 { 76 {
79 RefPtr<IDBKey> key = prpKey; 77 RefPtr<IDBKey> key = prpKey;
80 if (!key || !key->isValid()) { 78 if (!key || !key->isValid()) {
81 exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErro rMessage); 79 exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErro rMessage);
82 return nullptr; 80 return nullptr;
83 } 81 }
84 82
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 135 }
138 if (upper->isEqual(lower.get()) && (lowerOpen || upperOpen)) { 136 if (upper->isEqual(lower.get()) && (lowerOpen || upperOpen)) {
139 exceptionState.throwDOMException(DataError, "The lower key and upper key are equal and one of the bounds is open."); 137 exceptionState.throwDOMException(DataError, "The lower key and upper key are equal and one of the bounds is open.");
140 return nullptr; 138 return nullptr;
141 } 139 }
142 140
143 return IDBKeyRange::create(lower, upper, lowerOpen ? LowerBoundOpen : LowerB oundClosed, upperOpen ? UpperBoundOpen : UpperBoundClosed); 141 return IDBKeyRange::create(lower, upper, lowerOpen ? LowerBoundOpen : LowerB oundClosed, upperOpen ? UpperBoundOpen : UpperBoundClosed);
144 } 142 }
145 143
146 } // namespace WebCore 144 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/indexeddb/IDBKeyRange.h ('k') | Source/modules/indexeddb/IDBKeyRange.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698