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

Side by Side Diff: src/api.cc

Issue 272007: Add missing null check in Context::GetCurrent. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 2 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2742 matching lines...) Expand 10 before | Expand all | Expand 10 after
2753 if (IsDeadCheck("v8::Context::GetEntered()")) return Local<Context>(); 2753 if (IsDeadCheck("v8::Context::GetEntered()")) return Local<Context>();
2754 i::Handle<i::Object> last = thread_local.LastEnteredContext(); 2754 i::Handle<i::Object> last = thread_local.LastEnteredContext();
2755 if (last.is_null()) return Local<Context>(); 2755 if (last.is_null()) return Local<Context>();
2756 i::Handle<i::Context> context = i::Handle<i::Context>::cast(last); 2756 i::Handle<i::Context> context = i::Handle<i::Context>::cast(last);
2757 return Utils::ToLocal(context); 2757 return Utils::ToLocal(context);
2758 } 2758 }
2759 2759
2760 2760
2761 v8::Local<v8::Context> Context::GetCurrent() { 2761 v8::Local<v8::Context> Context::GetCurrent() {
2762 if (IsDeadCheck("v8::Context::GetCurrent()")) return Local<Context>(); 2762 if (IsDeadCheck("v8::Context::GetCurrent()")) return Local<Context>();
2763 i::Handle<i::Context> context(i::Top::global_context()); 2763 i::Handle<i::Object> current = i::Top::global_context();
2764 if (current.is_null()) return Local<Context>();
2765 i::Handle<i::Context> context = i::Handle<i::Context>::cast(current);
2764 return Utils::ToLocal(context); 2766 return Utils::ToLocal(context);
2765 } 2767 }
2766 2768
2767 2769
2768 v8::Local<v8::Context> Context::GetCalling() { 2770 v8::Local<v8::Context> Context::GetCalling() {
2769 if (IsDeadCheck("v8::Context::GetCalling()")) return Local<Context>(); 2771 if (IsDeadCheck("v8::Context::GetCalling()")) return Local<Context>();
2770 i::Handle<i::Object> calling = i::Top::GetCallingGlobalContext(); 2772 i::Handle<i::Object> calling = i::Top::GetCallingGlobalContext();
2771 if (calling.is_null()) return Local<Context>(); 2773 if (calling.is_null()) return Local<Context>();
2772 i::Handle<i::Context> context = i::Handle<i::Context>::cast(calling); 2774 i::Handle<i::Context> context = i::Handle<i::Context>::cast(calling);
2773 return Utils::ToLocal(context); 2775 return Utils::ToLocal(context);
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
3766 3768
3767 3769
3768 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 3770 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
3769 HandleScopeImplementer* thread_local = 3771 HandleScopeImplementer* thread_local =
3770 reinterpret_cast<HandleScopeImplementer*>(storage); 3772 reinterpret_cast<HandleScopeImplementer*>(storage);
3771 thread_local->IterateThis(v); 3773 thread_local->IterateThis(v);
3772 return storage + ArchiveSpacePerThread(); 3774 return storage + ArchiveSpacePerThread();
3773 } 3775 }
3774 3776
3775 } } // namespace v8::internal 3777 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698