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

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

Issue 2061113002: Remove ExceptionState::throwIfNeeded Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 5 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) 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 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // Sandbox detached frames - they can't create cross origin objects. 113 // Sandbox detached frames - they can't create cross origin objects.
114 LocalDOMWindow* callingWindow = currentDOMWindow(isolate); 114 LocalDOMWindow* callingWindow = currentDOMWindow(isolate);
115 DOMWindow* targetWindow = toDOMWindow(contextForWrapper); 115 DOMWindow* targetWindow = toDOMWindow(contextForWrapper);
116 if (callingWindow->document()->getSecurityOrigin()->canAccessCheckSubori gins(targetWindow->document()->getSecurityOrigin())) 116 if (callingWindow->document()->getSecurityOrigin()->canAccessCheckSubori gins(targetWindow->document()->getSecurityOrigin()))
117 return; 117 return;
118 118
119 // TODO(jochen): Currently, Location is the only object for which we can reach this code path. Should be generalized. 119 // TODO(jochen): Currently, Location is the only object for which we can reach this code path. Should be generalized.
120 ExceptionState exceptionState(ExceptionState::ConstructionContext, "Loca tion", contextForWrapper->Global(), isolate); 120 ExceptionState exceptionState(ExceptionState::ConstructionContext, "Loca tion", contextForWrapper->Global(), isolate);
121 // We can't create a better message for a detached frame. 121 // We can't create a better message for a detached frame.
122 exceptionState.throwSecurityError(String(), String()); 122 exceptionState.throwSecurityError(String(), String());
123 exceptionState.throwIfNeeded();
124 return; 123 return;
125 } 124 }
126 const DOMWrapperWorld& currentWorld = DOMWrapperWorld::world(m_context); 125 const DOMWrapperWorld& currentWorld = DOMWrapperWorld::world(m_context);
127 RELEASE_ASSERT(currentWorld.worldId() == DOMWrapperWorld::world(contextForWr apper).worldId()); 126 RELEASE_ASSERT(currentWorld.worldId() == DOMWrapperWorld::world(contextForWr apper).worldId());
128 if (currentWorld.isMainWorld()) { 127 if (currentWorld.isMainWorld()) {
129 RELEASE_ASSERT(BindingSecurity::shouldAllowAccessToFrame(isolate, curren tDOMWindow(isolate), frame, DoNotReportSecurityError)); 128 RELEASE_ASSERT(BindingSecurity::shouldAllowAccessToFrame(isolate, curren tDOMWindow(isolate), frame, DoNotReportSecurityError));
130 } 129 }
131 } 130 }
132 131
133 void V8WrapperInstantiationScope::convertException() 132 void V8WrapperInstantiationScope::convertException()
134 { 133 {
135 v8::Isolate* isolate = m_context->GetIsolate(); 134 v8::Isolate* isolate = m_context->GetIsolate();
136 // TODO(jochen): Currently, Location is the only object for which we can rea ch this code path. Should be generalized. 135 // TODO(jochen): Currently, Location is the only object for which we can rea ch this code path. Should be generalized.
137 ExceptionState exceptionState(ExceptionState::ConstructionContext, "Location ", isolate->GetCurrentContext()->Global(), isolate); 136 ExceptionState exceptionState(ExceptionState::ConstructionContext, "Location ", isolate->GetCurrentContext()->Global(), isolate);
138 LocalDOMWindow* callingWindow = currentDOMWindow(isolate); 137 LocalDOMWindow* callingWindow = currentDOMWindow(isolate);
139 DOMWindow* targetWindow = toDOMWindow(m_context); 138 DOMWindow* targetWindow = toDOMWindow(m_context);
140 exceptionState.throwSecurityError(targetWindow->sanitizedCrossDomainAccessEr rorMessage(callingWindow), targetWindow->crossDomainAccessErrorMessage(callingWi ndow)); 139 exceptionState.throwSecurityError(targetWindow->sanitizedCrossDomainAccessEr rorMessage(callingWindow), targetWindow->crossDomainAccessErrorMessage(callingWi ndow));
141 exceptionState.throwIfNeeded();
142 } 140 }
143 141
144 } // namespace blink 142 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698