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

Side by Side Diff: trunk/Source/bindings/v8/MIDIAccessResolver.cpp

Issue 218813002: Revert 170357 "Revert of Make DOMWrapperWorld::current() return ..." (Closed) Base URL: svn://svn.chromium.org/blink/
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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "config.h" 5 #include "config.h"
6 #include "bindings/v8/MIDIAccessResolver.h" 6 #include "bindings/v8/MIDIAccessResolver.h"
7 7
8 #include "bindings/v8/ScriptPromiseResolver.h" 8 #include "bindings/v8/ScriptPromiseResolver.h"
9 #include "bindings/v8/V8Binding.h" 9 #include "bindings/v8/V8Binding.h"
10 #include <v8.h> 10 #include <v8.h>
11 11
12 namespace WebCore { 12 namespace WebCore {
13 13
14 MIDIAccessResolver::MIDIAccessResolver(PassRefPtr<ScriptPromiseResolver> resolve r, v8::Isolate* isolate) 14 MIDIAccessResolver::MIDIAccessResolver(PassRefPtr<ScriptPromiseResolver> resolve r, v8::Isolate* isolate)
15 : m_resolver(resolver) 15 : m_resolver(resolver)
16 , m_world(DOMWrapperWorld::current(isolate)) 16 , m_world(DOMWrapperWorld::current(isolate))
17 { 17 {
18 } 18 }
19 19
20 MIDIAccessResolver::~MIDIAccessResolver() 20 MIDIAccessResolver::~MIDIAccessResolver()
21 { 21 {
22 } 22 }
23 23
24 void MIDIAccessResolver::resolve(MIDIAccess* access, ExecutionContext* execution Context) 24 void MIDIAccessResolver::resolve(MIDIAccess* access, ExecutionContext* execution Context)
25 { 25 {
26 v8::HandleScope handleScope(toIsolate(executionContext)); 26 v8::HandleScope handleScope(toIsolate(executionContext));
27 v8::Context::Scope contextScope(toV8Context(executionContext, m_world.get()) ); 27 v8::Context::Scope contextScope(toV8Context(executionContext, *m_world));
28 28
29 m_resolver->resolve(access, executionContext); 29 m_resolver->resolve(access, executionContext);
30 } 30 }
31 31
32 void MIDIAccessResolver::reject(DOMError* error, ExecutionContext* executionCont ext) 32 void MIDIAccessResolver::reject(DOMError* error, ExecutionContext* executionCont ext)
33 { 33 {
34 v8::HandleScope handleScope(toIsolate(executionContext)); 34 v8::HandleScope handleScope(toIsolate(executionContext));
35 v8::Context::Scope contextScope(toV8Context(executionContext, m_world.get()) ); 35 v8::Context::Scope contextScope(toV8Context(executionContext, *m_world));
36 36
37 m_resolver->reject(error, executionContext); 37 m_resolver->reject(error, executionContext);
38 } 38 }
39 39
40 } // namespace WebCore 40 } // namespace WebCore
OLDNEW
« no previous file with comments | « trunk/Source/bindings/v8/DOMWrapperWorld.cpp ('k') | trunk/Source/bindings/v8/ScriptController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698