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

Side by Side Diff: Source/bindings/v8/ScriptState.h

Issue 23788005: Remove calls to HandleScope default ctor. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: code review (pfeldman) Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/ScriptScope.cpp ('k') | Source/bindings/v8/ScriptState.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) 2008, 2009, 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 WTF_MAKE_NONCOPYABLE(ScriptStateProtectedPtr); 102 WTF_MAKE_NONCOPYABLE(ScriptStateProtectedPtr);
103 public: 103 public:
104 ScriptStateProtectedPtr() 104 ScriptStateProtectedPtr()
105 : m_scriptState(0) 105 : m_scriptState(0)
106 { 106 {
107 } 107 }
108 108
109 ScriptStateProtectedPtr(ScriptState* scriptState) 109 ScriptStateProtectedPtr(ScriptState* scriptState)
110 : m_scriptState(scriptState) 110 : m_scriptState(scriptState)
111 { 111 {
112 v8::HandleScope handleScope; 112 v8::HandleScope handleScope(scriptState->isolate());
113 // Keep the context from being GC'ed. ScriptState is guaranteed to be li ve while the context is live. 113 // Keep the context from being GC'ed. ScriptState is guaranteed to be li ve while the context is live.
114 m_context.set(scriptState->isolate(), scriptState->context()); 114 m_context.set(scriptState->isolate(), scriptState->context());
115 } 115 }
116 116
117 ScriptState* get() const { return m_scriptState; } 117 ScriptState* get() const { return m_scriptState; }
118 118
119 private: 119 private:
120 ScriptState* m_scriptState; 120 ScriptState* m_scriptState;
121 ScopedPersistent<v8::Context> m_context; 121 ScopedPersistent<v8::Context> m_context;
122 }; 122 };
123 123
124 ScriptState* mainWorldScriptState(Frame*); 124 ScriptState* mainWorldScriptState(Frame*);
125 125
126 ScriptState* scriptStateFromWorkerGlobalScope(WorkerGlobalScope*); 126 ScriptState* scriptStateFromWorkerGlobalScope(WorkerGlobalScope*);
127 127
128 } 128 }
129 129
130 #endif // ScriptState_h 130 #endif // ScriptState_h
OLDNEW
« no previous file with comments | « Source/bindings/v8/ScriptScope.cpp ('k') | Source/bindings/v8/ScriptState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698