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

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

Issue 2375873003: Make DOMWindowProperty::m_frame private (Closed)
Patch Set: Created 4 years, 2 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"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return applications; 64 return applications;
65 } 65 }
66 }; 66 };
67 67
68 ScriptPromise NavigatorInstalledApp::getInstalledRelatedApps(ScriptState* script State) 68 ScriptPromise NavigatorInstalledApp::getInstalledRelatedApps(ScriptState* script State)
69 { 69 {
70 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ; 70 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ;
71 ScriptPromise promise = resolver->promise(); 71 ScriptPromise promise = resolver->promise();
72 72
73 // Don't crash when called and unattached to document. 73 // Don't crash when called and unattached to document.
74 Document* document = m_frame ? m_frame->document() : 0; 74 Document* document = frame() ? frame()->document() : 0;
75 75
76 if (!document || !controller()) { 76 if (!document || !controller()) {
77 DOMException* exception = DOMException::create(InvalidStateError, "The o bject is no longer associated to a document."); 77 DOMException* exception = DOMException::create(InvalidStateError, "The o bject is no longer associated to a document.");
78 resolver->reject(exception); 78 resolver->reject(exception);
79 return promise; 79 return promise;
80 } 80 }
81 81
82 controller()->getInstalledApps( 82 controller()->getInstalledApps(
83 WebSecurityOrigin(scriptState->getExecutionContext()->getSecurityOrigin( )), 83 WebSecurityOrigin(scriptState->getExecutionContext()->getSecurityOrigin( )),
84 wrapUnique(new CallbackPromiseAdapter<RelatedAppArray, void>(resolver))) ; 84 wrapUnique(new CallbackPromiseAdapter<RelatedAppArray, void>(resolver))) ;
(...skipping 13 matching lines...) Expand all
98 return "NavigatorInstalledApp"; 98 return "NavigatorInstalledApp";
99 } 99 }
100 100
101 DEFINE_TRACE(NavigatorInstalledApp) 101 DEFINE_TRACE(NavigatorInstalledApp)
102 { 102 {
103 Supplement<Navigator>::trace(visitor); 103 Supplement<Navigator>::trace(visitor);
104 DOMWindowProperty::trace(visitor); 104 DOMWindowProperty::trace(visitor);
105 } 105 }
106 106
107 } // namespace blink 107 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698