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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp

Issue 1966183002: Always check that a Name is a String before converting it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp » ('j') | 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) 2008, 2009, 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 Frame* frame = isHTMLIFrameElement(*element) ? toHTMLIFrameElement(*elem ent).contentFrame() : 0; 522 Frame* frame = isHTMLIFrameElement(*element) ? toHTMLIFrameElement(*elem ent).contentFrame() : 0;
523 if (frame) 523 if (frame)
524 return toV8(frame->domWindow(), creationContext, isolate); 524 return toV8(frame->domWindow(), creationContext, isolate);
525 return toV8(element, creationContext, isolate); 525 return toV8(element, creationContext, isolate);
526 } 526 }
527 return toV8(RawPtr<HTMLCollection>(items.release()), creationContext, isolat e); 527 return toV8(RawPtr<HTMLCollection>(items.release()), creationContext, isolat e);
528 } 528 }
529 529
530 static void getter(v8::Local<v8::Name> property, const v8::PropertyCallbackInfo< v8::Value>& info) 530 static void getter(v8::Local<v8::Name> property, const v8::PropertyCallbackInfo< v8::Value>& info)
531 { 531 {
532 if (!property->IsString())
533 return;
532 // FIXME: Consider passing StringImpl directly. 534 // FIXME: Consider passing StringImpl directly.
533 AtomicString name = toCoreAtomicString(property.As<v8::String>()); 535 AtomicString name = toCoreAtomicString(property.As<v8::String>());
534 HTMLDocument* htmlDocument = V8HTMLDocument::toImpl(info.Holder()); 536 HTMLDocument* htmlDocument = V8HTMLDocument::toImpl(info.Holder());
535 ASSERT(htmlDocument); 537 ASSERT(htmlDocument);
536 v8::Local<v8::Value> result = getNamedProperty(htmlDocument, name, info.Hold er(), info.GetIsolate()); 538 v8::Local<v8::Value> result = getNamedProperty(htmlDocument, name, info.Hold er(), info.GetIsolate());
537 if (!result.IsEmpty()) { 539 if (!result.IsEmpty()) {
538 v8SetReturnValue(info, result); 540 v8SetReturnValue(info, result);
539 return; 541 return;
540 } 542 }
541 v8::Local<v8::Value> prototype = info.Holder()->GetPrototype(); 543 v8::Local<v8::Value> prototype = info.Holder()->GetPrototype();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 } 581 }
580 582
581 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin) 583 void WindowProxy::updateSecurityOrigin(SecurityOrigin* origin)
582 { 584 {
583 if (!isContextInitialized()) 585 if (!isContextInitialized())
584 return; 586 return;
585 setSecurityToken(origin); 587 setSecurityToken(origin);
586 } 588 }
587 589
588 } // namespace blink 590 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698