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

Side by Side Diff: Source/core/inspector/InspectorIndexedDBAgent.cpp

Issue 22893058: IndexedDB: Replace IDL operation overloading with ScriptValue handling (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove assert, per review feedback Created 7 years, 3 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
« no previous file with comments | « Source/bindings/v8/IDBBindingUtilities.cpp ('k') | Source/modules/indexeddb/IDBIndex.h » ('j') | 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 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 RefPtr<OpenCursorCallback> openCursorCallback = OpenCursorCallback::crea te(m_injectedScript, m_requestCallback, m_skipCount, m_pageSize); 513 RefPtr<OpenCursorCallback> openCursorCallback = OpenCursorCallback::crea te(m_injectedScript, m_requestCallback, m_skipCount, m_pageSize);
514 514
515 RefPtr<IDBRequest> idbRequest; 515 RefPtr<IDBRequest> idbRequest;
516 if (!m_indexName.isEmpty()) { 516 if (!m_indexName.isEmpty()) {
517 RefPtr<IDBIndex> idbIndex = indexForObjectStore(idbObjectStore.get() , m_indexName); 517 RefPtr<IDBIndex> idbIndex = indexForObjectStore(idbObjectStore.get() , m_indexName);
518 if (!idbIndex) { 518 if (!idbIndex) {
519 m_requestCallback->sendFailure("Could not get index"); 519 m_requestCallback->sendFailure("Could not get index");
520 return; 520 return;
521 } 521 }
522 522
523 idbRequest = idbIndex->openCursor(context(), PassRefPtr<IDBKeyRange> (m_idbKeyRange), IDBCursor::directionNext(), IGNORE_EXCEPTION); 523 idbRequest = idbIndex->openCursor(context(), PassRefPtr<IDBKeyRange> (m_idbKeyRange), IndexedDB::CursorNext);
524 } else { 524 } else {
525 idbRequest = idbObjectStore->openCursor(context(), PassRefPtr<IDBKey Range>(m_idbKeyRange), IDBCursor::directionNext(), IGNORE_EXCEPTION); 525 idbRequest = idbObjectStore->openCursor(context(), PassRefPtr<IDBKey Range>(m_idbKeyRange), IndexedDB::CursorNext);
526 } 526 }
527 idbRequest->addEventListener(eventNames().successEvent, openCursorCallba ck, false); 527 idbRequest->addEventListener(eventNames().successEvent, openCursorCallba ck, false);
528 } 528 }
529 529
530 virtual RequestCallback* requestCallback() { return m_requestCallback.get(); } 530 virtual RequestCallback* requestCallback() { return m_requestCallback.get(); }
531 DataLoader(ScriptExecutionContext* scriptExecutionContext, PassRefPtr<Reques tDataCallback> requestCallback, const InjectedScript& injectedScript, const Stri ng& objectStoreName, const String& indexName, PassRefPtr<IDBKeyRange> idbKeyRang e, int skipCount, unsigned pageSize) 531 DataLoader(ScriptExecutionContext* scriptExecutionContext, PassRefPtr<Reques tDataCallback> requestCallback, const InjectedScript& injectedScript, const Stri ng& objectStoreName, const String& indexName, PassRefPtr<IDBKeyRange> idbKeyRang e, int skipCount, unsigned pageSize)
532 : ExecutableWithDatabase(scriptExecutionContext) 532 : ExecutableWithDatabase(scriptExecutionContext)
533 , m_requestCallback(requestCallback) 533 , m_requestCallback(requestCallback)
534 , m_injectedScript(injectedScript) 534 , m_injectedScript(injectedScript)
535 , m_objectStoreName(objectStoreName) 535 , m_objectStoreName(objectStoreName)
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 v8::HandleScope handleScope; 778 v8::HandleScope handleScope;
779 v8::Handle<v8::Context> context = document->frame()->script()->mainWorldCont ext(); 779 v8::Handle<v8::Context> context = document->frame()->script()->mainWorldCont ext();
780 ASSERT(!context.IsEmpty()); 780 ASSERT(!context.IsEmpty());
781 v8::Context::Scope contextScope(context); 781 v8::Context::Scope contextScope(context);
782 782
783 RefPtr<ClearObjectStore> clearObjectStore = ClearObjectStore::create(documen t, objectStoreName, requestCallback); 783 RefPtr<ClearObjectStore> clearObjectStore = ClearObjectStore::create(documen t, objectStoreName, requestCallback);
784 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName ); 784 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName );
785 } 785 }
786 786
787 } // namespace WebCore 787 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/IDBBindingUtilities.cpp ('k') | Source/modules/indexeddb/IDBIndex.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698