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

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

Issue 2686503005: Remove SerializedScriptValue::serialize and ScriptValueSerializer::serializeWTFString. (Closed)
Patch Set: Merge branch 'master' into delete-ssv 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 PassRefPtr<SerializedScriptValue> SerializedScriptValue::serialize( 63 PassRefPtr<SerializedScriptValue> SerializedScriptValue::serialize(
64 v8::Isolate* isolate, 64 v8::Isolate* isolate,
65 v8::Local<v8::Value> value, 65 v8::Local<v8::Value> value,
66 Transferables* transferables, 66 Transferables* transferables,
67 WebBlobInfoArray* blobInfo, 67 WebBlobInfoArray* blobInfo,
68 ExceptionState& exception) { 68 ExceptionState& exception) {
69 return SerializedScriptValueFactory::instance().create( 69 return SerializedScriptValueFactory::instance().create(
70 isolate, value, transferables, blobInfo, exception); 70 isolate, value, transferables, blobInfo, exception);
71 } 71 }
72 72
73 PassRefPtr<SerializedScriptValue> SerializedScriptValue::serialize(
74 const String& str) {
75 return create(ScriptValueSerializer::serializeWTFString(str));
76 }
77
78 PassRefPtr<SerializedScriptValue> 73 PassRefPtr<SerializedScriptValue>
79 SerializedScriptValue::serializeAndSwallowExceptions( 74 SerializedScriptValue::serializeAndSwallowExceptions(
80 v8::Isolate* isolate, 75 v8::Isolate* isolate,
81 v8::Local<v8::Value> value) { 76 v8::Local<v8::Value> value) {
82 DummyExceptionStateForTesting exceptionState; 77 DummyExceptionStateForTesting exceptionState;
83 RefPtr<SerializedScriptValue> serialized = 78 RefPtr<SerializedScriptValue> serialized =
84 serialize(isolate, value, nullptr, nullptr, exceptionState); 79 serialize(isolate, value, nullptr, nullptr, exceptionState);
85 if (exceptionState.hadException()) 80 if (exceptionState.hadException())
86 return nullValue(); 81 return nullValue();
87 return serialized.release(); 82 return serialized.release();
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 void SerializedScriptValue::registerMemoryAllocatedWithCurrentScriptContext() { 462 void SerializedScriptValue::registerMemoryAllocatedWithCurrentScriptContext() {
468 if (m_externallyAllocatedMemory) 463 if (m_externallyAllocatedMemory)
469 return; 464 return;
470 465
471 m_externallyAllocatedMemory = static_cast<intptr_t>(dataLengthInBytes()); 466 m_externallyAllocatedMemory = static_cast<intptr_t>(dataLengthInBytes());
472 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory( 467 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(
473 m_externallyAllocatedMemory); 468 m_externallyAllocatedMemory);
474 } 469 }
475 470
476 } // namespace blink 471 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698