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

Side by Side Diff: Source/core/css/MediaQueryListListener.h

Issue 349183006: Use ScriptController to call callback in MediaQueryListListener (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/css/MediaQueryListListener.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 12 matching lines...) Expand all
23 #include "bindings/v8/ScriptState.h" 23 #include "bindings/v8/ScriptState.h"
24 #include "bindings/v8/ScriptValue.h" 24 #include "bindings/v8/ScriptValue.h"
25 #include "platform/heap/Handle.h" 25 #include "platform/heap/Handle.h"
26 #include "wtf/RefCounted.h" 26 #include "wtf/RefCounted.h"
27 27
28 namespace WebCore { 28 namespace WebCore {
29 29
30 class MediaQueryList; 30 class MediaQueryList;
31 31
32 // See http://dev.w3.org/csswg/cssom-view/#the-mediaquerylist-interface 32 // See http://dev.w3.org/csswg/cssom-view/#the-mediaquerylist-interface
33 33 // FIXME: MediaQueryListListener should be implemented using callback interface
34 class MediaQueryListListener : public RefCountedWillBeGarbageCollectedFinalized< MediaQueryListListener> { 34 class MediaQueryListListener : public RefCountedWillBeGarbageCollectedFinalized< MediaQueryListListener> {
35 public: 35 public:
36 static PassRefPtrWillBeRawPtr<MediaQueryListListener> create(ScriptState* sc riptState, const ScriptValue& value) 36 static PassRefPtrWillBeRawPtr<MediaQueryListListener> create(ScriptState* sc riptState, const ScriptValue& value)
37 { 37 {
38 if (!value.isFunction()) 38 if (!value.isFunction())
39 return nullptr; 39 return nullptr;
40 return adoptRefWillBeNoop(new MediaQueryListListener(scriptState, value) ); 40 return adoptRefWillBeNoop(new MediaQueryListListener(scriptState, value) );
41 } 41 }
42 void queryChanged(MediaQueryList*); 42 void queryChanged(MediaQueryList*);
43 43
44 bool operator==(const MediaQueryListListener& other) const { return m_functi on == other.m_function; } 44 bool operator==(const MediaQueryListListener& other) const { return m_functi on == other.m_function; }
45 45
46 void trace(Visitor*) { } 46 void trace(Visitor*) { }
47 47
48 private: 48 private:
49 MediaQueryListListener(ScriptState*, const ScriptValue&); 49 MediaQueryListListener(ScriptState*, const ScriptValue&);
50 50
51 RefPtr<ScriptState> m_scriptState; 51 RefPtr<ScriptState> m_scriptState;
52 ScriptValue m_function; 52 ScriptValue m_function;
53 }; 53 };
54 54
55 } 55 }
56 56
57 #endif // MediaQueryListListener_h 57 #endif // MediaQueryListListener_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/MediaQueryListListener.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698