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

Side by Side Diff: third_party/WebKit/Source/modules/webdatabase/DatabaseManager.cpp

Issue 2098433002: Remove ExecutionContextTask::taskNameForInstrumentation() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « third_party/WebKit/Source/modules/filesystem/DOMFileSystem.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) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 static std::unique_ptr<DatabaseCreationCallbackTask> create(Database* databa se, DatabaseCallback* creationCallback) 80 static std::unique_ptr<DatabaseCreationCallbackTask> create(Database* databa se, DatabaseCallback* creationCallback)
81 { 81 {
82 return wrapUnique(new DatabaseCreationCallbackTask(database, creationCal lback)); 82 return wrapUnique(new DatabaseCreationCallbackTask(database, creationCal lback));
83 } 83 }
84 84
85 void performTask(ExecutionContext*) override 85 void performTask(ExecutionContext*) override
86 { 86 {
87 m_creationCallback->handleEvent(m_database.get()); 87 m_creationCallback->handleEvent(m_database.get());
88 } 88 }
89 89
90 String taskNameForInstrumentation() const override
91 {
92 return "openDatabase";
93 }
94
95 private: 90 private:
96 DatabaseCreationCallbackTask(Database* database, DatabaseCallback* callback) 91 DatabaseCreationCallbackTask(Database* database, DatabaseCallback* callback)
97 : m_database(database) 92 : m_database(database)
98 , m_creationCallback(callback) 93 , m_creationCallback(callback)
99 { 94 {
100 } 95 }
101 96
102 Persistent<Database> m_database; 97 Persistent<Database> m_database;
103 Persistent<DatabaseCallback> m_creationCallback; 98 Persistent<DatabaseCallback> m_creationCallback;
104 }; 99 };
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 Database* database = openDatabaseInternal(context, name, 207 Database* database = openDatabaseInternal(context, name,
213 expectedVersion, displayName, estimatedSize, setVersionInNewDatabase, er ror, errorMessage); 208 expectedVersion, displayName, estimatedSize, setVersionInNewDatabase, er ror, errorMessage);
214 if (!database) 209 if (!database)
215 return nullptr; 210 return nullptr;
216 211
217 databaseContextFor(context)->setHasOpenDatabases(); 212 databaseContextFor(context)->setHasOpenDatabases();
218 DatabaseClient::from(context)->didOpenDatabase(database, context->getSecurit yOrigin()->host(), name, expectedVersion); 213 DatabaseClient::from(context)->didOpenDatabase(database, context->getSecurit yOrigin()->host(), name, expectedVersion);
219 214
220 if (database->isNew() && creationCallback) { 215 if (database->isNew() && creationCallback) {
221 WTF_LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for databas e %p\n", database); 216 WTF_LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for databas e %p\n", database);
222 database->getExecutionContext()->postTask(BLINK_FROM_HERE, DatabaseCreat ionCallbackTask::create(database, creationCallback)); 217 database->getExecutionContext()->postTask(BLINK_FROM_HERE, DatabaseCreat ionCallbackTask::create(database, creationCallback), "openDatabase");
223 } 218 }
224 219
225 ASSERT(database); 220 ASSERT(database);
226 return database; 221 return database;
227 } 222 }
228 223
229 String DatabaseManager::fullPathForDatabase(SecurityOrigin* origin, const String & name, bool createIfDoesNotExist) 224 String DatabaseManager::fullPathForDatabase(SecurityOrigin* origin, const String & name, bool createIfDoesNotExist)
230 { 225 {
231 return DatabaseTracker::tracker().fullPathForDatabase(origin, name, createIf DoesNotExist); 226 return DatabaseTracker::tracker().fullPathForDatabase(origin, name, createIf DoesNotExist);
232 } 227 }
233 228
234 void DatabaseManager::logErrorMessage(ExecutionContext* context, const String& m essage) 229 void DatabaseManager::logErrorMessage(ExecutionContext* context, const String& m essage)
235 { 230 {
236 context->addConsoleMessage(ConsoleMessage::create(StorageMessageSource, Erro rMessageLevel, message)); 231 context->addConsoleMessage(ConsoleMessage::create(StorageMessageSource, Erro rMessageLevel, message));
237 } 232 }
238 233
239 } // namespace blink 234 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/filesystem/DOMFileSystem.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698