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

Side by Side Diff: Source/bindings/core/v8/V8Binding.cpp

Issue 537403002: bindings: Renames from/toInternalPointer, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 6 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
« no previous file with comments | « Source/bindings/core/v8/V8Binding.h ('k') | Source/bindings/core/v8/V8BindingTest.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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. 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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 // DOMString to a sequence of Unicode characters" is used subsequently 611 // DOMString to a sequence of Unicode characters" is used subsequently
612 // when converting to an IDL value 612 // when converting to an IDL value
613 String x = toCoreString(stringObject); 613 String x = toCoreString(stringObject);
614 return replaceUnmatchedSurrogates(x); 614 return replaceUnmatchedSurrogates(x);
615 } 615 }
616 616
617 PassRefPtrWillBeRawPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value> value, v8::Isolate* isolate) 617 PassRefPtrWillBeRawPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value> value, v8::Isolate* isolate)
618 { 618 {
619 RefPtrWillBeRawPtr<XPathNSResolver> resolver = nullptr; 619 RefPtrWillBeRawPtr<XPathNSResolver> resolver = nullptr;
620 if (V8XPathNSResolver::hasInstance(value, isolate)) 620 if (V8XPathNSResolver::hasInstance(value, isolate))
621 resolver = V8XPathNSResolver::toNative(v8::Handle<v8::Object>::Cast(valu e)); 621 resolver = V8XPathNSResolver::toImpl(v8::Handle<v8::Object>::Cast(value) );
622 else if (value->IsObject()) 622 else if (value->IsObject())
623 resolver = V8CustomXPathNSResolver::create(value->ToObject(), isolate); 623 resolver = V8CustomXPathNSResolver::create(value->ToObject(), isolate);
624 return resolver; 624 return resolver;
625 } 625 }
626 626
627 LocalDOMWindow* toDOMWindow(v8::Handle<v8::Value> value, v8::Isolate* isolate) 627 LocalDOMWindow* toDOMWindow(v8::Handle<v8::Value> value, v8::Isolate* isolate)
628 { 628 {
629 if (value.IsEmpty() || !value->IsObject()) 629 if (value.IsEmpty() || !value->IsObject())
630 return 0; 630 return 0;
631 631
632 v8::Handle<v8::Object> windowWrapper = V8Window::findInstanceInPrototypeChai n(v8::Handle<v8::Object>::Cast(value), isolate); 632 v8::Handle<v8::Object> windowWrapper = V8Window::findInstanceInPrototypeChai n(v8::Handle<v8::Object>::Cast(value), isolate);
633 if (!windowWrapper.IsEmpty()) 633 if (!windowWrapper.IsEmpty())
634 return V8Window::toNative(windowWrapper); 634 return V8Window::toImpl(windowWrapper);
635 return 0; 635 return 0;
636 } 636 }
637 637
638 LocalDOMWindow* toDOMWindow(v8::Handle<v8::Context> context) 638 LocalDOMWindow* toDOMWindow(v8::Handle<v8::Context> context)
639 { 639 {
640 if (context.IsEmpty()) 640 if (context.IsEmpty())
641 return 0; 641 return 0;
642 return toDOMWindow(context->Global(), context->GetIsolate()); 642 return toDOMWindow(context->Global(), context->GetIsolate());
643 } 643 }
644 644
(...skipping 27 matching lines...) Expand all
672 return toDOMWindow(context); 672 return toDOMWindow(context);
673 } 673 }
674 674
675 ExecutionContext* toExecutionContext(v8::Handle<v8::Context> context) 675 ExecutionContext* toExecutionContext(v8::Handle<v8::Context> context)
676 { 676 {
677 if (context.IsEmpty()) 677 if (context.IsEmpty())
678 return 0; 678 return 0;
679 v8::Handle<v8::Object> global = context->Global(); 679 v8::Handle<v8::Object> global = context->Global();
680 v8::Handle<v8::Object> windowWrapper = V8Window::findInstanceInPrototypeChai n(global, context->GetIsolate()); 680 v8::Handle<v8::Object> windowWrapper = V8Window::findInstanceInPrototypeChai n(global, context->GetIsolate());
681 if (!windowWrapper.IsEmpty()) 681 if (!windowWrapper.IsEmpty())
682 return V8Window::toNative(windowWrapper)->executionContext(); 682 return V8Window::toImpl(windowWrapper)->executionContext();
683 v8::Handle<v8::Object> workerWrapper = V8WorkerGlobalScope::findInstanceInPr ototypeChain(global, context->GetIsolate()); 683 v8::Handle<v8::Object> workerWrapper = V8WorkerGlobalScope::findInstanceInPr ototypeChain(global, context->GetIsolate());
684 if (!workerWrapper.IsEmpty()) 684 if (!workerWrapper.IsEmpty())
685 return V8WorkerGlobalScope::toNative(workerWrapper)->executionContext(); 685 return V8WorkerGlobalScope::toImpl(workerWrapper)->executionContext();
686 // FIXME: Is this line of code reachable? 686 // FIXME: Is this line of code reachable?
687 return 0; 687 return 0;
688 } 688 }
689 689
690 ExecutionContext* currentExecutionContext(v8::Isolate* isolate) 690 ExecutionContext* currentExecutionContext(v8::Isolate* isolate)
691 { 691 {
692 return toExecutionContext(isolate->GetCurrentContext()); 692 return toExecutionContext(isolate->GetCurrentContext());
693 } 693 }
694 694
695 ExecutionContext* callingExecutionContext(v8::Isolate* isolate) 695 ExecutionContext* callingExecutionContext(v8::Isolate* isolate)
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(Executio nContext* context, v8::Handle<v8::Function> function, v8::Isolate* isolate) 904 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(Executio nContext* context, v8::Handle<v8::Function> function, v8::Isolate* isolate)
905 { 905 {
906 int scriptId = 0; 906 int scriptId = 0;
907 String resourceName; 907 String resourceName;
908 int lineNumber = 1; 908 int lineNumber = 1;
909 GetDevToolsFunctionInfo(function, isolate, scriptId, resourceName, lineNumbe r); 909 GetDevToolsFunctionInfo(function, isolate, scriptId, resourceName, lineNumbe r);
910 return InspectorFunctionCallEvent::data(context, scriptId, resourceName, lin eNumber); 910 return InspectorFunctionCallEvent::data(context, scriptId, resourceName, lin eNumber);
911 } 911 }
912 912
913 } // namespace blink 913 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8Binding.h ('k') | Source/bindings/core/v8/V8BindingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698