| OLD | NEW |
| 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 #include "net/proxy/proxy_resolver_v8.h" | 5 #include "net/proxy/proxy_resolver_v8.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cstdio> | 8 #include <cstdio> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 | 404 |
| 405 results->UsePacString(UTF16ToASCII(ret_str)); | 405 results->UsePacString(UTF16ToASCII(ret_str)); |
| 406 return OK; | 406 return OK; |
| 407 } | 407 } |
| 408 | 408 |
| 409 int InitV8(const scoped_refptr<ProxyResolverScriptData>& pac_script) { | 409 int InitV8(const scoped_refptr<ProxyResolverScriptData>& pac_script) { |
| 410 v8::Locker locked(isolate_); | 410 v8::Locker locked(isolate_); |
| 411 v8::Isolate::Scope isolate_scope(isolate_); | 411 v8::Isolate::Scope isolate_scope(isolate_); |
| 412 v8::HandleScope scope(isolate_); | 412 v8::HandleScope scope(isolate_); |
| 413 | 413 |
| 414 v8_this_.Reset(isolate_, v8::External::New(this)); | 414 v8_this_.Reset(isolate_, v8::External::New(isolate_, this)); |
| 415 v8::Local<v8::External> v8_this = | 415 v8::Local<v8::External> v8_this = |
| 416 v8::Local<v8::External>::New(isolate_, v8_this_); | 416 v8::Local<v8::External>::New(isolate_, v8_this_); |
| 417 v8::Local<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New(); | 417 v8::Local<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New(); |
| 418 | 418 |
| 419 // Attach the javascript bindings. | 419 // Attach the javascript bindings. |
| 420 v8::Local<v8::FunctionTemplate> alert_template = | 420 v8::Local<v8::FunctionTemplate> alert_template = |
| 421 v8::FunctionTemplate::New(&AlertCallback, v8_this); | 421 v8::FunctionTemplate::New(&AlertCallback, v8_this); |
| 422 global_template->Set(ASCIILiteralToV8String("alert"), alert_template); | 422 global_template->Set(ASCIILiteralToV8String("alert"), alert_template); |
| 423 | 423 |
| 424 v8::Local<v8::FunctionTemplate> my_ip_address_template = | 424 v8::Local<v8::FunctionTemplate> my_ip_address_template = |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 return 0; | 807 return 0; |
| 808 | 808 |
| 809 v8::Locker locked(g_default_isolate_); | 809 v8::Locker locked(g_default_isolate_); |
| 810 v8::Isolate::Scope isolate_scope(g_default_isolate_); | 810 v8::Isolate::Scope isolate_scope(g_default_isolate_); |
| 811 v8::HeapStatistics heap_statistics; | 811 v8::HeapStatistics heap_statistics; |
| 812 g_default_isolate_->GetHeapStatistics(&heap_statistics); | 812 g_default_isolate_->GetHeapStatistics(&heap_statistics); |
| 813 return heap_statistics.used_heap_size(); | 813 return heap_statistics.used_heap_size(); |
| 814 } | 814 } |
| 815 | 815 |
| 816 } // namespace net | 816 } // namespace net |
| OLD | NEW |