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

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

Issue 1158973007: IndexedDB: Rely on bindings for enum validation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased 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
« no previous file with comments | « Source/modules/indexeddb/IDBTransaction.h ('k') | no next file » | 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 } 292 }
293 293
294 bool IDBTransaction::hasPendingActivity() const 294 bool IDBTransaction::hasPendingActivity() const
295 { 295 {
296 // FIXME: In an ideal world, we should return true as long as anyone has a o r can 296 // FIXME: In an ideal world, we should return true as long as anyone has a o r can
297 // get a handle to us or any child request object and any of those ha ve 297 // get a handle to us or any child request object and any of those ha ve
298 // event listeners. This is in order to handle user generated events properly. 298 // event listeners. This is in order to handle user generated events properly.
299 return m_hasPendingActivity && !m_contextStopped; 299 return m_hasPendingActivity && !m_contextStopped;
300 } 300 }
301 301
302 WebIDBTransactionMode IDBTransaction::stringToMode(const String& modeString, Exc eptionState& exceptionState) 302 WebIDBTransactionMode IDBTransaction::stringToMode(const String& modeString)
303 { 303 {
304 if (modeString == IndexedDBNames::readonly) 304 if (modeString == IndexedDBNames::readonly)
305 return WebIDBTransactionModeReadOnly; 305 return WebIDBTransactionModeReadOnly;
306 if (modeString == IndexedDBNames::readwrite) 306 if (modeString == IndexedDBNames::readwrite)
307 return WebIDBTransactionModeReadWrite; 307 return WebIDBTransactionModeReadWrite;
308 308 if (modeString == IndexedDBNames::versionchange)
309 exceptionState.throwTypeError("The mode provided ('" + modeString + "') is n ot one of 'readonly' or 'readwrite'."); 309 return WebIDBTransactionModeVersionChange;
310 ASSERT_NOT_REACHED();
310 return WebIDBTransactionModeReadOnly; 311 return WebIDBTransactionModeReadOnly;
311 } 312 }
312 313
313 const String& IDBTransaction::mode() const 314 const String& IDBTransaction::mode() const
314 { 315 {
315 switch (m_mode) { 316 switch (m_mode) {
316 case WebIDBTransactionModeReadOnly: 317 case WebIDBTransactionModeReadOnly:
317 return IndexedDBNames::readonly; 318 return IndexedDBNames::readonly;
318 319
319 case WebIDBTransactionModeReadWrite: 320 case WebIDBTransactionModeReadWrite:
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 event->setTarget(this); 408 event->setTarget(this);
408 eventQueue->enqueueEvent(event); 409 eventQueue->enqueueEvent(event);
409 } 410 }
410 411
411 WebIDBDatabase* IDBTransaction::backendDB() const 412 WebIDBDatabase* IDBTransaction::backendDB() const
412 { 413 {
413 return m_database->backend(); 414 return m_database->backend();
414 } 415 }
415 416
416 } // namespace blink 417 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/indexeddb/IDBTransaction.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698