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

Side by Side Diff: third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp

Issue 2890023003: [IndexedDB] Adding async tracing for renderer calls. (Closed)
Patch Set: fixed tests Created 3 years, 7 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
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 DCHECK(context->IsDocument() || context->IsWorkerGlobalScope()); 58 DCHECK(context->IsDocument() || context->IsWorkerGlobalScope());
59 if (context->IsDocument()) { 59 if (context->IsDocument()) {
60 Document* document = ToDocument(context); 60 Document* document = ToDocument(context);
61 return document->GetFrame() && document->GetPage(); 61 return document->GetFrame() && document->GetPage();
62 } 62 }
63 return true; 63 return true;
64 } 64 }
65 65
66 IDBRequest* IDBFactory::getDatabaseNames(ScriptState* script_state, 66 IDBRequest* IDBFactory::getDatabaseNames(ScriptState* script_state,
67 ExceptionState& exception_state) { 67 ExceptionState& exception_state) {
68 IDB_TRACE("IDBFactory::getDatabaseNames"); 68 IDB_TRACE("IDBFactory::getDatabaseNamesCall");
69 auto metrics = WTF::MakeUnique<IDBRequest::ScopedMetricsTracker>(
70 nullptr, "IDBFactory::getDatabaseNames", this);
69 if (!IsContextValid(ExecutionContext::From(script_state))) 71 if (!IsContextValid(ExecutionContext::From(script_state)))
70 return nullptr; 72 return nullptr;
71 if (!ExecutionContext::From(script_state) 73 if (!ExecutionContext::From(script_state)
72 ->GetSecurityOrigin() 74 ->GetSecurityOrigin()
73 ->CanAccessDatabase()) { 75 ->CanAccessDatabase()) {
74 exception_state.ThrowSecurityError( 76 exception_state.ThrowSecurityError(
75 "access to the Indexed Database API is denied in this context."); 77 "access to the Indexed Database API is denied in this context.");
76 return nullptr; 78 return nullptr;
77 } 79 }
78 80
79 IDBRequest* request = 81 IDBRequest* request = IDBRequest::Create(script_state, IDBAny::CreateNull(),
80 IDBRequest::Create(script_state, IDBAny::CreateNull(), nullptr); 82 nullptr, std::move(metrics));
81 83
82 if (!IndexedDBClient::From(ExecutionContext::From(script_state)) 84 if (!IndexedDBClient::From(ExecutionContext::From(script_state))
83 ->AllowIndexedDB(ExecutionContext::From(script_state), 85 ->AllowIndexedDB(ExecutionContext::From(script_state),
84 "Database Listing")) { 86 "Database Listing")) {
85 request->EnqueueResponse( 87 request->EnqueueResponse(
86 DOMException::Create(kUnknownError, kPermissionDeniedErrorMessage)); 88 DOMException::Create(kUnknownError, kPermissionDeniedErrorMessage));
87 return request; 89 return request;
88 } 90 }
89 91
90 Platform::Current()->IdbFactory()->GetDatabaseNames( 92 Platform::Current()->IdbFactory()->GetDatabaseNames(
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 if (!second->IsValid()) { 225 if (!second->IsValid()) {
224 exception_state.ThrowDOMException(kDataError, 226 exception_state.ThrowDOMException(kDataError,
225 IDBDatabase::kNotValidKeyErrorMessage); 227 IDBDatabase::kNotValidKeyErrorMessage);
226 return 0; 228 return 0;
227 } 229 }
228 230
229 return static_cast<short>(first->Compare(second)); 231 return static_cast<short>(first->Compare(second));
230 } 232 }
231 233
232 } // namespace blink 234 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698