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

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

Issue 1158973007: IndexedDB: Rely on bindings for enum validation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Minimize diff Created 5 years, 6 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
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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 scope.add(name); 282 scope.add(name);
283 } else { 283 } else {
284 ASSERT_NOT_REACHED(); 284 ASSERT_NOT_REACHED();
285 } 285 }
286 286
287 if (scope.isEmpty()) { 287 if (scope.isEmpty()) {
288 exceptionState.throwDOMException(InvalidAccessError, "The storeNames par ameter was empty."); 288 exceptionState.throwDOMException(InvalidAccessError, "The storeNames par ameter was empty.");
289 return nullptr; 289 return nullptr;
290 } 290 }
291 291
292 WebIDBTransactionMode mode = IDBTransaction::stringToMode(modeString, except ionState); 292 WebIDBTransactionMode mode = IDBTransaction::stringToMode(modeString);
293 if (mode != WebIDBTransactionModeReadOnly && mode != WebIDBTransactionModeRe adWrite) {
jsbell 2015/06/02 19:01:07 Written this way instead of (mode == WebIDBTransac
294 exceptionState.throwTypeError("The mode provided ('" + modeString + "') is not one of 'readonly' or 'readwrite'.");
jsbell 2015/06/02 19:01:07 And similarly, this could be changed to e.g. "You
295 return nullptr;
296 }
297
293 if (exceptionState.hadException()) 298 if (exceptionState.hadException())
294 return nullptr; 299 return nullptr;
295 300
296 if (m_versionChangeTransaction) { 301 if (m_versionChangeTransaction) {
297 exceptionState.throwDOMException(InvalidStateError, "A version change tr ansaction is running."); 302 exceptionState.throwDOMException(InvalidStateError, "A version change tr ansaction is running.");
298 return nullptr; 303 return nullptr;
299 } 304 }
300 305
301 if (m_closePending) { 306 if (m_closePending) {
302 exceptionState.throwDOMException(InvalidStateError, "The database connec tion is closing."); 307 exceptionState.throwDOMException(InvalidStateError, "The database connec tion is closing.");
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 { 453 {
449 return EventTargetNames::IDBDatabase; 454 return EventTargetNames::IDBDatabase;
450 } 455 }
451 456
452 ExecutionContext* IDBDatabase::executionContext() const 457 ExecutionContext* IDBDatabase::executionContext() const
453 { 458 {
454 return ActiveDOMObject::executionContext(); 459 return ActiveDOMObject::executionContext();
455 } 460 }
456 461
457 } // namespace blink 462 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698