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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.h

Issue 2552673002: Eagerly dispose of ScheduledActions (reland.) (Closed)
Patch Set: Add assert Created 4 years 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 /* 1 /*
2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // We lose the encoding information from ScriptResource. 49 // We lose the encoding information from ScriptResource.
50 // Not sure if that matters. 50 // Not sure if that matters.
51 explicit ScriptSourceCode(ScriptResource*); 51 explicit ScriptSourceCode(ScriptResource*);
52 ScriptSourceCode( 52 ScriptSourceCode(
53 const String&, 53 const String&,
54 const KURL& = KURL(), 54 const KURL& = KURL(),
55 const TextPosition& startPosition = TextPosition::minimumPosition()); 55 const TextPosition& startPosition = TextPosition::minimumPosition());
56 ScriptSourceCode(ScriptStreamer*, ScriptResource*); 56 ScriptSourceCode(ScriptStreamer*, ScriptResource*);
57 57
58 ~ScriptSourceCode(); 58 ~ScriptSourceCode();
59 void dispose();
59 DECLARE_TRACE(); 60 DECLARE_TRACE();
60 61
61 bool isEmpty() const { return m_source.isEmpty(); } 62 bool isEmpty() const { return m_source.isEmpty(); }
62 63
63 // The null value represents a missing script, created by the nullary 64 // The null value represents a missing script, created by the nullary
64 // constructor, and differs from the empty script. 65 // constructor, and differs from the empty script.
65 bool isNull() const { return m_source.isNull(); } 66 bool isNull() const { return m_source.isNull(); }
66 67
67 const String& source() const { return m_source; } 68 const String& source() const { return m_source; }
68 ScriptResource* resource() const { return m_resource.get(); } 69 ScriptResource* resource() const { return m_resource; }
69 const KURL& url() const; 70 const KURL& url() const;
70 int startLine() const { return m_startPosition.m_line.oneBasedInt(); } 71 int startLine() const { return m_startPosition.m_line.oneBasedInt(); }
71 const TextPosition& startPosition() const { return m_startPosition; } 72 const TextPosition& startPosition() const { return m_startPosition; }
72 String sourceMapUrl() const; 73 String sourceMapUrl() const;
73 74
74 ScriptStreamer* streamer() const { return m_streamer.get(); } 75 ScriptStreamer* streamer() const { return m_streamer; }
75 76
76 private: 77 private:
77 void treatNullSourceAsEmpty(); 78 void treatNullSourceAsEmpty();
78 79
79 String m_source; 80 String m_source;
80 Member<ScriptResource> m_resource; 81 Member<ScriptResource> m_resource;
81 Member<ScriptStreamer> m_streamer; 82 Member<ScriptStreamer> m_streamer;
82 mutable KURL m_url; 83 mutable KURL m_url;
83 TextPosition m_startPosition; 84 TextPosition m_startPosition;
84 }; 85 };
85 86
86 } // namespace blink 87 } // namespace blink
87 88
88 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::ScriptSourceCode); 89 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::ScriptSourceCode);
89 90
90 #endif // ScriptSourceCode_h 91 #endif // ScriptSourceCode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698