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

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

Issue 189573002: Convert HTMLFrameOwnerElement and FocusController to use Frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Improved downcast checking. Created 6 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007-2009 Google Inc. All rights reserved. 2 * Copyright (C) 2007-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 17 matching lines...) Expand all
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "V8HTMLFrameElement.h" 32 #include "V8HTMLFrameElement.h"
33 33
34 #include "HTMLNames.h" 34 #include "HTMLNames.h"
35 #include "bindings/v8/BindingSecurity.h" 35 #include "bindings/v8/BindingSecurity.h"
36 #include "bindings/v8/ExceptionState.h" 36 #include "bindings/v8/ExceptionState.h"
37 #include "bindings/v8/V8Binding.h" 37 #include "bindings/v8/V8Binding.h"
38 #include "core/frame/LocalFrame.h"
dcheng 2014/03/17 18:17:44 Not clear what this new include is for.
kenrb 2014/03/18 20:01:19 Oops, not needed. I had originally added it when l
38 #include "core/html/HTMLFrameElement.h" 39 #include "core/html/HTMLFrameElement.h"
39 #include "core/html/parser/HTMLParserIdioms.h" 40 #include "core/html/parser/HTMLParserIdioms.h"
40 41
41 namespace WebCore { 42 namespace WebCore {
42 43
43 using namespace HTMLNames; 44 using namespace HTMLNames;
44 45
45 void V8HTMLFrameElement::locationAttributeSetterCustom(v8::Local<v8::Value> valu e, const v8::PropertyCallbackInfo<void>& info) 46 void V8HTMLFrameElement::locationAttributeSetterCustom(v8::Local<v8::Value> valu e, const v8::PropertyCallbackInfo<void>& info)
46 { 47 {
47 HTMLFrameElement* frame = V8HTMLFrameElement::toNative(info.Holder()); 48 HTMLFrameElement* frame = V8HTMLFrameElement::toNative(info.Holder());
48 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, locati onValue, value); 49 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, locati onValue, value);
49 50
50 ExceptionState exceptionState(ExceptionState::SetterContext, "location", "HT MLFrameElement", info.Holder(), info.GetIsolate()); 51 ExceptionState exceptionState(ExceptionState::SetterContext, "location", "HT MLFrameElement", info.Holder(), info.GetIsolate());
51 if (protocolIsJavaScript(stripLeadingAndTrailingHTMLSpaces(locationValue)) & & !BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), frame->contentFr ame(), exceptionState)) { 52 if (protocolIsJavaScript(stripLeadingAndTrailingHTMLSpaces(locationValue)) & & !BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), frame->contentFr ame(), exceptionState)) {
52 exceptionState.throwIfNeeded(); 53 exceptionState.throwIfNeeded();
53 return; 54 return;
54 } 55 }
55 56
56 frame->setLocation(locationValue); 57 frame->setLocation(locationValue);
57 } 58 }
58 59
59 } // namespace WebCore 60 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698