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

Side by Side Diff: webkit/glue/cpp_bound_class.cc

Issue 12493009: Delete usage of obsolete macros (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 9 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 | « no previous file | webkit/glue/webkit_glue.cc » ('j') | webkit/glue/webkit_glue.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file contains definitions for CppBoundClass 5 // This file contains definitions for CppBoundClass
6 6
7 // Here's the control flow of a JS method getting forwarded to a class. 7 // Here's the control flow of a JS method getting forwarded to a class.
8 // - Something calls our NPObject with a function like "Invoke". 8 // - Something calls our NPObject with a function like "Invoke".
9 // - CppNPObject's static invoke() function forwards it to its attached 9 // - CppNPObject's static invoke() function forwards it to its attached
10 // CppBoundClass's Invoke() method. 10 // CppBoundClass's Invoke() method.
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 obj->bound_class = this; 307 obj->bound_class = this;
308 self_variant_.Set(np_obj); 308 self_variant_.Set(np_obj);
309 WebBindings::releaseObject(np_obj); // CppVariant takes the reference. 309 WebBindings::releaseObject(np_obj); // CppVariant takes the reference.
310 } 310 }
311 DCHECK(self_variant_.isObject()); 311 DCHECK(self_variant_.isObject());
312 return &self_variant_; 312 return &self_variant_;
313 } 313 }
314 314
315 void CppBoundClass::BindToJavascript(WebFrame* frame, 315 void CppBoundClass::BindToJavascript(WebFrame* frame,
316 const std::string& classname) { 316 const std::string& classname) {
317 #if WEBKIT_USING_JSC
318 #error "This is not going to work anymore...but it's not clear what the solution is...or if it's still necessary."
319 JSC::JSLock lock(false);
320 #endif
321
322 // BindToWindowObject will take its own reference to the NPObject, and clean 317 // BindToWindowObject will take its own reference to the NPObject, and clean
323 // up after itself. It will also (indirectly) register the object with V8, 318 // up after itself. It will also (indirectly) register the object with V8,
324 // so we must remember this so we can unregister it when we're destroyed. 319 // so we must remember this so we can unregister it when we're destroyed.
325 frame->bindToWindowObject(ASCIIToUTF16(classname), 320 frame->bindToWindowObject(ASCIIToUTF16(classname),
326 NPVARIANT_TO_OBJECT(*GetAsCppVariant())); 321 NPVARIANT_TO_OBJECT(*GetAsCppVariant()));
327 bound_to_frame_ = true; 322 bound_to_frame_ = true;
328 } 323 }
329 324
330 } // namespace webkit_glue 325 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « no previous file | webkit/glue/webkit_glue.cc » ('j') | webkit/glue/webkit_glue.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698