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

Side by Side Diff: third_party/WebKit/Source/modules/permissions/PermissionCallback.cpp

Issue 2108003002: Merge //content/child/permissions into Blink's permissions module. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 5 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "modules/permissions/PermissionCallback.h"
6
7 #include "bindings/core/v8/ScriptPromiseResolver.h"
8 #include "modules/permissions/PermissionStatus.h"
9
10 namespace blink {
11
12 PermissionCallback::PermissionCallback(ScriptPromiseResolver* resolver, WebPermi ssionType permissionType)
13 : m_resolver(resolver)
14 , m_permissionType(permissionType)
15 {
16 ASSERT(m_resolver);
17 }
18
19 PermissionCallback::~PermissionCallback()
20 {
21 }
22
23 void PermissionCallback::onSuccess(WebPermissionStatus permissionStatus)
24 {
25 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()- >activeDOMObjectsAreStopped()) {
26 return;
27 }
28 m_resolver->resolve(PermissionStatus::take(m_resolver.get(), permissionStatu s, m_permissionType));
29 }
30
31 void PermissionCallback::onError()
32 {
33 if (!m_resolver->getExecutionContext() || m_resolver->getExecutionContext()- >activeDOMObjectsAreStopped()) {
34 return;
35 }
36 m_resolver->reject();
37 }
38
39 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698