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

Side by Side Diff: chrome/renderer/extensions/bindings_utils.cc

Issue 7717019: Do not dereference potentially invalid frame pointer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup the hate Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/renderer/extensions/bindings_utils.h" 5 #include "chrome/renderer/extensions/bindings_utils.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/string_split.h" 10 #include "base/string_split.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 LOG(ERROR) << JoinString(components, ','); 127 LOG(ERROR) << JoinString(components, ',');
128 return v8::Undefined(); 128 return v8::Undefined();
129 } 129 }
130 130
131 ContextInfo::ContextInfo(v8::Persistent<v8::Context> context, 131 ContextInfo::ContextInfo(v8::Persistent<v8::Context> context,
132 const std::string& extension_id, 132 const std::string& extension_id,
133 WebFrame* frame) 133 WebFrame* frame)
134 : context(context), 134 : context(context),
135 extension_id(extension_id), 135 extension_id(extension_id),
136 frame(frame), 136 unsafe_frame(frame),
137 num_connected_events(0) { 137 num_connected_events(0) {
138 } 138 }
139 139
140 ContextInfo::~ContextInfo() {} 140 ContextInfo::~ContextInfo() {}
141 141
142 ContextList& GetContexts() { 142 ContextList& GetContexts() {
143 return g_singleton_data.Get().contexts; 143 return g_singleton_data.Get().contexts;
144 } 144 }
145 145
146 ContextInfo* GetInfoForCurrentContext() { 146 ContextInfo* GetInfoForCurrentContext() {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 216 }
217 217
218 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(value); 218 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(value);
219 if (!function.IsEmpty()) 219 if (!function.IsEmpty())
220 return function->Call(v8::Object::New(), argc, argv); 220 return function->Call(v8::Object::New(), argc, argv);
221 221
222 return v8::Undefined(); 222 return v8::Undefined();
223 } 223 }
224 224
225 } // namespace bindings_utils 225 } // namespace bindings_utils
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/bindings_utils.h ('k') | chrome/renderer/extensions/event_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698