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

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

Issue 2705783004: Throw security errors for attribute access on detached windows. (Closed)
Patch Set: Bad tests Created 3 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
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp ('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 Google Inc. All rights reserved. 2 * Copyright (C) 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 #include "public/platform/WebScheduler.h" 62 #include "public/platform/WebScheduler.h"
63 #include "public/platform/WebThread.h" 63 #include "public/platform/WebThread.h"
64 #include "wtf/AddressSanitizer.h" 64 #include "wtf/AddressSanitizer.h"
65 #include "wtf/PtrUtil.h" 65 #include "wtf/PtrUtil.h"
66 #include "wtf/RefPtr.h" 66 #include "wtf/RefPtr.h"
67 #include "wtf/text/WTFString.h" 67 #include "wtf/text/WTFString.h"
68 #include "wtf/typed_arrays/ArrayBufferContents.h" 68 #include "wtf/typed_arrays/ArrayBufferContents.h"
69 69
70 namespace blink { 70 namespace blink {
71 71
72 // TODO(dcheng): This function should be changed to return a DOMWindow.
73 // Returning Frame is problematic, as detached DOMWindow/Location objects do not
74 // point back to a Frame. For Window, this is not a problem: the security origin
75 // can still be determined from the Document. However, Blink currently violates
76 // the HTML standard for Location [1] and only has one Location object for the
77 // Frame; this makes it impossible to determine the security origin of the a
78 // detached Location object.
79 //
80 // From https://whatwg.org/C/browsers.html#the-location-interface:
81 // Each Window object is associated with a unique instance of a Location object,
82 // allocated when the Window object is created.
72 static Frame* findFrame(v8::Isolate* isolate, 83 static Frame* findFrame(v8::Isolate* isolate,
73 v8::Local<v8::Object> host, 84 v8::Local<v8::Object> host,
74 v8::Local<v8::Value> data) { 85 v8::Local<v8::Value> data) {
75 const WrapperTypeInfo* type = WrapperTypeInfo::unwrap(data); 86 const WrapperTypeInfo* type = WrapperTypeInfo::unwrap(data);
76 87
77 if (V8Window::wrapperTypeInfo.equals(type)) { 88 if (V8Window::wrapperTypeInfo.equals(type)) {
78 v8::Local<v8::Object> windowWrapper = 89 v8::Local<v8::Object> windowWrapper =
79 V8Window::findInstanceInPrototypeChain(host, isolate); 90 V8Window::findInstanceInPrototypeChain(host, isolate);
80 if (windowWrapper.IsEmpty()) 91 if (windowWrapper.IsEmpty())
81 return 0; 92 return 0;
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 v8::Isolate::kMessageLog); 527 v8::Isolate::kMessageLog);
517 isolate->SetFatalErrorHandler(reportFatalErrorInWorker); 528 isolate->SetFatalErrorHandler(reportFatalErrorInWorker);
518 529
519 uint32_t here; 530 uint32_t here;
520 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here) - 531 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here) -
521 kWorkerMaxStackSize); 532 kWorkerMaxStackSize);
522 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker); 533 isolate->SetPromiseRejectCallback(promiseRejectHandlerInWorker);
523 } 534 }
524 535
525 } // namespace blink 536 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698