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

Side by Side Diff: Source/bindings/v8/custom/V8WindowCustom.cpp

Issue 90243003: Use V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID() in V8Window::openMethodCustom() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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/v8/V8Binding.h ('k') | 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 /* 1 /*
2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2011 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 378
379 void V8Window::openMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info) 379 void V8Window::openMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
380 { 380 {
381 DOMWindow* impl = V8Window::toNative(info.Holder()); 381 DOMWindow* impl = V8Window::toNative(info.Holder());
382 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 382 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
383 if (!BindingSecurity::shouldAllowAccessToFrame(impl->frame(), exceptionState )) { 383 if (!BindingSecurity::shouldAllowAccessToFrame(impl->frame(), exceptionState )) {
384 exceptionState.throwIfNeeded(); 384 exceptionState.throwIfNeeded();
385 return; 385 return;
386 } 386 }
387 387
388 // FIXME: Handle exceptions properly. 388 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe ck>, urlString, info[0]);
389 String urlString = toWebCoreStringWithUndefinedOrNullCheck(info[0]); 389 AtomicString frameName;
390 AtomicString frameName = (info[1]->IsUndefined() || info[1]->IsNull()) ? "_b lank" : toWebCoreAtomicString(info[1]); 390 if (info[1]->IsUndefined() || info[1]->IsNull()) {
391 String windowFeaturesString = toWebCoreStringWithUndefinedOrNullCheck(info[2 ]); 391 frameName = "_blank";
392 } else {
393 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, frameNameResour ce, info[1]);
394 frameName = frameNameResource;
395 }
396 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe ck>, windowFeaturesString, info[2]);
392 397
393 RefPtr<DOMWindow> openedWindow = impl->open(urlString, frameName, windowFeat uresString, activeDOMWindow(), firstDOMWindow()); 398 RefPtr<DOMWindow> openedWindow = impl->open(urlString, frameName, windowFeat uresString, activeDOMWindow(), firstDOMWindow());
394 if (!openedWindow) 399 if (!openedWindow)
395 return; 400 return;
396 401
397 v8SetReturnValueFast(info, openedWindow.release(), impl); 402 v8SetReturnValueFast(info, openedWindow.release(), impl);
398 } 403 }
399 404
400 void V8Window::namedPropertyGetterCustom(v8::Local<v8::String> name, const v8::P ropertyCallbackInfo<v8::Value>& info) 405 void V8Window::namedPropertyGetterCustom(v8::Local<v8::String> name, const v8::P ropertyCallbackInfo<v8::Value>& info)
401 { 406 {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 v8::Handle<v8::Context> context = frame->script().currentWorldContext(); 566 v8::Handle<v8::Context> context = frame->script().currentWorldContext();
562 if (context.IsEmpty()) 567 if (context.IsEmpty())
563 return v8Undefined(); 568 return v8Undefined();
564 569
565 v8::Handle<v8::Object> global = context->Global(); 570 v8::Handle<v8::Object> global = context->Global();
566 ASSERT(!global.IsEmpty()); 571 ASSERT(!global.IsEmpty());
567 return global; 572 return global;
568 } 573 }
569 574
570 } // namespace WebCore 575 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8Binding.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698