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

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

Issue 2555653002: [WIP Prototype] ES6 https://html.spec.whatwg.org/#fetch-a-single-module-script implementation (Closed)
Patch Set: rebased Created 3 years, 8 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // TODO(yukishiino): This code does not create a wrapper with 65 // TODO(yukishiino): This code does not create a wrapper with
66 // the correct settings. Should follow the same way as 66 // the correct settings. Should follow the same way as
67 // V8PerContextData::createWrapperFromCache, though there is no need to 67 // V8PerContextData::createWrapperFromCache, though there is no need to
68 // cache resulting objects or their constructors. 68 // cache resulting objects or their constructors.
69 const DOMWrapperWorld& world = DOMWrapperWorld::World(scope.GetContext()); 69 const DOMWrapperWorld& world = DOMWrapperWorld::World(scope.GetContext());
70 wrapper = type->domTemplate(isolate, world) 70 wrapper = type->domTemplate(isolate, world)
71 ->InstanceTemplate() 71 ->InstanceTemplate()
72 ->NewInstance(scope.GetContext()) 72 ->NewInstance(scope.GetContext())
73 .ToLocalChecked(); 73 .ToLocalChecked();
74 } 74 }
75 DCHECK(!wrapper.IsEmpty());
75 return wrapper; 76 return wrapper;
76 } 77 }
77 78
78 bool V8DOMWrapper::IsWrapper(v8::Isolate* isolate, v8::Local<v8::Value> value) { 79 bool V8DOMWrapper::IsWrapper(v8::Isolate* isolate, v8::Local<v8::Value> value) {
79 if (value.IsEmpty() || !value->IsObject()) 80 if (value.IsEmpty() || !value->IsObject())
80 return false; 81 return false;
81 v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(value); 82 v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(value);
82 83
83 if (object->InternalFieldCount() < kV8DefaultWrapperInternalFieldCount) 84 if (object->InternalFieldCount() < kV8DefaultWrapperInternalFieldCount)
84 return false; 85 return false;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 ExceptionState exception_state(isolate, ExceptionState::kConstructionContext, 151 ExceptionState exception_state(isolate, ExceptionState::kConstructionContext,
151 "Location"); 152 "Location");
152 LocalDOMWindow* calling_window = CurrentDOMWindow(isolate); 153 LocalDOMWindow* calling_window = CurrentDOMWindow(isolate);
153 LocalDOMWindow* target_window = ToLocalDOMWindow(context_); 154 LocalDOMWindow* target_window = ToLocalDOMWindow(context_);
154 exception_state.ThrowSecurityError( 155 exception_state.ThrowSecurityError(
155 target_window->SanitizedCrossDomainAccessErrorMessage(calling_window), 156 target_window->SanitizedCrossDomainAccessErrorMessage(calling_window),
156 target_window->CrossDomainAccessErrorMessage(calling_window)); 157 target_window->CrossDomainAccessErrorMessage(calling_window));
157 } 158 }
158 159
159 } // namespace blink 160 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp ('k') | third_party/WebKit/Source/core/dom/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698