Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |