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

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

Issue 2815313002: Reland of Move ScriptState::GetExecutionContext (Part 5) (Closed)
Patch Set: Created 3 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
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames) 59 // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames)
60 // are not associated with transactions. 60 // are not associated with transactions.
61 if (transaction) 61 if (transaction)
62 transaction->RegisterRequest(request); 62 transaction->RegisterRequest(request);
63 return request; 63 return request;
64 } 64 }
65 65
66 IDBRequest::IDBRequest(ScriptState* script_state, 66 IDBRequest::IDBRequest(ScriptState* script_state,
67 IDBAny* source, 67 IDBAny* source,
68 IDBTransaction* transaction) 68 IDBTransaction* transaction)
69 : SuspendableObject(script_state->GetExecutionContext()), 69 : SuspendableObject(ExecutionContext::From(script_state)),
70 transaction_(transaction), 70 transaction_(transaction),
71 isolate_(script_state->GetIsolate()), 71 isolate_(script_state->GetIsolate()),
72 source_(source) {} 72 source_(source) {}
73 73
74 IDBRequest::~IDBRequest() { 74 IDBRequest::~IDBRequest() {
75 DCHECK(ready_state_ == DONE || ready_state_ == kEarlyDeath || 75 DCHECK(ready_state_ == DONE || ready_state_ == kEarlyDeath ||
76 !GetExecutionContext()); 76 !GetExecutionContext());
77 } 77 }
78 78
79 DEFINE_TRACE(IDBRequest) { 79 DEFINE_TRACE(IDBRequest) {
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 } 553 }
554 554
555 void IDBRequest::DequeueEvent(Event* event) { 555 void IDBRequest::DequeueEvent(Event* event) {
556 for (size_t i = 0; i < enqueued_events_.size(); ++i) { 556 for (size_t i = 0; i < enqueued_events_.size(); ++i) {
557 if (enqueued_events_[i].Get() == event) 557 if (enqueued_events_[i].Get() == event)
558 enqueued_events_.erase(i); 558 enqueued_events_.erase(i);
559 } 559 }
560 } 560 }
561 561
562 } // namespace blink 562 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698