| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include <string> | |
| 8 | |
| 9 #include "V8Proxy.h" | 7 #include "V8Proxy.h" |
| 10 #include "webkit/glue/devtools/bound_object.h" | 8 #include "webkit/glue/devtools/bound_object.h" |
| 11 | 9 |
| 12 BoundObject::BoundObject( | 10 BoundObject::BoundObject( |
| 13 v8::Handle<v8::Context> context, | 11 v8::Handle<v8::Context> context, |
| 14 void* v8_this, | 12 void* v8_this, |
| 15 const char* object_name) | 13 const char* object_name) |
| 16 : object_name_(object_name), | 14 : object_name_(object_name), |
| 17 context_(context) { | 15 context_(context) { |
| 18 v8::HandleScope scope; | 16 v8::HandleScope scope; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 v8::HandleScope scope; | 48 v8::HandleScope scope; |
| 51 v8::Context::Scope frame_scope(context_); | 49 v8::Context::Scope frame_scope(context_); |
| 52 | 50 |
| 53 v8::Local<v8::Function> constructor = host_template_->GetFunction(); | 51 v8::Local<v8::Function> constructor = host_template_->GetFunction(); |
| 54 bound_object_ = v8::Persistent<v8::Object>::New( | 52 bound_object_ = v8::Persistent<v8::Object>::New( |
| 55 WebCore::SafeAllocation::newInstance(constructor)); | 53 WebCore::SafeAllocation::newInstance(constructor)); |
| 56 | 54 |
| 57 v8::Handle<v8::Object> global = context_->Global(); | 55 v8::Handle<v8::Object> global = context_->Global(); |
| 58 global->Set(v8::String::New(object_name_), bound_object_); | 56 global->Set(v8::String::New(object_name_), bound_object_); |
| 59 } | 57 } |
| OLD | NEW |