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

Unified Diff: public/web/WebMIDIPermissionRequest.h

Issue 311773003: Decouple MIDIAccess initialization from MIDIAccess class. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « public/web/WebMIDIClient.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/web/WebMIDIPermissionRequest.h
diff --git a/public/web/WebMIDIPermissionRequest.h b/public/web/WebMIDIPermissionRequest.h
index a9f808d7880e374e16bcceb0acab580a378c451a..b863fe35eb5f3672fbf1bf21d0843e85bde27c31 100644
--- a/public/web/WebMIDIPermissionRequest.h
+++ b/public/web/WebMIDIPermissionRequest.h
@@ -32,41 +32,37 @@
#define WebMIDIPermissionRequest_h
#include "../platform/WebCommon.h"
-#include "../platform/WebPrivatePtr.h"
namespace WebCore {
-class MIDIAccess;
+class MIDIAccessInitializer;
}
namespace blink {
class WebSecurityOrigin;
-// WebMIDIPermissionRequest encapsulates a WebCore MIDIAccess object and represents
-// a request from WebCore for permissions.
-// The underlying MIDIAccess object is guaranteed to be valid until the invocation of
-// either WebMIDIPermissionRequest::setIsAllowed (request complete) or
-// WebMIDIClient::cancelPermissionRequest (request canceled).
+// WebMIDIPermissionRequest encapsulates a WebCore MIDIAccessInitializer
+// object and represents a request from WebCore for permissions.
+// The request must not outlive the underlying initializer object.
+// In other words, the request must be canceled when the underlying
+// initializer dies while requesting,
class WebMIDIPermissionRequest {
public:
- WebMIDIPermissionRequest(const WebMIDIPermissionRequest& o) { assign(o); }
- ~WebMIDIPermissionRequest() { reset(); };
-
+ BLINK_EXPORT WebMIDIPermissionRequest(const WebMIDIPermissionRequest& other)
+ : m_initializer(other.m_initializer) { }
BLINK_EXPORT WebSecurityOrigin securityOrigin() const;
BLINK_EXPORT void setIsAllowed(bool);
- BLINK_EXPORT void reset();
- BLINK_EXPORT void assign(const WebMIDIPermissionRequest&);
BLINK_EXPORT bool equals(const WebMIDIPermissionRequest&) const;
#if BLINK_IMPLEMENTATION
- explicit WebMIDIPermissionRequest(const PassRefPtrWillBeRawPtr<WebCore::MIDIAccess>&);
+ explicit WebMIDIPermissionRequest(WebCore::MIDIAccessInitializer*);
- WebCore::MIDIAccess* midiAccess() const { return m_private.get(); }
+ WebCore::MIDIAccessInitializer* midiAccessInitializer() const { return m_initializer; }
#endif
private:
- WebPrivatePtr<WebCore::MIDIAccess> m_private;
+ WebCore::MIDIAccessInitializer* m_initializer;
};
inline bool operator==(const WebMIDIPermissionRequest& a, const WebMIDIPermissionRequest& b)
« no previous file with comments | « public/web/WebMIDIClient.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698