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

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

Issue 28024: Add a check for empty handle in V8Proxy::GetSourceLineNumber()... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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 (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 3456 matching lines...) Expand 10 before | Expand all | Expand 10 after
3467 if (utility_context.IsEmpty()) { 3467 if (utility_context.IsEmpty()) {
3468 return 0; 3468 return 0;
3469 } 3469 }
3470 v8::Context::Scope context_scope(utility_context); 3470 v8::Context::Scope context_scope(utility_context);
3471 v8::Handle<v8::Function> frame_source_line; 3471 v8::Handle<v8::Function> frame_source_line;
3472 frame_source_line = v8::Local<v8::Function>::Cast( 3472 frame_source_line = v8::Local<v8::Function>::Cast(
3473 utility_context->Global()->Get(v8::String::New("frame_source_line"))); 3473 utility_context->Global()->Get(v8::String::New("frame_source_line")));
3474 if (frame_source_line.IsEmpty()) { 3474 if (frame_source_line.IsEmpty()) {
3475 return 0; 3475 return 0;
3476 } 3476 }
3477 return v8::Debug::Call(frame_source_line)->Int32Value(); 3477 v8::Handle<v8::Value> result = v8::Debug::Call(frame_source_line);
3478 if (result.IsEmpty()) {
3479 return 0;
3480 }
3481 return result->Int32Value();
3478 } 3482 }
3479 3483
3480 3484
3481 String V8Proxy::GetSourceName() { 3485 String V8Proxy::GetSourceName() {
3482 v8::HandleScope scope; 3486 v8::HandleScope scope;
3483 v8::Handle<v8::Context> utility_context = GetUtilityContext(); 3487 v8::Handle<v8::Context> utility_context = GetUtilityContext();
3484 if (utility_context.IsEmpty()) { 3488 if (utility_context.IsEmpty()) {
3485 return String(); 3489 return String();
3486 } 3490 }
3487 v8::Context::Scope context_scope(utility_context); 3491 v8::Context::Scope context_scope(utility_context);
3488 v8::Handle<v8::Function> frame_source_name; 3492 v8::Handle<v8::Function> frame_source_name;
3489 frame_source_name = v8::Local<v8::Function>::Cast( 3493 frame_source_name = v8::Local<v8::Function>::Cast(
3490 utility_context->Global()->Get(v8::String::New("frame_source_name"))); 3494 utility_context->Global()->Get(v8::String::New("frame_source_name")));
3491 if (frame_source_name.IsEmpty()) { 3495 if (frame_source_name.IsEmpty()) {
3492 return String(); 3496 return String();
3493 } 3497 }
3494 return ToWebCoreString(v8::Debug::Call(frame_source_name)); 3498 return ToWebCoreString(v8::Debug::Call(frame_source_name));
3495 } 3499 }
3496 3500
3497 void V8Proxy::RegisterExtension(v8::Extension* extension) { 3501 void V8Proxy::RegisterExtension(v8::Extension* extension) {
3498 v8::RegisterExtension(extension); 3502 v8::RegisterExtension(extension);
3499 m_extensions.push_back(extension); 3503 m_extensions.push_back(extension);
3500 } 3504 }
3501 3505
3502 } // namespace WebCore 3506 } // namespace WebCore
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