OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 world_ = | 107 world_ = |
108 DOMWrapperWorld::Create(isolate, DOMWrapperWorld::WorldType::kWorker); | 108 DOMWrapperWorld::Create(isolate, DOMWrapperWorld::WorldType::kWorker); |
109 } | 109 } |
110 | 110 |
111 WorkerOrWorkletScriptController::~WorkerOrWorkletScriptController() { | 111 WorkerOrWorkletScriptController::~WorkerOrWorkletScriptController() { |
112 DCHECK(!rejected_promises_); | 112 DCHECK(!rejected_promises_); |
113 } | 113 } |
114 | 114 |
115 void WorkerOrWorkletScriptController::Dispose() { | 115 void WorkerOrWorkletScriptController::Dispose() { |
116 rejected_promises_->Dispose(); | 116 rejected_promises_->Dispose(); |
117 rejected_promises_.Release(); | 117 rejected_promises_ = nullptr; |
118 | 118 |
119 world_->Dispose(); | 119 world_->Dispose(); |
120 | 120 |
121 DisposeContextIfNeeded(); | 121 DisposeContextIfNeeded(); |
122 } | 122 } |
123 | 123 |
124 void WorkerOrWorkletScriptController::DisposeContextIfNeeded() { | 124 void WorkerOrWorkletScriptController::DisposeContextIfNeeded() { |
125 if (!IsContextInitialized()) | 125 if (!IsContextInitialized()) |
126 return; | 126 return; |
127 | 127 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 execution_state_->error_event_from_imported_script_ = error_event; | 360 execution_state_->error_event_from_imported_script_ = error_event; |
361 exception_state.RethrowV8Exception( | 361 exception_state.RethrowV8Exception( |
362 V8ThrowException::CreateError(isolate_, error_message)); | 362 V8ThrowException::CreateError(isolate_, error_message)); |
363 } | 363 } |
364 | 364 |
365 DEFINE_TRACE(WorkerOrWorkletScriptController) { | 365 DEFINE_TRACE(WorkerOrWorkletScriptController) { |
366 visitor->Trace(global_scope_); | 366 visitor->Trace(global_scope_); |
367 } | 367 } |
368 | 368 |
369 } // namespace blink | 369 } // namespace blink |
OLD | NEW |