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

Side by Side Diff: Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.cpp

Issue 24469004: Amusingly deprecate the generic version of 'ExceptionState::throwDOMException'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 PassRefPtr<Database> WorkerGlobalScopeWebDatabase::openDatabase(WorkerGlobalScop e* context, const String& name, const String& version, const String& displayName , unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, Ex ceptionState& es) 44 PassRefPtr<Database> WorkerGlobalScopeWebDatabase::openDatabase(WorkerGlobalScop e* context, const String& name, const String& version, const String& displayName , unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, Ex ceptionState& es)
45 { 45 {
46 DatabaseManager& dbManager = DatabaseManager::manager(); 46 DatabaseManager& dbManager = DatabaseManager::manager();
47 RefPtr<Database> database; 47 RefPtr<Database> database;
48 DatabaseError error = DatabaseError::None; 48 DatabaseError error = DatabaseError::None;
49 if (RuntimeEnabledFeatures::databaseEnabled() && context->securityOrigin()-> canAccessDatabase()) { 49 if (RuntimeEnabledFeatures::databaseEnabled() && context->securityOrigin()-> canAccessDatabase()) {
50 database = dbManager.openDatabase(context, name, version, displayName, e stimatedSize, creationCallback, error); 50 database = dbManager.openDatabase(context, name, version, displayName, e stimatedSize, creationCallback, error);
51 ASSERT(database || error != DatabaseError::None); 51 ASSERT(database || error != DatabaseError::None);
52 if (error != DatabaseError::None) 52 if (error != DatabaseError::None)
53 es.throwDOMException(DatabaseManager::exceptionCodeForDatabaseError( error)); 53 es.throwUninformativeAndGenericDOMException(DatabaseManager::excepti onCodeForDatabaseError(error));
54 } else { 54 } else {
55 es.throwDOMException(SecurityError); 55 es.throwUninformativeAndGenericDOMException(SecurityError);
56 } 56 }
57 57
58 return database.release(); 58 return database.release();
59 } 59 }
60 60
61 PassRefPtr<DatabaseSync> WorkerGlobalScopeWebDatabase::openDatabaseSync(WorkerGl obalScope* context, const String& name, const String& version, const String& dis playName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCall back, ExceptionState& es) 61 PassRefPtr<DatabaseSync> WorkerGlobalScopeWebDatabase::openDatabaseSync(WorkerGl obalScope* context, const String& name, const String& version, const String& dis playName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCall back, ExceptionState& es)
62 { 62 {
63 DatabaseManager& dbManager = DatabaseManager::manager(); 63 DatabaseManager& dbManager = DatabaseManager::manager();
64 RefPtr<DatabaseSync> database; 64 RefPtr<DatabaseSync> database;
65 DatabaseError error = DatabaseError::None; 65 DatabaseError error = DatabaseError::None;
66 if (RuntimeEnabledFeatures::databaseEnabled() && context->securityOrigin()-> canAccessDatabase()) { 66 if (RuntimeEnabledFeatures::databaseEnabled() && context->securityOrigin()-> canAccessDatabase()) {
67 database = dbManager.openDatabaseSync(context, name, version, displayNam e, estimatedSize, creationCallback, error); 67 database = dbManager.openDatabaseSync(context, name, version, displayNam e, estimatedSize, creationCallback, error);
68 ASSERT(database || error != DatabaseError::None); 68 ASSERT(database || error != DatabaseError::None);
69 if (error != DatabaseError::None) 69 if (error != DatabaseError::None)
70 es.throwDOMException(DatabaseManager::exceptionCodeForDatabaseError( error)); 70 es.throwUninformativeAndGenericDOMException(DatabaseManager::excepti onCodeForDatabaseError(error));
71 } else { 71 } else {
72 es.throwDOMException(SecurityError); 72 es.throwUninformativeAndGenericDOMException(SecurityError);
73 } 73 }
74 74
75 return database.release(); 75 return database.release();
76 } 76 }
77 77
78 } // namespace WebCore 78 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/webdatabase/SQLTransactionBackendSync.cpp ('k') | Source/modules/webmidi/MIDIOutput.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698