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

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

Issue 2741793003: Accurate transfer of SerializedScriptValue allocation costs. (Closed)
Patch Set: sanity check diff adjustments Created 3 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) 2009, 2011 Google Inc. All rights reserved. 2 * Copyright (C) 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 // TODO(foolip): targetOrigin should be a USVString in IDL and treated as 277 // TODO(foolip): targetOrigin should be a USVString in IDL and treated as
278 // such here, without TreatNullAndUndefinedAsNullString. 278 // such here, without TreatNullAndUndefinedAsNullString.
279 TOSTRING_VOID(V8StringResource<TreatNullAndUndefinedAsNullString>, 279 TOSTRING_VOID(V8StringResource<TreatNullAndUndefinedAsNullString>,
280 targetOrigin, info[targetOriginArgIndex]); 280 targetOrigin, info[targetOriginArgIndex]);
281 281
282 RefPtr<SerializedScriptValue> message = SerializedScriptValue::serialize( 282 RefPtr<SerializedScriptValue> message = SerializedScriptValue::serialize(
283 info.GetIsolate(), info[0], &transferables, nullptr, exceptionState); 283 info.GetIsolate(), info[0], &transferables, nullptr, exceptionState);
284 if (exceptionState.hadException()) 284 if (exceptionState.hadException())
285 return; 285 return;
286 286
287 message->unregisterMemoryAllocatedWithCurrentScriptContext();
287 window->postMessage(message.get(), transferables.messagePorts, targetOrigin, 288 window->postMessage(message.get(), transferables.messagePorts, targetOrigin,
288 source, exceptionState); 289 source, exceptionState);
289 message->unregisterMemoryAllocatedByCurrentScriptContext();
290 } 290 }
291 291
292 void V8Window::openMethodCustom( 292 void V8Window::openMethodCustom(
293 const v8::FunctionCallbackInfo<v8::Value>& info) { 293 const v8::FunctionCallbackInfo<v8::Value>& info) {
294 DOMWindow* impl = V8Window::toImpl(info.Holder()); 294 DOMWindow* impl = V8Window::toImpl(info.Holder());
295 ExceptionState exceptionState( 295 ExceptionState exceptionState(
296 info.GetIsolate(), ExceptionState::ExecutionContext, "Window", "open"); 296 info.GetIsolate(), ExceptionState::ExecutionContext, "Window", "open");
297 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), 297 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()),
298 impl, exceptionState)) { 298 impl, exceptionState)) {
299 return; 299 return;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 if (items->hasExactlyOneItem()) { 393 if (items->hasExactlyOneItem()) {
394 v8SetReturnValueFast(info, items->item(0), window); 394 v8SetReturnValueFast(info, items->item(0), window);
395 return; 395 return;
396 } 396 }
397 v8SetReturnValueFast(info, items, window); 397 v8SetReturnValueFast(info, items, window);
398 return; 398 return;
399 } 399 }
400 } 400 }
401 401
402 } // namespace blink 402 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698