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

Side by Side Diff: webkit/port/bindings/v8/v8_helpers.cpp

Issue 14031: Fix for http://code.google.com/p/chromium/issues/detail?id=5409.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 | Annotate | Revision Log
« no previous file with comments | « webkit/port/bindings/v8/v8_custom.h ('k') | webkit/port/bindings/v8/v8_npobject.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 // Copyright (c) 2008, Google Inc. 1 // Copyright (c) 2008, Google Inc.
2 // All rights reserved. 2 // 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 20 matching lines...) Expand all
31 31
32 #define max max 32 #define max max
33 #define min min 33 #define min min
34 #include "v8_helpers.h" 34 #include "v8_helpers.h"
35 #include "v8_proxy.h" 35 #include "v8_proxy.h"
36 #include "v8_index.h" 36 #include "v8_index.h"
37 #include "np_v8object.h" 37 #include "np_v8object.h"
38 38
39 #include "DOMWindow.h" 39 #include "DOMWindow.h"
40 40
41 using WebCore::V8Custom;
42
41 void WrapNPObject(v8::Handle<v8::Object> obj, NPObject* npobj) { 43 void WrapNPObject(v8::Handle<v8::Object> obj, NPObject* npobj) {
42 ASSERT(obj->InternalFieldCount() >= 3);
43
44 WebCore::V8Proxy::SetDOMWrapper(obj, WebCore::V8ClassIndex::NPOBJECT, npobj); 44 WebCore::V8Proxy::SetDOMWrapper(obj, WebCore::V8ClassIndex::NPOBJECT, npobj);
45
46 // Create a JS object as a hash map for functions
47 obj->SetInternalField(2, v8::Object::New());
48 } 45 }
49 46
50 v8::Local<v8::Context> GetV8Context(NPP npp, NPObject* npobj) { 47 v8::Local<v8::Context> GetV8Context(NPP npp, NPObject* npobj) {
51 V8NPObject* object = reinterpret_cast<V8NPObject*>(npobj); 48 V8NPObject* object = reinterpret_cast<V8NPObject*>(npobj);
52 return WebCore::V8Proxy::GetContext(object->root_object->frame()); 49 return WebCore::V8Proxy::GetContext(object->root_object->frame());
53 } 50 }
54 51
55 WebCore::V8Proxy* GetV8Proxy(NPObject* npobj) { 52 WebCore::V8Proxy* GetV8Proxy(NPObject* npobj) {
56 V8NPObject* object = reinterpret_cast<V8NPObject*>(npobj); 53 V8NPObject* object = reinterpret_cast<V8NPObject*>(npobj);
57 WebCore::Frame* frame = object->root_object->frame(); 54 WebCore::Frame* frame = object->root_object->frame();
58 return WebCore::V8Proxy::retrieve(frame); 55 return WebCore::V8Proxy::retrieve(frame);
59 } 56 }
OLDNEW
« no previous file with comments | « webkit/port/bindings/v8/v8_custom.h ('k') | webkit/port/bindings/v8/v8_npobject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698