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

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

Issue 21735005: Use "int" instead of "long" for bindings where the WebIDL uses "long". (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 23 matching lines...) Expand all
34 #include "core/dom/ExceptionCode.h" 34 #include "core/dom/ExceptionCode.h"
35 #include "core/workers/WorkerGlobalScope.h" 35 #include "core/workers/WorkerGlobalScope.h"
36 #include "modules/webdatabase/Database.h" 36 #include "modules/webdatabase/Database.h"
37 #include "modules/webdatabase/DatabaseCallback.h" 37 #include "modules/webdatabase/DatabaseCallback.h"
38 #include "modules/webdatabase/DatabaseManager.h" 38 #include "modules/webdatabase/DatabaseManager.h"
39 #include "modules/webdatabase/DatabaseSync.h" 39 #include "modules/webdatabase/DatabaseSync.h"
40 #include "weborigin/SecurityOrigin.h" 40 #include "weborigin/SecurityOrigin.h"
41 41
42 namespace WebCore { 42 namespace WebCore {
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 estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, Excepti onState& 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.throwDOMException(DatabaseManager::exceptionCodeForDatabaseError( error));
54 } else { 54 } else {
55 es.throwDOMException(SecurityError); 55 es.throwDOMException(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 estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, 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.throwDOMException(DatabaseManager::exceptionCodeForDatabaseError( error));
71 } else { 71 } else {
72 es.throwDOMException(SecurityError); 72 es.throwDOMException(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/WorkerGlobalScopeWebDatabase.h ('k') | Source/modules/websockets/WebSocket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698