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

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

Issue 120063002: Improve modules' TypeError exception messages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 6 years, 11 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 } 282 }
283 283
284 IndexedDB::TransactionMode IDBTransaction::stringToMode(const String& modeString , ExceptionState& exceptionState) 284 IndexedDB::TransactionMode IDBTransaction::stringToMode(const String& modeString , ExceptionState& exceptionState)
285 { 285 {
286 if (modeString.isNull() 286 if (modeString.isNull()
287 || modeString == IDBTransaction::modeReadOnly()) 287 || modeString == IDBTransaction::modeReadOnly())
288 return IndexedDB::TransactionReadOnly; 288 return IndexedDB::TransactionReadOnly;
289 if (modeString == IDBTransaction::modeReadWrite()) 289 if (modeString == IDBTransaction::modeReadWrite())
290 return IndexedDB::TransactionReadWrite; 290 return IndexedDB::TransactionReadWrite;
291 291
292 exceptionState.throwUninformativeAndGenericTypeError(); 292 exceptionState.throwTypeError("The mode provided ('" + modeString + "') is n ot one of 'readonly' or 'readwrite'.");
293 return IndexedDB::TransactionReadOnly; 293 return IndexedDB::TransactionReadOnly;
294 } 294 }
295 295
296 const AtomicString& IDBTransaction::modeToString(IndexedDB::TransactionMode mode ) 296 const AtomicString& IDBTransaction::modeToString(IndexedDB::TransactionMode mode )
297 { 297 {
298 switch (mode) { 298 switch (mode) {
299 case IndexedDB::TransactionReadOnly: 299 case IndexedDB::TransactionReadOnly:
300 return IDBTransaction::modeReadOnly(); 300 return IDBTransaction::modeReadOnly();
301 break; 301 break;
302 302
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 event->setTarget(this); 377 event->setTarget(this);
378 eventQueue->enqueueEvent(event); 378 eventQueue->enqueueEvent(event);
379 } 379 }
380 380
381 blink::WebIDBDatabase* IDBTransaction::backendDB() const 381 blink::WebIDBDatabase* IDBTransaction::backendDB() const
382 { 382 {
383 return m_database->backend(); 383 return m_database->backend();
384 } 384 }
385 385
386 } // namespace WebCore 386 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/indexeddb/IDBObjectStore.cpp ('k') | Source/modules/mediastream/RTCPeerConnection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698