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

Side by Side Diff: third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.cpp

Issue 2815313002: Reland of Move ScriptState::GetExecutionContext (Part 5) (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "modules/installedapp/NavigatorInstalledApp.h" 5 #include "modules/installedapp/NavigatorInstalledApp.h"
6 6
7 #include "bindings/core/v8/CallbackPromiseAdapter.h" 7 #include "bindings/core/v8/CallbackPromiseAdapter.h"
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 "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
11 #include "core/dom/DOMException.h" 11 #include "core/dom/DOMException.h"
12 #include "core/dom/Document.h" 12 #include "core/dom/Document.h"
13 #include "core/dom/ExceptionCode.h" 13 #include "core/dom/ExceptionCode.h"
14 #include "core/dom/ExecutionContext.h"
14 #include "core/frame/LocalDOMWindow.h" 15 #include "core/frame/LocalDOMWindow.h"
15 #include "core/frame/LocalFrame.h" 16 #include "core/frame/LocalFrame.h"
16 #include "core/frame/Navigator.h" 17 #include "core/frame/Navigator.h"
17 #include "modules/installedapp/InstalledAppController.h" 18 #include "modules/installedapp/InstalledAppController.h"
18 #include "modules/installedapp/RelatedApplication.h" 19 #include "modules/installedapp/RelatedApplication.h"
19 #include "platform/wtf/PtrUtil.h" 20 #include "platform/wtf/PtrUtil.h"
20 #include "public/platform/modules/installedapp/WebRelatedApplication.h" 21 #include "public/platform/modules/installedapp/WebRelatedApplication.h"
21 22
22 namespace blink { 23 namespace blink {
23 24
(...skipping 14 matching lines...) Expand all
38 supplement = new NavigatorInstalledApp(navigator); 39 supplement = new NavigatorInstalledApp(navigator);
39 ProvideTo(navigator, SupplementName(), supplement); 40 ProvideTo(navigator, SupplementName(), supplement);
40 } 41 }
41 return *supplement; 42 return *supplement;
42 } 43 }
43 44
44 ScriptPromise NavigatorInstalledApp::getInstalledRelatedApps( 45 ScriptPromise NavigatorInstalledApp::getInstalledRelatedApps(
45 ScriptState* script_state, 46 ScriptState* script_state,
46 Navigator& navigator) { 47 Navigator& navigator) {
47 // [SecureContext] from the IDL ensures this. 48 // [SecureContext] from the IDL ensures this.
48 DCHECK(script_state->GetExecutionContext()->IsSecureContext()); 49 DCHECK(ExecutionContext::From(script_state)->IsSecureContext());
49 return NavigatorInstalledApp::From(navigator).getInstalledRelatedApps( 50 return NavigatorInstalledApp::From(navigator).getInstalledRelatedApps(
50 script_state); 51 script_state);
51 } 52 }
52 53
53 class RelatedAppArray { 54 class RelatedAppArray {
54 STATIC_ONLY(RelatedAppArray); 55 STATIC_ONLY(RelatedAppArray);
55 56
56 public: 57 public:
57 using WebType = const WebVector<WebRelatedApplication>&; 58 using WebType = const WebVector<WebRelatedApplication>&;
58 59
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 105
105 const char* NavigatorInstalledApp::SupplementName() { 106 const char* NavigatorInstalledApp::SupplementName() {
106 return "NavigatorInstalledApp"; 107 return "NavigatorInstalledApp";
107 } 108 }
108 109
109 DEFINE_TRACE(NavigatorInstalledApp) { 110 DEFINE_TRACE(NavigatorInstalledApp) {
110 Supplement<Navigator>::Trace(visitor); 111 Supplement<Navigator>::Trace(visitor);
111 } 112 }
112 113
113 } // namespace blink 114 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698