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

Side by Side Diff: gin/isolate_holder.cc

Issue 873723008: Wipe out isolate_ pointer after disposing it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gin/public/isolate_holder.h" 5 #include "gin/public/isolate_holder.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "base/files/memory_mapped_file.h" 10 #include "base/files/memory_mapped_file.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 size_t size; 247 size_t size;
248 isolate_->GetCodeRange(&code_range, &size); 248 isolate_->GetCodeRange(&code_range, &size);
249 Debug::CodeRangeDeletedCallback callback = 249 Debug::CodeRangeDeletedCallback callback =
250 DebugImpl::GetCodeRangeDeletedCallback(); 250 DebugImpl::GetCodeRangeDeletedCallback();
251 if (code_range && callback) 251 if (code_range && callback)
252 callback(code_range); 252 callback(code_range);
253 } 253 }
254 #endif 254 #endif
255 isolate_data_.reset(); 255 isolate_data_.reset();
256 isolate_->Dispose(); 256 isolate_->Dispose();
257 isolate_ = NULL;
257 } 258 }
258 259
259 // static 260 // static
260 void IsolateHolder::Initialize(ScriptMode mode, 261 void IsolateHolder::Initialize(ScriptMode mode,
261 v8::ArrayBuffer::Allocator* allocator) { 262 v8::ArrayBuffer::Allocator* allocator) {
262 CHECK(allocator); 263 CHECK(allocator);
263 static bool v8_is_initialized = false; 264 static bool v8_is_initialized = false;
264 if (v8_is_initialized) 265 if (v8_is_initialized)
265 return; 266 return;
266 v8::V8::InitializePlatform(V8Platform::Get()); 267 v8::V8::InitializePlatform(V8Platform::Get());
(...skipping 29 matching lines...) Expand all
296 base::MessageLoop::current()->AddTaskObserver(task_observer_.get()); 297 base::MessageLoop::current()->AddTaskObserver(task_observer_.get());
297 } 298 }
298 299
299 void IsolateHolder::RemoveRunMicrotasksObserver() { 300 void IsolateHolder::RemoveRunMicrotasksObserver() {
300 DCHECK(task_observer_.get()); 301 DCHECK(task_observer_.get());
301 base::MessageLoop::current()->RemoveTaskObserver(task_observer_.get()); 302 base::MessageLoop::current()->RemoveTaskObserver(task_observer_.get());
302 task_observer_.reset(); 303 task_observer_.reset();
303 } 304 }
304 305
305 } // namespace gin 306 } // namespace gin
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698