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: Source/modules/permissions/Permissions.cpp

Issue 1033963002: Oilpan: finalization of Permissions and SyncManager not needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 | « Source/modules/permissions/Permissions.h ('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 // 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 "modules/permissions/Permissions.h" 6 #include "modules/permissions/Permissions.h"
7 7
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptPromiseResolver.h" 9 #include "bindings/core/v8/ScriptPromiseResolver.h"
10 #include "core/dom/DOMException.h" 10 #include "core/dom/DOMException.h"
(...skipping 15 matching lines...) Expand all
26 if (!document->frame()) 26 if (!document->frame())
27 return nullptr; 27 return nullptr;
28 PermissionController* controller = PermissionController::from(*document- >frame()); 28 PermissionController* controller = PermissionController::from(*document- >frame());
29 return controller ? controller->client() : nullptr; 29 return controller ? controller->client() : nullptr;
30 } 30 }
31 return Platform::current()->permissionClient(); 31 return Platform::current()->permissionClient();
32 } 32 }
33 33
34 } // anonymous namespace 34 } // anonymous namespace
35 35
36 Permissions::~Permissions()
37 {
38 }
39
40 ScriptPromise Permissions::query(ScriptState* scriptState, const AtomicString& p ermissionName) 36 ScriptPromise Permissions::query(ScriptState* scriptState, const AtomicString& p ermissionName)
41 { 37 {
42 WebPermissionClient* client = permissionClient(scriptState->executionContext ()); 38 WebPermissionClient* client = permissionClient(scriptState->executionContext ());
43 if (!client) 39 if (!client)
44 return ScriptPromise::rejectWithDOMException(scriptState, DOMException:: create(InvalidStateError, "In its current state, the global scope can't query pe rmissions.")); 40 return ScriptPromise::rejectWithDOMException(scriptState, DOMException:: create(InvalidStateError, "In its current state, the global scope can't query pe rmissions."));
45 41
46 WebPermissionType type; 42 WebPermissionType type;
47 if (permissionName == "geolocation") { 43 if (permissionName == "geolocation") {
48 type = WebPermissionTypeGeolocation; 44 type = WebPermissionTypeGeolocation;
49 } else if (permissionName == "notifications") { 45 } else if (permissionName == "notifications") {
(...skipping 11 matching lines...) Expand all
61 ScriptPromise promise = resolver->promise(); 57 ScriptPromise promise = resolver->promise();
62 58
63 // If the current origin is a file scheme, it will unlikely return a 59 // If the current origin is a file scheme, it will unlikely return a
64 // meaningful value because most APIs are broken on file scheme and no 60 // meaningful value because most APIs are broken on file scheme and no
65 // permission prompt will be shown even if the returned permission will most 61 // permission prompt will be shown even if the returned permission will most
66 // likely be "prompt". 62 // likely be "prompt".
67 client->queryPermission(type, KURL(KURL(), scriptState->executionContext()-> securityOrigin()->toString()), new PermissionQueryCallback(resolver, type)); 63 client->queryPermission(type, KURL(KURL(), scriptState->executionContext()-> securityOrigin()->toString()), new PermissionQueryCallback(resolver, type));
68 return promise; 64 return promise;
69 } 65 }
70 66
71 DEFINE_TRACE(Permissions)
72 {
73 }
74
75 } // namespace blink 67 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/permissions/Permissions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698