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

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

Issue 100963003: Use V8TRYCATCH_FOR_V8STRINGRESOURCE() macro instead of toCoreStringWithUndefinedOrNullCheck() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove toCoreString(v8::Handle<v8::Value> value) 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
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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 357
358 void V8Window::showModalDialogMethodCustom(const v8::FunctionCallbackInfo<v8::Va lue>& info) 358 void V8Window::showModalDialogMethodCustom(const v8::FunctionCallbackInfo<v8::Va lue>& info)
359 { 359 {
360 DOMWindow* impl = V8Window::toNative(info.Holder()); 360 DOMWindow* impl = V8Window::toNative(info.Holder());
361 ExceptionState exceptionState(ExceptionState::ExecutionContext, "showModalDi alog", "Window", info.Holder(), info.GetIsolate()); 361 ExceptionState exceptionState(ExceptionState::ExecutionContext, "showModalDi alog", "Window", info.Holder(), info.GetIsolate());
362 if (!BindingSecurity::shouldAllowAccessToFrame(impl->frame(), exceptionState )) { 362 if (!BindingSecurity::shouldAllowAccessToFrame(impl->frame(), exceptionState )) {
363 exceptionState.throwIfNeeded(); 363 exceptionState.throwIfNeeded();
364 return; 364 return;
365 } 365 }
366 366
367 // FIXME: Handle exceptions properly. 367 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe ck>, urlString, info[0]);
368 String urlString = toCoreStringWithUndefinedOrNullCheck(info[0]);
369 DialogHandler handler(info[1]); 368 DialogHandler handler(info[1]);
370 String dialogFeaturesString = toCoreStringWithUndefinedOrNullCheck(info[2]); 369 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullChe ck>, dialogFeaturesString, info[2]);
371 370
372 impl->showModalDialog(urlString, dialogFeaturesString, activeDOMWindow(), fi rstDOMWindow(), setUpDialog, &handler); 371 impl->showModalDialog(urlString, dialogFeaturesString, activeDOMWindow(), fi rstDOMWindow(), setUpDialog, &handler);
373 372
374 v8SetReturnValue(info, handler.returnValue(info.GetIsolate())); 373 v8SetReturnValue(info, handler.returnValue(info.GetIsolate()));
375 } 374 }
376 375
377 void V8Window::openMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info) 376 void V8Window::openMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
378 { 377 {
379 DOMWindow* impl = V8Window::toNative(info.Holder()); 378 DOMWindow* impl = V8Window::toNative(info.Holder());
380 ExceptionState exceptionState(ExceptionState::ExecutionContext, "open", "Win dow", info.Holder(), info.GetIsolate()); 379 ExceptionState exceptionState(ExceptionState::ExecutionContext, "open", "Win dow", info.Holder(), info.GetIsolate());
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 v8::Handle<v8::Context> context = frame->script().currentWorldContext(); 563 v8::Handle<v8::Context> context = frame->script().currentWorldContext();
565 if (context.IsEmpty()) 564 if (context.IsEmpty())
566 return v8Undefined(); 565 return v8Undefined();
567 566
568 v8::Handle<v8::Object> global = context->Global(); 567 v8::Handle<v8::Object> global = context->Global();
569 ASSERT(!global.IsEmpty()); 568 ASSERT(!global.IsEmpty());
570 return global; 569 return global;
571 } 570 }
572 571
573 } // namespace WebCore 572 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698