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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp

Issue 2660423003: Atomics.wait throws when called on the main thread. (Closed)
Patch Set: nit Created 3 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 | « third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/workers/worker-atomics-wait-expected.txt ('k') | 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 static void beforeCallEnteredCallback(v8::Isolate* isolate) { 48 static void beforeCallEnteredCallback(v8::Isolate* isolate) {
49 RELEASE_ASSERT(!ScriptForbiddenScope::isScriptForbidden()); 49 RELEASE_ASSERT(!ScriptForbiddenScope::isScriptForbidden());
50 } 50 }
51 51
52 static void microtasksCompletedCallback(v8::Isolate* isolate) { 52 static void microtasksCompletedCallback(v8::Isolate* isolate) {
53 V8PerIsolateData::from(isolate)->runEndOfScopeTasks(); 53 V8PerIsolateData::from(isolate)->runEndOfScopeTasks();
54 } 54 }
55 55
56 V8PerIsolateData::V8PerIsolateData(WebTaskRunner* taskRunner) 56 V8PerIsolateData::V8PerIsolateData(WebTaskRunner* taskRunner)
57 : m_isolateHolder(WTF::makeUnique<gin::IsolateHolder>( 57 : m_isolateHolder(WTF::makeUnique<gin::IsolateHolder>(
58 taskRunner ? taskRunner->toSingleThreadTaskRunner() : nullptr)), 58 taskRunner ? taskRunner->toSingleThreadTaskRunner() : nullptr,
59 gin::IsolateHolder::kSingleThread,
60 isMainThread() ? gin::IsolateHolder::kDisallowAtomicsWait
61 : gin::IsolateHolder::kAllowAtomicsWait)),
59 m_stringCache(WTF::wrapUnique(new StringCache(isolate()))), 62 m_stringCache(WTF::wrapUnique(new StringCache(isolate()))),
60 m_hiddenValue(V8HiddenValue::create()), 63 m_hiddenValue(V8HiddenValue::create()),
61 m_privateProperty(V8PrivateProperty::create()), 64 m_privateProperty(V8PrivateProperty::create()),
62 m_constructorMode(ConstructorMode::CreateNewObject), 65 m_constructorMode(ConstructorMode::CreateNewObject),
63 m_useCounterDisabled(false), 66 m_useCounterDisabled(false),
64 m_isHandlingRecursionLevelError(false), 67 m_isHandlingRecursionLevelError(false),
65 m_isReportingException(false) { 68 m_isReportingException(false) {
66 // FIXME: Remove once all v8::Isolate::GetCurrent() calls are gone. 69 // FIXME: Remove once all v8::Isolate::GetCurrent() calls are gone.
67 isolate()->Enter(); 70 isolate()->Enter();
68 isolate()->AddBeforeCallEnteredCallback(&beforeCallEnteredCallback); 71 isolate()->AddBeforeCallEnteredCallback(&beforeCallEnteredCallback);
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 ScriptWrappableVisitor* current = currentVisitor(); 415 ScriptWrappableVisitor* current = currentVisitor();
413 if (current) 416 if (current)
414 current->performCleanup(); 417 current->performCleanup();
415 418
416 V8PerIsolateData::from(m_isolate)->m_scriptWrappableVisitor.swap( 419 V8PerIsolateData::from(m_isolate)->m_scriptWrappableVisitor.swap(
417 m_savedVisitor); 420 m_savedVisitor);
418 m_isolate->SetEmbedderHeapTracer(currentVisitor()); 421 m_isolate->SetEmbedderHeapTracer(currentVisitor());
419 } 422 }
420 423
421 } // namespace blink 424 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/workers/worker-atomics-wait-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698