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

Side by Side Diff: Source/modules/indexeddb/IDBOpenDBRequest.cpp

Issue 216523002: Oilpan: Replace most of RefPtrs for Event objects with oilpan's transition types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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) 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 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 bool IDBOpenDBRequest::shouldEnqueueEvent() const 138 bool IDBOpenDBRequest::shouldEnqueueEvent() const
139 { 139 {
140 if (m_contextStopped || !executionContext()) 140 if (m_contextStopped || !executionContext())
141 return false; 141 return false;
142 ASSERT(m_readyState == PENDING || m_readyState == DONE); 142 ASSERT(m_readyState == PENDING || m_readyState == DONE);
143 if (m_requestAborted) 143 if (m_requestAborted)
144 return false; 144 return false;
145 return true; 145 return true;
146 } 146 }
147 147
148 bool IDBOpenDBRequest::dispatchEvent(PassRefPtr<Event> event) 148 bool IDBOpenDBRequest::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event)
149 { 149 {
150 // If the connection closed between onUpgradeNeeded and the delivery of the "success" event, 150 // If the connection closed between onUpgradeNeeded and the delivery of the "success" event,
151 // an "error" event should be fired instead. 151 // an "error" event should be fired instead.
152 if (event->type() == EventTypeNames::success && resultAsAny()->type() == IDB Any::IDBDatabaseType && resultAsAny()->idbDatabase()->isClosePending()) { 152 if (event->type() == EventTypeNames::success && resultAsAny()->type() == IDB Any::IDBDatabaseType && resultAsAny()->idbDatabase()->isClosePending()) {
153 dequeueEvent(event.get()); 153 dequeueEvent(event.get());
154 setResult(nullptr); 154 setResult(nullptr);
155 onError(DOMError::create(AbortError, "The connection was closed.")); 155 onError(DOMError::create(AbortError, "The connection was closed."));
156 return false; 156 return false;
157 } 157 }
158 158
159 return IDBRequest::dispatchEvent(event); 159 return IDBRequest::dispatchEvent(event);
160 } 160 }
161 161
162 } // namespace WebCore 162 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698